Tag Info

Hot answers tagged

8

Here's another way to achieve the same thing: Differences[{##}] & @@@ B {{1, 1}, {}, {1, 1, 1}} OR for fun Replace[B, x : {__} :> Differences[x], 1]


8

Differences /@ B or, if you don't like runes, Map[Differences, B] In v10, there is an operator form of Map which can be very useful, Map[Differences] @ B which allows you to slip a Map operation into a sequence of transformations without worrying about precedence issues.


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_] = ...


2

Thread[f[B]] /. f -> Differences



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