Artificial Intelligence 🤖
The Total Law of Probability

The Total Law of Probability

Consider a collection of events A1,…,AnA_{1}, \ldots, A_{n}. These form a partition of Ω\Omega if:

  1. they are pairwise mutually exclusive.
  2. they are collectively exhaustive.
  3. they all have nonzero probability, P(Ai)>0P\left(A_{i}\right)>0 for i=1,…,ni=1, \ldots, n.

A partition divides Ω\Omega into non-overlapping subsets, like the pieces of a jigsaw puzzle. The Law of Total Probability allows us to use partitions to simplify probability calculations.

Suppose that A1,…,AnA_{1}, \ldots, A_{n} is a partition of Ω\Omega. For any event B⊂ΩB \subset \Omega, the Law of Total Probability states that:

P(B)=∑k=1nP(B,Ak)=∑k=1nP(B∣Ak)P(Ak)P(B)=\sum_{k=1}^{n} P\left(B, A_{k}\right)=\sum_{k=1}^{n} P\left(B \mid A_{k}\right) P\left(A_{k}\right)

We consider separately the probability that BB occurs in each possible 'scenario' (Ak)\left(A_{k}\right), and then combine the resulting conditional probabilities.

Example: Total Law of Probability

Suppose you have three coins. You know that one of the coins, coin 1, is fair and therefore lands heads with the probability 0.5 . The other two coins, coins 2 and 3 , are biased, landing heads with probabilities of 0.4 and 0.8 respectively. Given that your opponent picks one of the three coins at random (with equal probability) and tosses it, without telling you which one it was, what is the probability that it lands heads?

In the problem statement above we are provided with the conditional probabilities of heads, given we know the coin is 1,2 or 3 (events C1,C2C_{1}, C_{2} and C3C_{3} respectively):

P(H∣C1)=0.5P(H∣C2)=0.4P(H∣C3)=0.8\begin{aligned} & P\left(H \mid C_{1}\right)=0.5 \\ & P\left(H \mid C_{2}\right)=0.4 \\ & P\left(H \mid C_{3}\right)=0.8 \end{aligned}

We do not actually know which of the three coins has been tossed, but we know that all three coins are equally likely:

P(C1)=P(C2)=P(C3)=13P\left(C_{1}\right)=P\left(C_{2}\right)=P\left(C_{3}\right)=\frac{1}{3}

Since events C1,C2C_{1}, C_{2} and C3C_{3} are mutually exclusive (i.e. only one coin is tossed), and collectively exhaustive (at least one of these coins is tossed), we can apply the law of total probability to compute the total probability of a coin landing heads:

P(H)=∑k=13P(H∣Ck)P(Ck)=0.5×13+0.4×13+0.8×13≈0.5667P(H)=\sum_{k=1}^{3} P\left(H \mid C_{k}\right) P\left(C_{k}\right)=0.5 \times \frac{1}{3}+0.4 \times \frac{1}{3}+0.8 \times \frac{1}{3} \approx 0.5667