# Conditional expectation of i.i.d random variables

consider the sum of random variables $$Y_k = \sum\limits_{j=1}^k X_j$$, $$X_k$$ are i.i.d. Now I want to calculate:

$$E(Y_m| Y_{m+n}=n) \overset{!}{=} m \frac{n}{n+m}$$

How can I get to that?

• Typo. Sorry:( I edit it. – Sarah Mar 30 at 8:13
• Is this just a special case of $E(Y_m \mid Y_{m+n}=c) = c \frac{m}{n+m}$ ? – Henry Mar 30 at 8:17

Since $$X_i$$'s are i.i.d. it follows that $$c=E(X_i|Y_{n+m}=n)$$ is independent of $$i$$. Summing over $$i \leq n+m$$ we get $$(m+n) c=n$$ so $$c =\frac n {n+m}$$. Finally the given expectation is $$mc=\frac {mn} {m+n}$$.

• c=E(....) is because of the fact, that E(., X=X(w)) is constant, isn't it? – Sarah Mar 30 at 8:28
• If you permute $X_i, 1 \leq i \leq n+m$ then $Y_{n+m}$ does not change. This is the reason the number $EX_i|Y_{n+m}=n)$ does not depend on $i$. @Sarah – Kavi Rama Murthy Mar 30 at 8:32
• Why do you sum to n+m? – Sarah Mar 30 at 8:33
• @Sarah When you sum to $n+m$ you get something whose value is obviously $n$: $E(\sum\limits_{i=1}^{n}X_i|Y{n+m}=n)=E(Y_{n+m}|Y_{n+m}=n)=n$. – Kavi Rama Murthy Mar 30 at 8:35
• Ok then I get the c. Then: $E(Y_m| Y_{n+m}=n) = m E( X_k=X |Y_{n+m}=n)$ – Sarah Mar 30 at 8:40

Note that all permutations of the $$X_j$$ are equally likely. Thus the desired expectation is invariant if you average over them. If the sum of the first $$m+n$$ of the $$X_j$$ is $$n$$ (or in fact any other value, there’s no reason why it should be linked to the indices), then since each of these $$m+n$$ occurs in the first $$m$$ places in a fraction $$\frac m{m+n}$$ of the permutations, the expectation of the first $$m$$ is $$\frac m{m+n}$$ times that value.

• Thank you for your answer: "Then since each of these m+n occurs in the first m places" – Sarah Mar 30 at 8:26
• Can you explain why this holds? So there is also no analytic way to calculate this conditional expected value? – Sarah Mar 30 at 8:26
• @Sarah: I'm not sure what you mean by "analytic". This seems rather analytic to me. If you want a more rigorous, formal approach, the one in Kavi Rama Murthy's answer seems to fit the bill. – joriki Mar 30 at 8:31
• I do not understand why the m+n occurs in the first m places. – Sarah Mar 30 at 8:53
• @Sarah: A random permutation is equally likely to move an $X_j$ to any of the $m+n$ positions. Thus the proportion of permutations that move it to a certain position must be $\frac1{m+n}$, and then the proportion that move it to one of $m$ particular positions must be $\frac m{m+n}$. – joriki Mar 30 at 10:00

Just another solution:

$$E(Y_m| Y_{m+n}=n)=E(\sum_{k=1}^{m} X_k| \sum_{i=1}^{m+n} X_i=n)$$ $$=\sum_{k=1}^{m}E( X_k| \sum_{i=1}^{m+n} X_i=n)=\sum_{i=1}^{m} \frac{n}{n+m}= m \frac{n}{n+m}$$

It is enough to show $$E( X_k| \sum_{i=1}^{m+n} X_i=n)=\frac{n}{n+m}$$

$$E( \sum_{k=1}^{m+n} X_k| \sum_{i=1}^{m+n} X_i=n)=n$$ $$\Leftrightarrow$$ $$\sum_{k=1}^{m+n}E( X_k| \sum_{i=1}^{m+n} X_i=n)=n$$

$$\Leftrightarrow$$ $$(m+n)E( X_k| \sum_{i=1}^{m+n} X_i=n)=n$$

• Thank you very much. That is the solution I was looking for:) – Sarah Mar 30 at 9:13
• You are welcome – Masoud Mar 30 at 9:14

Just another solution

lets $$E(X_i)=\mu$$. In non-parametric family, $$\bar{X}$$ is sufficient and complete estimator for $$\mu$$(that coincide with this example).

$$E(X_k|\sum_{i=1}^{m+n} X_i)=E(X_k|\frac{\sum_{i=1}^{m+n} X_i}{m+n})=E(X_k|\bar{X}_{(m+n)})=g(\bar{X}_{(m+n)})$$

I want to show $$g(\bar{X}_{(m+n)})=\bar{X}_{(m+n)}$$ almost surely.

$$E(g(\bar{X}_{(m+n)})-\bar{X}_{(m+n)})=E(E(X_k|\bar{X}_{(m+n)}))-\mu=\mu-\mu=0$$ since $$\bar{X}_{(m+n)}$$ is complete and sufficient and
$$g(\bar{X}_{(m+n)})-\bar{X}_{(m+n)}$$ is a function of $$\bar{X}_{(m+n)}$$ so $$P(g(\bar{X}_{(m+n)})-\bar{X}_{(m+n)}=0)=1$$

so $$g(\bar{X}_{(m+n)})=\bar{X}_{(m+n)}$$ almost surely. so

$$E(X_k|\sum_{i=1}^{m+n} X_i)=\bar{X}_{(m+n)}$$ and

$$E(X_k|\sum_{i=1}^{m+n} X_i=n)=E(X_k|\frac{\sum_{i=1}^{m+n} X_i}{m+n}=\frac{n}{m+n})=\frac{n}{m+n}$$. Finally

$$E(\sum_{k=1}^{m} X_k| \sum_{i=1}^{m+n} X_i=n)=m\frac{n}{m+n}$$