Tag Info

Hot answers tagged

8

A lot of functions in MMA have default values for Optional Arguments, for Example Flatten. It can take Flatten[expr] which means Flatten[expr, Infinity] Some functions don't have such option and you need to feed the Optional Arguments but you can go around by building your own function for your example, you can do this kind of trick like this: f[expr_, ...


6

You should use Sequence PolynomialMod[x^2 + 9 x + 5, 3] PolynomialMod@Sequence[x^2 + 9 x + 5, 3] Sequence[x^2 + 9 x + 5, 3] // PolynomialMod 2 + x^2 all produce the same output. Works with any function Sequence[i, {i, 10}] // Table {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}


5

Algohi's answer is the most appropriate if one of the function's arguments is primary and the others secondary. However, you can get closer to the syntax that you suggested in your question using {x^2 + 9 x + 5, 3} // Apply @ PolynomialMod which works in version 10 using the operator form of Apply. Or, to include earlier versions, you could define your ...


4

You can do (but only for two arguments) x^2 + 9x + 5 ~ PolynomialMod ~ 3


4

Built-in Mathematica symbols can be looked up directly in a Mathematica session by selecting the symbol/command text and hitting F1. This is also available in the menu: Help --> Find Selected Function. The online Wolfram language reference includes categories for digging through the documentation, but it also includes a search box which can be used to ...


3

If you separately define the distribution, the forms of subsequent expressions are simplified and you are less likely to lose track of the brackets. dist = TransformedDistribution[x^2, x \[Distributed] ProbabilityDistribution[((2/9))*(x + 2), {x, -2, 1}]]; PDF[dist, y] Plot[ Evaluate[PDF[dist, y]], {y, 0, 4}, Filling -> Axis] mgf[t_] = ...


1

Sometimes you can use new Mathematica operator forms (V10+) {-5, -3, -1, 2, 4, 6} // SortBy[Abs] {-1, 2, -3, 4, -5, 6}


1

In Mathematica 10 using << Notation` Notation[x' => xPrime] seems to work to "disconnect" x' from its meaning as a derivative. (Note- the Notation text used here represents entering using the Notation Palette. Mathematica interprets this to Notation[ParsedBoxWrapper[ RowBox[{"x", "'"}]] \[DoubleLongRightArrow] ParsedBoxWrapper["xPrime"] ] ...



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