Hot answers tagged

8

This is following Jens's suggestion to use a different Unicode glyph, but different from the answer linked in the corresponding comment. We can use Unicode directly, so let's just find a letter-like modifier glyph that looks good. A quick search for "prime" gives a nice solution in MODIFIER LETTER PRIME. You can type it using the notation \:02b9 which ...


7

As mentioned in my comment to the question, I think the best solution is to use a Unicode character (see also the answer by The Vee). Here is a modified version of my earlier answer: SetOptions[EvaluationNotebook[], InputAliases -> DeleteDuplicates@ Join[{"'" -> FromCharacterCode[700]}, InputAliases /. ...


6

It is because there is no general solution for your problem, even for b being a positive integer: When b is odd, the maximum is positive infinity, while for even b it is not. You may want to use things like Maximize[-x^# + a*x, x] & /@ Table[i, {i, 5}] to observe.


5

Direct Integration Possible issues in performing the integrations include choice of Assumptions, branch cuts in the integrands, and how limits are taken. Addressing the first of these gives five solutions. il[f_, s_, t_] := Module[{r}, 1/(2 π I) Integrate[f Exp[s t], {s, r - I ∞, r + I ∞}, Assumptions -> r > 2 && t > 0]] ...


4

This is a method that is similar to Oleksandr R.'s answer: The following tells Mathematica to render Primed symbols in superscripted box form: MakeBoxes[Primed[x_], StandardForm] := SuperscriptBox[ToBoxes[x], "\[Prime]"] And this tells Mathematica to parse a superscripted box structure internally as Primed, and not as Derivative: ...


2

You can "help" FindGeneratingFunction by specifying the function space you want it to explore: FindGeneratingFunction[{1, 4, 6, 4, 1}, x, FunctionSpace -> "Polynomial"] This returns the $1 + 4 x + 6 x^2 + 4 x^3 + x^4$ polynomial you expected.


2

Not very elegant, but (hopefully) transparent: The basic data p1 = {1, 2, 3}; pp1 = Permutations[p1]; p2 = {4, 5, 6}; pp2 = Permutations[p2]; The function g[x_] := Which[MemberQ[pp1, x], Signature[x], MemberQ[pp2, x], Signature[x]/2, True, 0] (* or ending with 1/2] in which case x is returned unevaluated *) All tuples t = Tuples[Range[6], ...


2

Since v10.1 you can use also OrderlessPatternSequence like this : f[x : {OrderlessPatternSequence[1, 2, 3]}] := Signature[x]*1 f[x : {OrderlessPatternSequence[3, 4, 5]}] := Signature[x]*1/2 then f[{2, 1, 3}] -1 or f[{5, 3, 4}] 1/2


1

depending on how you use it , it might be good performance-wise to precompute an array: fa = SparseArray[ Flatten[ Function[{t}, ( # -> t[[2]] & /@ NestList[RotateLeft, t[[1]], 2])] /@ { {{1, 2, 3}, 1}, {{2, 1, 3}, -1}, {{3, 4, 5}, 1/2}, {{4, 3, 5},-1/2} }, 1] (*,{n,n,n}*) ]; ...


1

How about f[{1, 2, 3}] = 1; f[{3, 4, 5}] = 1/2; f[list_List /; Not[OrderedQ[list]]] := Signature[list] f[Sort@list] Only bind the last definition if the argument isn't sorted, in which case sort and use Signature to get the correct sign. Then f[{3,2,1}] yields -1 and f[{4,5,3}] yields 1/2. You can then add f[___]:=0 default, if you want. With that ...



Only top voted, non community-wiki answers of a minimum length are eligible