# Probability Theory: Moment generating functions

If $Y$ has a binomial distribution with $n$ trials and probability of success $p,$ show that the moment-generating function for $Y$ is $m(t) = (pe^t + q)^n,$ where $q = 1 − p.$

I got to $$m(t) = E(e^{tY}) = \sum_{y=0}^n \binom{n}{y}(pe^t)^yq^{n-y}.$$ How to go from here?

## 2 Answers

As Y is a discrete random variable, the moment generating function can be computed quite easily. Your start is good. Now, remember that the sum over all possible binomial coefficients on $N$ can be simplified: \begin{eqnarray} M(t) = \mathbb{E}[e^{tY}] &=& \sum_{n= 0}^N e^{tn} {N \choose n} p^n q^{N-n} \\ &=& \sum_{n = 0}^N \left(pe^t\right)^n {N\choose n} q^{N-n}\\ &=& \left(pe^t + q\right)^N \end{eqnarray}

Another way is noting that if $X \sim \text{Bin}(n,p)$ then $X \stackrel{d}{=} \sum_{k=1}^n Y_k$ if $Y_1,...,Y_k$ are i.i.d. Bernoulli distributed with succes parameter p. And you can easily show that $M_{Y_1}(t)= 1-p+p\exp(t)$. Thus \begin{align} M_X(t) &= E[e^{tX}]\\ &= E\left[ \exp\left(t \sum_{k=1}^n Y_k \right)\right] \\ &= E\left[ \prod_{k=1}^n\exp\left(t Y_k \right)\right] \\ &= \prod_{k=1}^nE\left[\exp\left(t Y_k \right)\right] \\ &= \prod_{k=1}^n (1-p+p\exp(t)) \\ &=(1-p+p\exp(t))^n \end{align}