# Expected value of an infinite sum of random variables

For k=1,2... let Xk be independent and identically-distributed random variables with E(Xk)= $\mu$ and V(Xk)= $\sigma^2$ and let N be independent of the Xk with mean $\lambda$ and variance $\lambda^2$.

$$\sum_{k=0}^N Xk = T$$

By conditioning on N, find E(T).

My working was E($\sum_{k=0}^N Xk) = E(T)$

Then because they are independent you can swap the Expected value and the sum, so you get

$$\sum_{k=0}^N E(Xk) = T$$ So since E(Xk) =$\mu$ the answer should be N$\mu$?

But the answer is $\lambda$$\mu instead. Please help! I think it is something to do with the fact that N is a random variable, but I am not sure where the \lambda comes from • you are not understanding what is being asked - N is NOT fixed, it is a random variable so number of terms you are summing is randomly distributed (you are adding random number of random variables... yes that may sound weird at first) according to distribution of N. In particular notice that N\mu is random itself, and cannot possibly be an expectation. Commented Jun 17, 2016 at 6:27 • So you just have to condition on events \{N=n\} Commented Jun 17, 2016 at 6:29 • We have E(T\mid N=n)=n\mu. So by the Law of Total Expectation, E(T)=\mu\sum_0^\infty n\Pr(N=n). Commented Jun 17, 2016 at 6:29 ## 1 Answer What you did was almost correct. However, you forgot that N is a random a variable too, so N\mu is not a result, but another random variable Similar to what you did, let's find the conditional mean of T given N, which is a random variable by itself, and reach your result:$$E(T \mid N) = E(\sum_{k=0}^N X_k) = \sum_{k=0}^N E(X_k) = \sum_{k=0}^N \mu = N\mu$$Now, by applying the law of total expectation:$$E(T) = E(E(T \mid N)) = E(N\mu) = E(N)\mu = \lambda\mu$\$

• Please replace |_{N} by \mid N.
– Did
Commented Jun 17, 2016 at 7:13
• Thanks so much. That makes a lot of sense :)))
– sam
Commented Jun 18, 2016 at 7:54