Post · 4 min read· pp. 86–88

1.4.2 Law of Total Probability


Video Available Video Available

Let us start this section by asking a very simple question: In a certain country there are three provinces, call them B1B_1, B2B_2, and B3B_3 (i.e., the country is partitioned into three disjoint sets B1B_1, B2B_2, and B3B_3). We are interested in the total forest area in the country. Suppose that we know that the forest area in B1B_1, B2B_2, and B3B_3 are 100km2100km^2, 50km250km^2, and 150km2150km^2, respectively. What is the total forest area in the country? If your answer is

100km2+50km2+150km2=300km2,100km^2+50km^2+150km^2=300km^2,
you are right. That is, you can simply add forest areas in each province (partition) to obtain the forest area in the whole country. This is the idea behind the law of total probability, in which the area of forest is replaced by probability of an event AA. In particular, if you want to find P(A)P(A), you can look at a partition of SS, and add the amount of probability of AA that falls in each partition. We have already seen the special case where the partition is BB and BcB^c: we saw that for any two events AA and BB,
P(A)=P(A∩B)+P(A∩Bc)P(A)=P(A \cap B)+P(A \cap B^c)
and using the definition of conditional probability, P(A∩B)=P(A∣B)P(B)P(A \cap B)=P(A|B)P(B), we can write
P(A)=P(A∣B)P(B)+P(A∣Bc)P(Bc).P(A)=P(A|B)P(B)+P(A|B^c)P(B^c).
We can state a more general version of this formula which applies to a general partition of the sample space SS.

Law of Total Probability: If B1,B2,B3,⋯B_1, B_2, B_3,\cdots is a partition of the sample space SS, then for any event AA we have

P(A)=∑iP(A∩Bi)=∑iP(A∣Bi)P(Bi).P(A)=\sum_{i} P(A \cap B_i)=\sum_{i} P(A | B_i) P(B_i).

Using a Venn diagram, we can pictorially see the idea behind the law of total probability. In Figure 1.24, we have

A1=A∩B1,A_1=A \cap B_1,
A2=A∩B2,A_2=A \cap B_2,
A3=A∩B3.A_3=A \cap B_3.
As it can be seen from the figure, A1A_1, A2A_2, and A3A_3 form a partition of the set AA, and thus by the third axiom of probability
P(A)=P(A1)+P(A2)+P(A3).P(A)=P(A_1)+P(A_2)+P(A_3).

Total probability

Fig.1.24 - Law of total probability.

Here is a proof of the law of total probability using probability axioms:

Proof

Since B1,B2,B3,⋯B_1, B_2, B_3,\cdots is a partition of the sample space SS, we can write

SS=⋃iBi=\bigcup_{i} B_i
AA=A∩S= A \cap S
=A∩(⋃iBi)=A \cap (\bigcup_{i} B_i)
=⋃i(A∩Bi)=\bigcup_{i} (A \cap B_i) \hspace{20pt} \hspace{20pt} by the distributive law (Theorem 1.2).

Now note that the sets A∩BiA \cap B_i are disjoint (since the BiB_i's are disjoint). Thus, by the third probability axiom,

P(A)=P(⋃i(A∩Bi))=∑iP(A∩Bi)=∑iP(A∣Bi)P(Bi).P(A)=P\bigg(\bigcup_i (A \cap B_i)\bigg)=\sum_{i} P(A \cap B_i)=\sum_{i} P(A | B_i) P(B_i).


Here is a typical scenario in which we use the law of total probability. We are interested in finding the probability of an event AA, but we don't know how to find P(A)P(A) directly. Instead, we know the conditional probability of AA given some events BiB_i, where the BiB_i's form a partition of the sample space. Thus, we will be able to find P(A)P(A) using the law of total probability, P(A)=∑iP(A∣Bi)P(Bi)P(A)=\sum_{i} P(A | B_i) P(B_i).


Example

I have three bags that each contain $100$ marbles:

  • Bag 1 has $75$ red and $25$ blue marbles;
  • Bag 2 has $60$ red and $40$ blue marbles;
  • Bag 3 has $45$ red and $55$ blue marbles.

I choose one of the bags at random and then pick a marble from the chosen bag, also at random. What is the probability that the chosen marble is red?

  • Solution
    • Let RR be the event that the chosen marble is red. Let BiB_i be the event that I choose Bag ii. We already know that

      P(R∣B1)=0.75,P(R|B_1) =0.75,
      P(R∣B2)=0.60,P(R|B_2) =0.60,
      P(R∣B3)=0.45P(R|B_3) =0.45
      We choose our partition as B1,B2,B3B_1, B_2, B_3. Note that this is a valid partition because, firstly, the BiB_i's are disjoint (only one of them can happen), and secondly, because their union is the entire sample space as one of the bags will be chosen for sure, i.e., P(B1∪B2∪B3)=1P(B_1 \cup B_2 \cup B_3)=1. Using the law of total probability, we can write

      P(R)P(R)$ = P(R
      =(0.75)13+(0.60)13+(0.45)13=(0.75)\frac{1}{3}+(0.60)\frac{1}{3}+(0.45)\frac{1}{3}
      =0.60=0.60