Solution (source code)

= Solution

The partition theorem is the <law of total probability>. If $B_1,B_2,\ldots$ form a finite or countable <partition of a sample space> into pairwise <disjoint events> with positive <probabilities>, then for any <event> $A$,
$$
\boxed{\mathbb P(A)=\sum_j\mathbb P(A\mid B_j)\mathbb P(B_j).}
$$
Indeed, $A$ is the <disjoint union> of the <events> $A\cap B_j$, so <countable additivity> gives the formula after applying the definition of <conditional probability>. Zero-probability members can be omitted.