Solution (source code)

= Solution
{c}

For an <integrable> <random variable> $X$, the <law of total expectation> for the <partition of a sample space> is
$$
\boxed{\mathbb E[X]=\sum_{i:\,\mathbb P(B_i)>0}\mathbb E[X\mid B_i]\,\mathbb P(B_i).}
$$
Parts of zero <probability> contribute zero and need no definition of $\mathbb E[X\mid B_i]$. To see the identity, write $X=\sum_i X\mathbf1_{B_i}$ and use <linearity of expectation>; integrability justifies the countable sum since $\sum_i\mathbb E[|X|\mathbf1_{B_i}]=\mathbb E[|X|]<\infty$.