# Conditional expectation of a sum

Let $$U_1, U_2,...,U_n$$ be a sequence of independent random variables such that for every $$i$$: $$P(U_i=1)=P(U_i=-1)=\frac{1}{2}$$

And we define $$X_n=\sum_{i=1}^{n}U_i$$.

So for $$m\geq n$$, what is $$E(U_n|X_m)$$?

I'm having troubles with this, since for some m, some x can not even be received. For example $$m=4$$ and $$x=3$$.

So I'm not sure how to separate for different cases

• Analogous to the advice of "plot your data" is "generate all possibilities 'by hand'" for a small example (or two or three). With $m=4$, there are 16 sequences. $X_m$ can take on values -4, -2, 0, 2, and 4 so there are 5 conditional expectations to find.
– JimB
May 28 at 15:38
• And I assume when you wrote $x=3$ you meant $n=3$.
– JimB
May 28 at 15:55
• One may also assume $X_0=0$, right? May 28 at 15:57

Take $$m=3$$, for example. By the evident symmetry, $$E[U_1|X_3]=E[U_2|X_3]=E[U_3|X_3].$$ Add up the $$E[U_k|X_3]$$: \eqalign{ 3E[U_1|X_3] &=E[U_1|X_3]+E[U_2|X_3]+E[U_3|X_3]\cr &=E[U_1+U_2+U_3|X_3]\cr &=E[X_3|X_3]=X_3.\cr }
I will give a try for this question. By the definition of conditional expectation \begin{align} E(U_n|X_m = s) =& P(U_n = 1|X_m = s) - P(U_n = -1|X_m = s)\\ =& P(U_n = 1|X_m = s) - (1- P(U_n = 1|X_m = s))\\ =& 2P(U_n = 1|X_m = s) -1 \end{align} and by the Bayes rule,
\begin{align} P(U_n = 1|X_m = s) =& \frac{P(U_n = 1,X_m = s)}{P(X_m =s)}\\ =& \frac{P(X_m = s|U_n = 1)P(U_n = 1)}{P(X_m =s)}\\ =& \frac{1}{2}\cdot\frac{P(X_{m-1} = s-1)}{P(X_m =s)} \end{align}
So the problem reduces to figure out the probability of $$P(X_m =s)$$. To proceed with computation, we need to discuss whether $$m$$ is even or odd. Say $$m$$ is even, then $$s$$ has to be even, so let's assume $$m = 2k$$ and $$s = 2l$$. Here $$k\geq 1$$ is an integer and $$l$$ could take values as integers between $$-k$$ and $$k$$. To make $$X_{2s} = 2l$$, there are $$k+l$$ $$U_n$$'s taking 1 and the others taking -1. Hence $$$$P(X_m =s) = P(X_{2s} =2l) = \frac{C_{2k}^{k+l}}{2^{2k}}$$$$ We could do similar analysis for the odd number $$m-1$$, this will give $$$$P(X_{m-1} =s-1) = P(X_{2s-1} =2l-1) = \frac{C_{2k-1}^{k+l-1}}{2^{2k-1}}$$$$ Plug into the formula for $$P(U_n = 1|X_m = s)$$ yields $$$$P(U_n = 1|X_m = s) = \frac{1}{2}\cdot\frac{2^{2k}}{C_{2k}^{k+l}} \cdot \frac{C_{2k-1}^{k+l-1}}{2^{2k-1}} = \frac{k+l}{2k}$$$$ This further implies $$$$E(U_n|X_m = s) = 2\cdot \frac{k+l}{2k} -1 = \frac{2l}{2k} = \frac{s}{m}$$$$ for $$m$$ even, and $$s$$ even between $$-m$$ and $$m$$. The case for $$m$$ odd could be obtained similarly. This means $$E(U_n|X_m) = X_m/m$$.