Statistics – Finding the Moment Generating Function of a Binomial Distribution

binomial theoremgenerating-functionsmoment-generating-functionsstatisticssummation

Suppose $X$ has a $\rm{Binomial}(n,p)$ distribution. Then its moment generating function is

\begin{align}
M(t)
&= \sum_{x=0}^x e^{xt}{n \choose x}p^x(1-p)^{n-x} \\
&=\sum_{x=0}^{n} {n \choose x}(pe^t)^x(1-p)^{n-x} \\
&=(pe^t+1-p)^n
\end{align}

Can someone please explain how the sum is obtained from lines (2) to (3)?

Best Answer

The moment generating function for the binomial distribution $B_{n,p}$, whose discrete density is $\binom{n}{k}p^k(1-p)^{n-k}$, is defined as $$ \begin{align} M_{B_{n,p}}(t) &=\mathrm{E}(e^{tk})\\ &=\sum_{k=0}^n\binom{n}{k}p^k(1-p)^{n-k}e^{tk}\\ &=\sum_{k=0}^n\binom{n}{k}\left(pe^t\right)^k(1-p)^{n-k}\\ &=\left(pe^t+(1-p)\right)^n \end{align} $$ The last step is simply an application of the binomial theorem.