# Conditional Expectation of a Sum of Random Variables and a Random Integer

Let $$(X_n : n \in \Bbb N)$$ be a sequence of identically distributed random variables, with mean $$\mu$$ and variance $$\sigma^2 < \infty$$. Set $$S_0 = 0$$ and $$S_n=X_1+X_2+...+X_n$$ for $$n>0$$. Let $$N$$ be a bounded, non-negative integer-valued random variable that is independent of the sequence $$(X_n)$$.

I've been asked to show that $$\Bbb E(S_N^2 | N=n)=n\sigma^2+n^2\mu^2$$, yet whenever I try to do this, I keep getting this conditional expectation to be $$n^2\sigma^2+n^2\mu^2$$. I've tried working from the definition of conditional expectation to no avail, as well as (what seems not very proper) considering simply $$\Bbb E(S_n^2)$$, but none seem to lead in the right direction.

All my methods seem to lead to $$\sigma^2+\mu^2$$ multiplied by some function of $$N$$ with little to do with the distributions of $$X$$. Any help with this would be much appreciated.

• The variables are independent? – leonbloy Feb 25 at 17:34
• I presume so; it doesn't explicitly say so in the original wording, but I feel it makes no sense if they are not. – KB399 Feb 25 at 17:34
• Then you need to make that assumption explicit. – leonbloy Feb 25 at 17:35

$$S_n^2 = \sum_{i=1}^n X_i^2 + 2 \sum_{i=1}^n \sum_{j \ne i} X_i X_j$$ Since $$E[X_i^2] = \sigma^2 + \mu^2$$ and $$E[X_i X_j] = \mu^2$$ for $$i \ne j$$, we have $$E[S_n^2] = n (\sigma^2 + \mu^2) + n(n-1) \mu^2 = n \sigma^2 + n^2 \mu^2.$$