Conditional Expectation

Condition on Y, then average back with the tower law.

The idea

Conditional expectation is the mean of one random variable computed as if the value of another were known. Fix a value $y$. Among the outcomes where $Y = y$, the variable $X$ still has a distribution, and the mean of that distribution is the conditional expectation $\mathbb{E}[X \mid Y = y]$ — one number for each value $y$.

Letting $y$ range over the values of $Y$ collects these numbers into a single object $\mathbb{E}[X \mid Y]$: the random variable equal to $\mathbb{E}[X \mid Y = y]$ on the outcomes where $Y = y$. Being a random variable, it has an expectation of its own, and the tower law states that this expectation is $\mathbb{E}[X]$ itself: $\mathbb{E}[X] = \mathbb{E}\big[\mathbb{E}[X \mid Y]\big] = \sum_{y} \mathbb{E}[X \mid Y = y]\,\mathbb{P}(Y = y).$

The sum on the right is a method for computing $\mathbb{E}[X]$. Split the experiment into cases by the value of $Y$; compute the mean of $X$ within each case; then average the case means, weighting each by the probability of its case. The cases are disjoint and cover every outcome, so the split loses nothing and the recombination counts nothing twice.

Ways to work on it

Not sure where to start? Take the ten-question placement test.