Mean (E(X)) and variance (Var(X)) using the probability generating function — 9231 FPS
Read probabilities from coefficients and recover moments using derivatives.
Notes and key methods
For a nonnegative integer-valued X, \(G_X(t)=E(t^X)=\sum p_xt^x\). The coefficient of \(\displaystyle t^{r}\) is \(\displaystyle P(X=r)\), and \(\displaystyle G(1)=1\).
Use \(E(X)=G'(1)\) and \(\operatorname{Var}(X)=G''(1)+G'(1)-[G'(1)]^2\). The second derivative gives E(X(X−1)), not \(\displaystyle E(X^{2})\), which explains the extra first-moment term.
Check the conditions
X takes nonnegative integer values for an ordinary PGF.
Moments require the relevant derivatives at \(\displaystyle t=1\) to exist.
Three worked examples
Example 1 · Probability generating functions
X has PGF \(\displaystyle G_{X}(t)= \frac{2+ 3t+ 5t^{2}}{10}\).