# Conditional expectation $E[X\mid X=c-Y]$

This came up in a question about sequences of RV and conditioning on terms that were later in the sequence. In particular, $$X,Y\sim N(0,1), c$$ is a constant.

Is it true that $$E[X\mid Y+X=c]=E[X\mid X=c-Y]=E[c-Y]=c-E[Y]?$$

• @user158565 - it's only true in special cases, e.g., $X,Y$ independent, (see gunes' answer below for a counterexample) which were not specified in the question. Jul 9, 2019 at 19:38
• @jbowman is it that $X\perp Y$ implies $E(X|X=c-Y)=E(c-Y|X=c-Y)=E(c|X=c-Y)+E(Y|X=c-Y)=E(c)+E(Y)=c$? Jul 10, 2019 at 0:26
• This question makes no sense if you don't say how $X,Y$ are JOINTLY distributed. Jul 10, 2019 at 13:23

No, it's not. You haven't described a dependency relation, which allows me to choose an arbitrary one, e.g. $$X=Y$$. Then, $$E[X\mid Y+X=c]=c/2\neq c-E[Y]=c$$ The problem arises from omitting the conditional part when you substitute for $$X$$, i.e. $$E[X\mid X=c-Y]=E[c-Y\mid X=c-Y]\neq E[c-Y]$$

Since you've defined $$X$$ and $$Y$$ as standard normals, your conclusion that $$E(X\mid X+Y=c) = c-E(Y) = c~$$ (because $$E(Y) =0$$). But how can that be true if $$X$$ and $$Y$$ are exchangeable in the analysis? So you know something is amiss. @gunes gives the correct solution of $$E(X\mid X+Y=c)=c/2$$ and mentions a special case that illustrates the problem with your analysis. I'll expand on @gunes solution in 2 ways:

1. If $$X + Y= c$$ and $$X, Y \sim f$$, then $$-$$ solely by symmetry $$-$$ $$~E(X\mid X+Y=c) = E(Y\mid X+Y=c) = c/2.$$ This is true whether or not $$\operatorname{cov}(X,Y)=\rho=0$$, so $$X$$ and $$Y$$ need not be independent. Naturally, it is true when $$f \sim N(0,1)$$, which is your condition, but it is more general than that.

1. Let's consider the case of $$X, Y \sim N(0,1)$$ with non-trivial correlation $$\rho \ne 0.$$ The joint density is

$$f_{X,Y}(X=x,Y=y)= \frac{1}{2\pi}\exp\left(-\frac{1}{2(1-\rho^2)}(x^2+y^2-2\rho xy)\right)$$

If we add the constraint $$X+Y=c$$, or $$Y=c-X$$, then

$$f_{X}(X=x\mid Y=c-x)= \frac{1}{2\pi}\exp\left(-\frac{1}{2(1-\rho^2)}(x^2+(c-x)^2)-2\rho x(c-x)\right)$$ completing the square, we have

$$f_X(X=x\mid Y=c-x)= \frac{1}{2\pi}\exp \left[-\frac{1}{2} \cdot \frac{(x-c/2)^2)}{(1-\rho)/2}\right] ~\cdot ~\exp\left(-\frac{c^2}{4(1+\rho)}\right) \\$$ which clearly gives $$X\mid X+Y=c \sim N(c/2, (1-\rho)/2),$$ so $$E(X\mid X+Y=c) = c/2,$$ with no explicit dependence on $$\rho$$. The problem is well defined for all values of $$\rho$$, even for $$\rho=-1$$ which implies that $$Y=-X$$, in which case $$X+Y=c$$ means $$c=0$$. But $$E(X\mid X+Y=c)=c/2=0$$ even still!

• +1. As commented above, I have opened a new question to hopefully better understand your answer and @gunes' answer. Just a question though about terminology - is it supposed to be $x|X+Y\sim \dots, E(x|X+Y \dots)$? Jul 9, 2019 at 22:01
• What is the basis for supposing $X$ and $Y$ are exchangeable??
– whuber
Jul 10, 2019 at 12:30
• @whuber They are both drawn from the same distribution. The symmetry of the problem suggests that whatever we conclude about $X$ must also be true about $Y$ as there is no way to distinguish them, otherwise. Exchangeability in this problem passes an obviousness test for me, but I am easy that way. ;) If I've made a logical error or missed a valid contradicting sub-case, I'd love to know where or which. Jul 10, 2019 at 12:41
• @user0 : You have $x|X+Y\sim \dots, E(x|X+Y \dots)$ where you must have meant $X\mid X+Y\sim \dots, E(X\mid X+Y \dots). \qquad$ Jul 10, 2019 at 13:21
• whuber, the answer by @CloseToC at stats.stackexchange.com/questions/416702/exx-y-eyx-y-ex-ey describes a special contradicting sub-case (but leads us far from the intentions of the OP, I believe.) CloseToC posits that $X$ and $Y$ can be "drawn from the same distribution" defined on a state-space but may still have different real number assignments, so $X+Y=c$ is a subset of that space, with arbitrary properties and no general conclusions. I get it now. But does "$X,Y\sim N(0,1)$" admit that case? Hmmm. Jul 10, 2019 at 13:24