# Conditional Expectation - Adam's Law: $E(E(Y\mid X)) = E(Y)$ - Projection interpretation: $Y - E(Y\mid X)$, which is called the _residual_ from using $X$ to predict $Y$, is uncorrelated with $h(X)$ for any function $h$. ## Examples ### Time until HH vs. HT - Let $W_{HT}$ be the number of tosses until $HT$ appears. - $W_{HT}$ can be divided into time waiting for the first $H$ and that for the first $T$, hence $W_1$ and $W_2$. - Note that our partial progress is not destroyed. Hence $W_1, W_2 \stackrel{\text{i.i.d}}\sim \text{FS}(1/2)$, and $W_{HT} = W_1 + W_2$. - The case for $W_{HH}$ is more complex, as our partial progress is destroyed. - Use the law of total expectation. - Condition on the first toss. - Use memorylessness. - Condition on the second toss.