[Math] Expected value of sum of a random number of i.i.d. random variables

probabilityrandom variables

The question:

$X_1$, $X_2$, etc. are independent and identically distributed non-negative
integer valued random variables. $N$ is a non-negative integer valued random variable which is independent of $X_1$, $X_2$ etc.., and $Y$ = $X_1 + X_2 + X_3 + … + X_N$ . (We take $Y = 0$ if $N = 0$).

Prove that $\mathbb{E}[Y] = \mathbb{E}[X_1]\mathbb{E}[N]$.


My attempt:

I know that the probability generating $G_Y(s)$ of $Y$ is equal to $G_N(G_X(s))$… but I'm not sure how that's helpful here.

My intuition leads me in this direction:

$\mathbb{E}[Y] = \sum\limits_{n=0}^{\infty} \mathbb{E}[Y|N=n]\mathbb{P}(N=n)$

$= \sum\limits_{n=0}^{\infty} \mathbb{E}[nX_1|N = n]\mathbb{P}(N=n)$

$= \sum\limits_{n=0}^{\infty} n \mathbb{E}[X_1|N = n]\mathbb{P}(N=n)$ (is this step valid??)

But I don't know where to go from here.

Best Answer

$$\begin{aligned}\mathsf{E}Y & =\sum_{n=0}^{\infty}\mathsf{E}\left[Y\mid N=n\right]\mathsf{P}\left(N=n\right)\\ & =\sum_{n=1}^{\infty}\mathsf{E}\left[Y\mid N=n\right]\mathsf{P}\left(N=n\right)\\ & =\sum_{n=1}^{\infty}\mathsf{E}\left[X_{1}+\cdots+X_{n}\mid N=n\right]\mathsf{P}\left(N=n\right)\\ & =\sum_{n=1}^{\infty}\mathsf{E}\left[X_{1}+\cdots+X_{n}\right]\mathsf{P}\left(N=n\right)\\ & =\sum_{n=1}^{\infty}\left[\mathsf{E}X_{1}+\cdots+\mathsf{E}X_{n}\right]\mathsf{P}\left(N=n\right)\\ & =\sum_{n=1}^{\infty}n\mathsf{E}X_{1}\mathsf{P}\left(N=n\right)\\ & =\mathsf{E}X_{1}\sum_{n=1}^{\infty}n\mathsf{P}\left(N=n\right)\\ & =\mathsf{E}X_{1}\mathsf{E}N \end{aligned} $$

second equality: because the first term is $0$ since $\mathsf E[Y\mid N=0]=0$.

fourth equality: because $N$ is independent wrt the $X_i$

fifth equality: linearity of expectation.

seventh equality: factor $\mathsf EX_1$ does not depend on index $n$ so can be taken out of the summation and placed before summation symbol.

Related Question