Slide explaining conditional expectations with a die roll that could be high or low

How Do We Find Conditional Expectations?

How do we calculate $\mathbb{E}(Y \mid X=x)$ in practice?

Often we can find conditional expectations intuitively, just by looking at what is going on, or by using one of the common distributions.

Sometimes this is not possible, and we must proceed explicitly. Let’s work through the process with another simple example.

Essentially, we use the same formula as for an expectation, but with conditional probabilities rather than ordinary ones. We find the latter with the usual formula for conditional probabilities.

Consider the following process. I have a bag with three balls, labelled $1,2,3$. I also have a fair coin. I first pick a ball at random from the bag, and let the number shown be $X$. Then, I flip the fair coin $X$ times, and let $Y$ be the number of heads obtained in total.

We find the expected value of $Y$ given that we draw the ball with $X=2$ written on it. We start with the expected value formula, but weight with conditional probabilities:

$$\mathbb{E}(Y \mid X=2) = 0 \times \mathbb{P}(Y=0 \mid X=2) + 1 \times \mathbb{P}(Y=1 \mid X=2) + 2 \times \mathbb{P}(Y=2 \mid X=2) $$

Here we recognise that, given $X=2$, $Y$ can take the values $0,1,2$.

Now, we find these probabilities using the conditional probability formula. For instance,

$$ \mathbb{P}(Y=0 \mid X=2) = \frac{\mathbb{P}(Y=0 \cap X=2)}{\mathbb{P}(X=2)} = \frac{\frac{1}{3} \times \frac{1}{4}}{\frac{1}{3}} = \frac{1}{4} $$

In this instance, it would have been easier to note that, in light of $X=2$, there are now precisely four possible outcomes for the $2$ coin tosses, all equally likely:

$$HH, HT, TH, TT$$

In more complex cases, however, using the explicit formula above is often easier.

Finally, we put everything back together:

$$\mathbb{E}(Y \mid X=2) = 0 \times \frac{1}{4} + 1 \times \frac{2}{4} + 2 \times \frac{1}{4} = \frac{2+2}{4} = 1 $$

For the computation, it is better to keep all the fractions over $4$, rather than simplifying too early with $\frac{2}{4}=\frac{1}{2}$.

Background: