Calculating the M.G.F of $\sum_{i=1}^N X_i$ where $N$ is a random variable

79 Views Asked by At

Given: $N$ ~ $Geo(p_N$) and $X_i$ ~ $Geo(p_X)$

Where $N$ isn't dependent on $X_i$, and all $X_i$s are i.i.d

We define: $Z=\sum_{i=1}^NX_i$

Find m.g.f for Z

My book has a final answer of: $\frac{P_NP_Xe^t}{1-(1-P_NP_X)e^t}$ ie $Z$ ~ $Geo(P_NP_X)$

But my calculations are totally different, what did I do wrong?

$M_Z(t)=E[e^{tz}]$

Where $E[e^{tz}|N]= E[e^t\sum_{i=1}^nX_i] = n \frac{(P_Xe^t)}{(1-(1-P_X)e^t)}$ so:

$M_Z(t)=E[e^{tz}]=E[E[e^{tz}|N]]=E[N * \frac{(P_Xe^t)}{(1-(1-P_X)e^t)}]=E[N]\frac{(P_Xe^t)}{(1-(1-P_X)e^t)}=\frac{1}{P_N} \frac{(P_Xe^t)}/{(1-(1-P_X)e^t)}$


I know that:

$$\mathbb{E}[e^{tX}]=\sum_{x=1}^{\infty}e^{tx}p(1-p)^{x-1}=pe^{t}\sum_{x=1}^{\infty}((1-p)e^{t})^{x-1}=\frac{pe^{t}}{1-(1-p)e^{t}}$$