# Show that, for random variables X and Z, E[(X-Y)^(2)]=E[X^(2)]-E[Y^(2)] where Y=E[X|Z]

Show that, for random variables X and Z, $E\left[\left(X-Y{\right)}^{2}\right]=E\left[{X}^{2}\right]-E\left[{Y}^{2}\right]$ where Y=E[X|Z]
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

Saige Barton
Write out the left side. We have that
$E\left(\left(X-Y{\right)}^{2}\right)=E\left({X}^{2}+{Y}^{2}-2XY\right)$
$=E\left({X}^{2}\right)+E\left({Y}^{2}\right)-2E\left(XY\right)$
Now, what is E(XY)? Let's prove that it is equal to $E\left({Y}^{2}\right)$.
$E\left(XY-{Y}^{2}\right)=E\left(Y\left(X-Y\right)\right)=E\left(E\left(X|Z\right)\right)\ast \left(X-E\left(X|Z\right)\right)=0$
The expression above is equal to zero, since we know that the projection E(X|Z) and the connection between the point X and the projection E(X|Z) are orthogonal. Therefore $E\left(XY\right)=E\left({Y}^{2}\right)$ which implies
$E\left(\left(X-Y{\right)}^{2}\right)=E\left({X}^{}\right)-E\left({Y}^{2}\right)$
Result:
Use the fact that X-E(X|Z) is orthogonal to E(X|Z)