Solution (source code)

= Solution

The <moment-generating function> is $M_X(\theta)=\mathbb E(e^{\theta X})$ for those real $\theta$ where this <expectation> is finite. When it exists on a neighbourhood of zero it determines the distribution, and its derivatives at zero give the corresponding moments.