Solved – What‘s wrong with the proof of the Law of Total Variance

conditional probabilityconditional-expectationexpected valuemomentsvariance

According to the Law of Total Variance,
$$\operatorname{Var}(X)=\operatorname{E}(\operatorname{Var}(X\mid Y)) + \operatorname{Var}(\operatorname{E}(X\mid Y))$$

When trying to prove it, I write

$$
\begin{equation}
\begin{aligned}
\operatorname{Var}(X) &= \operatorname{E}(X – \operatorname{E}X)^2 \\
&= \operatorname{E}\left\{\operatorname{E}\left[(X – \operatorname{E}X)^2\mid Y\right]\right\} \\
&= \operatorname{E}(\operatorname{Var}(X\mid Y))
\end{aligned}
\end{equation}
$$

What's wrong with it?

Best Answer

The third line is wrong, because you don't have $\text{E}[X|Y]$ in the second line. For example, if $Y$ is Bernoulli(1/2) and $X$ is 1 if $Y$ is 1 and -1 if $Y$ is 0, then $\text{E}[(X-\text{E}[X|Y])^2|Y] = 0$ (this is what you want) because $Y$ is totally informative of $X$, but what you have will give you $\text{E}[(X-\text{E}[X])^2|Y] = \text{E}[(X-0)^2|Y] = \text{E}[X^2|Y] = 1 \ne 0$.

Not gonna lie, you had me questioning myself and I had to stare at this for a bit before it hit me even though I've had to prove LOTV to myself a billion times :P