4.5 Moment Generating Function of the Sum of a Random Number of Random Variables
Let \(\{X_k\}\) denote a sequence of independent identically distributed random variables and let \(N\) be
non-negative integer valued random variable that is independent of the sequence of random variables
\(\{X_k\}\).
Let \(Y=\sum \limits ^N_{i=1}X_i\), and we want \(M_Y(t)\). \begin {align*} M_Y(t) &=E\Big (e^{ty}\Big ) =E\Bigg (e^{\sum \limits ^N_{i=1}x_it}\Bigg )\\ \implies \hspace {0.4cm} M_Y(t) &=E\Bigg (\prod ^N_{i=1}e^{x_it}\Bigg )\\ \end {align*}
So \begin {align*} E\Bigg (e^{ty}/N=n\Bigg ) &=E\Bigg (\prod ^N_{i=1}e^{x_it}/N=n\Bigg )\\ &=E\Bigg (\prod ^n_{i=1}e^{x_it}\Bigg ) =\prod ^n_{i=1}E\Big (e^{x_it}\Big )\\ &=\Big (M_X(t)\Big )^n\\ \implies \hspace {0.5cm} E\Bigg (e^{ty}/N\Bigg ) &=\Big (M_X(t)\Big )^N\\ \end {align*}
\[E\Big (E\Big (e^{ty}/N\Big )\Big )=E\Big (e^{ty}\Big )=M_Y(t)\] \[\implies \hspace {0.5cm}M_Y(t)=E\Big (M_X(t)\Big )^N\] \begin {align*} M_Y'(t) &=\frac {d}{dt}E\Big (M_X(t)\Big )^N =E\Bigg (\frac {d}{dt}\Big (M_X(t)\Big )^N\Bigg )\\\\ \therefore \hspace {0.5cm} M'_Y(t) &=E\Big (N\Big (M_X(t)\Big )^{N-1}\hspace {0.0cm} M'_X(t)\Big ) \end {align*}
\begin {align*} E(Y) &=M'_Y(0)=E\Big (N\Big (M_X(0)\Big )^{N-1}M'_X(0)\Big )\\ &=E\Big (N(1)E(X)\Big ) =E\Big (N E(X)\Big )\\ &=E(N) E(X)\\\\ \implies \hspace {0.5cm}E(Y)&=E(N)E(X)\\ \end {align*}
\[M''_Y(t)=E\Big (N(N-1) (M_X(t))^{N-2}(M'_X(t))^2+N(M_X(t))^{N-1}M_X''(t)\Big )\]
\begin {align*} E(Y^2) &=M''_Y(0)\\ &=E\Big (N(N-1)(E(X))^2+N E(X^2)\Big )\\ &=E\Big (N(N-1)\Big ) \Big (E(X)\Big )^2+E(N)E(X^2)\\ &=E(N^2)(E(X))^2-E(N)(E(X))^2+E(N)E(X^2) \end {align*}
\begin {align*} \Var (Y) &=E(Y^2)-(E(Y))^2\\ &=E(N^2)(E(X))^2-E(N)(E(X))^2+E(N)E(X^2)-(E(N))^2(E(X))^2\\ &=\Big (E(N^2)-(E(N))^2\Big )(E(X))^2+E(N)\Big (E(X^2)-(E(X))^2\Big )\\ &=\Var (N)(E(X))^2+E(N)\Var (X)\\ \end {align*}
Example 4.5.1. Let \(X\) denote a uniform random variable on \((0,1)\) and suppose that the conditional distribution of \(Y\) given \(X=P\) is binomial with parameter \(n\) and \(P\). Find the distribution of \(Y\) using moment generating function. \[f_X(x)=1,\hspace {0.5cm}\text {and}\hspace {0.5cm} f_{Y/X}(y/P)= \begin {pmatrix} n\\y\\ \end {pmatrix} P^y(1-P)^{n-y},\hspace {0.4cm} y=0,1,2,......, n\] \[E\Big (e^{ty}/X=P\Big )=\Big (Pe^t+1-P\Big )^n\] \begin {align*} E\Big (e^{ty}\Big ) &=E\Big (E\Big (e^{ty}/X=P\Big )\Big )\\ &=E\Big (Pe^t+1-P\Big )^n\\ &=\int ^1_0\Big (Pe^t+1-P\Big )^ndP\\ &=\frac {e^{(n+1)t}-1}{(n+1)(e^t-1)}\\ \end {align*}
\begin {align*} M_Y(t) &=E\Big (e^{ty}\Big ) =\frac {e^{(n+1)t}-1}{(n+1)(e^t-1)}\\\\ &=\frac {1}{n+1}\hspace {0.2cm}\frac {e^{(n+1)t}-1}{e^t-1} =\frac {1}{n+1}\hspace {0.1cm}\frac {1-(e^t)^{n+1}}{1-e^t}\\\\ &=\frac {1}{n+1}\hspace {0.1cm}\sum ^n_{k=0}\Big (e^t\Big ) =\frac {1}{n+1}\hspace {0.1cm}\sum ^n_{k=0}e^{kt}\\ \implies \hspace {0.5cm} M_Y(t) &=\frac {1}{n+1}\Big (1+e^t+e^{2t}+ ...........+ e^{nt}\Big )\\ \end {align*}
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.