# What is the conditional expectation $E(X^2\mid X+Y=1)$ if $X$ and $Y$ are i.i.d standard normal?

$X$ and $Y$ are i.i.d and follow standard normal distribution. What is the conditional expectation $E(X^2\mid X+Y=1)$?

Also, I have seen methods of calculating conditional expectation scattered in literatures. Some use a fraction of integral of probability density functions; while others use "hacky" properties of random variables' distributions. What is a good starting point of calculating a conditional expectation?

• Do you wish to assume that $X,Y$ are both $N(0,1)$ or $N(\mu,\sigma)$ ? – N8tron May 27 '18 at 2:52
• @N8tron Edited. Standard normal distribution. – Yi Bao May 27 '18 at 2:54
• There is no 'master formula' for computing conditional expectation in general setting. So a 'hacky' way is really helpful when it is available. Otherwise, you need to look at the joint distribution... – Sangchul Lee May 27 '18 at 3:24
• Since $(X,X+Y)$ is jointly normal, $X\mid X+Y$ is univariate normal, from which the expectation follows. – StubbornAtom Dec 16 '18 at 18:15

I'm afraid you'll find this "hacky" but...

Consider the transformed variables $S=X+Y$ , $R=X-Y$. It's easy to see that these variables (which correspond to a scaled 45 degrees rotation) are iid, $N(0,2)$.

Now $X=(S+R)/2$. Then we want

\begin{align} E[X^2 \mid S] &= E\left[\left(\frac{S+R}{2}\right)^2 \mid S\right]\\ &=\frac{1}{4}\left(E[S^2\mid S] + 2 E[S R \mid S] + E[R^2\mid S] \right)\\ &=\frac{1}{4}\left(S^2 + 2 S E[R ] + E[R^2] \right)\\ &=\frac{1}{4}(S^2+2) \end{align}

Or

$$E[X^2 \mid X+Y=1] = \frac{1}{4}(1^2+2)=\frac{3}{4}$$

Quick sanity check: recall that we must have $E[E[X^2 \mid S]]= E[X^2]=1$. And, indeed $E[\frac{1}{4}(S^2+2)]=\frac{1}{4}(2+2)=1$.