Conditional Expectation, given $N=n$

conditional probabilityconditional-expectation

Expanding on this question: Conditional Probability Given N=n

Suppose that $N$ is a Poisson random variable with parameter $\mu$. Given $N=n$, random variables $X_1, … X_n$ are independent with uniform (0,1) distribution. So there are a random number of $X$'s.

c) Let $S_n=X_1+…+X_N$ denote the sum of the random number of $X$'s (If $N=0$ then $S_N=0$). Find $P(S_N=0$).

I'm thinking:
$$P(S_N=0)= P(S_N=0|N=0)\cdot P(N=0)$$
By condition $(N=0) \to (S_N=0):$ $P(S_N=0|N=0)=1$ so $P(S_N=0)$ is exponential distribution for $0$.

How can I carry this part forward to solve d) Find $E(S_N)$
$$E[E(S_N|N=n)]=E(pN)=pE(N)=p\mu$$

Best Answer

You have the law of total expectation: $$ \mathbb{E}[S_N]=\mathbb{E}[\mathbb{E}[S_N|N]] $$ Now, $$ \mathbb{E}[S_N|N] = \mathbb{E}[\sum_{n=1}^N X_n|N] = \sum_{n=1}^N \mathbb{E}[X_n] = \sum_{n=1}^N \frac{1}{2} = \frac{N}{2} $$ so $$ \mathbb{E}[S_N]=\mathbb{E}\left[\frac{N}{2}\right]=\frac{\mu}{2}\,. $$

Note: this is a special case of compound Poisson distribution.