[Math] MGF for Binomial Distribution

binomial distributionmoment-generating-functions

I’m learning towards an exam I have. In one of the questions I've being asked to compute the MGF for the binomial distribution. My answer is slightly different from the official answer published by the university, they replaced the exponent with $z$. Can you please explain why is it good for?

This is my solution:
\begin{gather*}
Y = x_1 + \dotsb + x_n \sim \operatorname{bin}(n,p) \\
M_x(t)
= E\left[ e^{t\dot{x}} \right]
= \sum_{x=1,0} e^{tx} \cdot p_x(x)
= e^{t \cdot 1} \cdot p + e^{t \cdot 0} \cdot (1-p)
= (e^t p + (1-p))^n
\end{gather*}

(Original image of this solution here.)

The official answer is this:
$$
G_X(Z)
= E(Z^X)
= Z^0 \cdot (1-p) + Z^1 \cdot p
= (1 – p + Zp)^n.
$$
(Original image of this solution here.)

Best Answer

You are computing $e^{tX}$ and they are computing $Et^{X}$. Both calculations are correct but according to Wikipedia your definition is the correct one. What they have computed is usually called the 'generating function'. [MGF expands as 'moment generating function'; it should not be confused with 'generating function'].

Related Question