Suppose that $X_1, \ldots, X_n$ are iid random variables with mean $\mu$. Consider the sum with number of random variables added a random variable itself. That is, $\sum_{i=1}^NX_i$ where $N$ is a random variable that is independent of all the $X_i$'s. I am interested in showing that:

$$ E\left(\sum_{i=1}^NX_i \mid N=n\right) = n\mu $$

To do so, I have that:

$$ E\left(\sum_{i=1}^NX_i \mid N=n\right) = E\left(X_1 \mid N=n\right) + \ldots + E\left(X_N \mid N=n\right) $$

It appears that due to $N$ being independent of the $X_i$'s, at first glance it seems I can just drop the conditonals, but that would give me $N\mu$ and not $n\mu$. Furthermore, we can decompose it by its definition as an infinite sum or an integral, which would require us to find:

$$ f\left(\sum_{i=1}^NX_i =T \mid N=n\right) = \frac{f\left(\sum_{i=1}^NX_i =T , N=n\right)}{f(N=n)} $$

But, $f\left(\sum_{i=1}^NX_i =T , N=n\right)$ appears to equal:

$$ f\left(\sum_{i=1}^NX_i =T , N=n\right) = f\left(\sum_{i=1}^nX_i =T\right) $$

and we are left with the $f(N=n)$ denominator. Can someone tell me what I'm doing wrong?

  • $\begingroup$ If $N = n$, you can just swap in $n$ in the sum, i.e. $E\left(\sum_{i = 1}^N X_i \mid N= n\right) = E\left(\sum_{i = 1}^n \mid N = n\right)$ and then since the $X_i$'s are iid you have what you were after. $\endgroup$ – Therkel Dec 6 '16 at 11:00
  • $\begingroup$ @Therkel Is there a more formal or rigorous way of thinking about what allows me to swap in the $n$? Is it because $\{\omega: E\left(\sum_{i = 1}^N X_i(\omega) \mid N(\omega)= n\right)\} = \{\omega: E\left(\sum_{i = 1}^n X_i(\omega)\mid N(\omega) = n\right)\}$? $\endgroup$ – user321627 Dec 6 '16 at 11:08
  • $\begingroup$ Formally, your conditional expectation is not a random variable; rather you are looking at a (discrete) function $f : n \mapsto E\left(\sum_{i=1}^N X_i \;\middle\vert\; N = n\right)$ for which the swap of $N$ and $n$ make sense. Compare with $E\left(\sum_{i = 1}^N X_i\;\middle\vert\; N\right)$, which is a random variable mapping $E\left(\sum_{i = 1}^N X_i\;\middle\vert\; N\right) : \omega \mapsto E\left(\sum_{i = 1}^{N} X_i\;\middle\vert\; N = N(\omega)\right)$. $\endgroup$ – Therkel Dec 6 '16 at 11:18
  • $\begingroup$ I noticed there appears no $\omega$ in the $X_i$ term. Is it interpreted as being a constant, a random variable, or both, as in a fixed random variable? $\endgroup$ – user321627 Dec 6 '16 at 11:25
  • 1
    $\begingroup$ @user321627: Use the fact that $\mathrm{E}[X\mid A]=\mathrm{E}[X\mathbf{1}_A]/P(A)$ for events $A$ with $P(A)>0$. That allows you to easily conclude that $\mathrm{E}[S_N\mid N=n]=\mathrm{E}[S_n\mid N=n]$ since $S_N\mathbf{1}_{N=n}=S_n\mathbf{1}_{N=n}$ pointwise (here $S_n=\sum_{i=1}^nX_i)$. (Unrelated: Those sets you defined above makes no sense). $\endgroup$ – Stefan Hansen Dec 6 '16 at 11:36

From your second formula you have $$ \begin{align} \mathbb{E}\left[ \sum_{i=1}^{N} X_i \; \bigg| \; N=n \right] &= \mathbb{E}\left[ X_1 | N=n\right] + \cdots + \mathbb{E}\left[ X_1 | N=n\right], \end{align} $$ however written this way it is not clear how many times that summation is being performed, but using the fact we are conditioning on $N=n$ we can tidy that up as $$ \begin{align} \mathbb{E}\left[ \sum_{i=1}^{N} X_i \; \bigg| \; N=n \right] &= \sum_{i=1}^{n} \mathbb{E}\left[ X_i | N=n \right] = \sum_{i=1}^{n}\mathbb{E}\left[ X_i \right]. \end{align} $$ For your second part note that using independence we actually have $$ \begin{align} f\left(\sum_i^N X_i = T , N=n\right) = f\left(\sum_i^n X_i = T \right) \cdot f_N (N=n) \end{align} $$ so the term in the denominator will cancel, as it stands you have ignored the probability of $N = n$.

  • $\begingroup$ I would avoid writing $E[X_1\mid N = n] + \ldots + E[X_1\mid N =n]$ because it is not clear how many variables you are summing or why. Rather, perhaps skip that step? $\endgroup$ – Therkel Dec 6 '16 at 11:23
  • 1
    $\begingroup$ Yeah fair comment, I actually included it that way because I wanted to make the point that when the OP wrote it that way he probably added to his own confusion by not making explicit how many terms in the summation there were, so I was hoping my answer would start from his step and then show that by tidying up that sum it became clearer how many times the summation was performed. Clearly that wasn't obvious though! $\endgroup$ – Nadiels Dec 6 '16 at 11:26

E(sum of Xi i=1 to N given N=n)=E(sum of Xi i=1 to n given N=n)= E( sum of Xi i=1 to n)[ using independence ] =nu


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.