# Computing a conditional expectation of a square

Let $X_1,\ldots, X_n$ be IID random variables with mean 0 and variance 1, and $X_1',\ldots, X_n'$ an independent copy of this sequence. Define $$W=\frac{1}{\sqrt n}\sum_{i=1}^nX_i$$ and $$W'=W-\frac{1}{\sqrt n}X_I+ \frac{1}{\sqrt n}X_I'$$ where $I$ is randomly chosen from $\lbrace 1,\ldots ,n \rbrace$ and $X_I$ is independent and equal in distribution to other $X_i$s. Let $F=\sigma(X_1,\ldots ,X_n)$. How can I verify

$$\mathbb{E}[\frac{n}{2}(W'-W)^2\vert F ]= \frac{1}{2}+\frac{1}{2n}\sum_{i=1}^nX_i^2 \,?$$

I have $\frac{n}{2}(W'-W)^2=\frac{1}{2}(X_I'-X_I)^2$, but I don't know how to compute the conditional expectation $\mathbb{E}[\frac{1}{2}(X_I'-X_I)^2\vert F].$

• What's $X_I'$? BTW, $X_I$ seems to be one of $X_1, \dots X_n$ not just i.i.d. to other X – Denis Korzhenkov Sep 22 '16 at 7:43
• Sorry, I updated, the $X_I'$ is now defined in the first sentence. – cap Sep 22 '16 at 7:55
• $\mathbb{E}\left[\frac{1}{2}(X_I'-X_I)^2\mid F\right] = \frac{1}{2}\mathbb{E}\left[X_I'^2\mid F\right] -\frac{1}{2}\mathbb{E}\left[ 2 X_I'X_I \mid F\right] +\frac{1}{2}\mathbb{E}\left[X_I^2\mid F\right]$ – Henry Sep 22 '16 at 7:57
• @Henry I see why the second expectation vanishes, but how are the first and third expectations different? – cap Sep 22 '16 at 8:10
• Missing hypothesis: $I$ is uniformly distributed on $\{1,2,\ldots,n\}$ and independent of $(X_k)_{1\leqslant k\leqslant n}$ and $(X'_k)_{1\leqslant k\leqslant n}$. Then $$E((X'_I-X_I)^2\mid F)=\frac1n\sum_{k=1}^nE((X'_k-X_k)^2\mid F)$$ and, for each $k$, $$E((X'_k-X_k)^2\mid F)=E((X'_k)^2)-2E(X'_k)X_k+X_k^2=1+X_k^2$$ from which the result follows. – Did Sep 22 '16 at 8:59