# Conditional expectation and correlation

Consider two random random variables $X$ and $Y$ with finite variance. Is it true that $X= E(Y\vert X)$ iff there is a $+1$ or $-1$ correlation between $X$ and $Y$?

• Well, if the correlation has value $-1$, then it might be that $E[Y\mid X] = -X$ and not $+X$ as you want to prove/ – Dilip Sarwate Apr 11 '17 at 2:55

Simple counterexample: Let $$X$$ be some random variable (with finite variance) and let $$Y=5X$$. Then the correlation between $$X$$ and $$Y$$ is 1, but we have $$\DeclareMathOperator{\E}{\mathbb{E}} \E \left[ Y \mid X \right] = \E\left[ 5X \mid X \right] = 5X \not = X$$