Law of Total Probability: Formula, Examples & Applications

The law of total probability is a fundamental rule that breaks down complex probability calculations into simpler conditional probabilities. This guide provides clear explanations, visual diagrams, and detailed worked examples.

Understanding the Law of Total Probability

Let the sample space \( S \) be partitioned into \( n \) mutually exclusive and collectively exhaustive events \( E_1, E_2, \dots, E_n \).

Venn diagram illustrating the law of total probability

Note that:

\[ A = (A \cap E_1) \cup (A \cap E_2) \cup \cdots \cup (A \cap E_n) \]

Since the events \( E_i \) are mutually exclusive, the events \( (A \cap E_i) \) are also mutually exclusive. Using the addition rule:

\[ P(A) = P(A \cap E_1) + P(A \cap E_2) + \cdots + P(A \cap E_n) \]

Applying the definition of conditional probability, \( P(A \cap E_i) = P(A \mid E_i)P(E_i) \), we derive the law:

\[ P(A) = P(A \mid E_1)P(E_1) + P(A \mid E_2)P(E_2) + \cdots + P(A \mid E_n)P(E_n) \] \[ P(A) = \sum_{i=1}^{n} P(A \mid E_i)P(E_i) \]

Because \( E_1, E_2, \dots, E_n \) are collectively exhaustive:

\[ \sum_{i=1}^{n} P(E_i) = 1 \]

Solved Examples: Applying the Law of Total Probability

Example 1: Random Selection from Multiple Bags

Problem: Three bags contain 4 balls each. Bag B1 has 2 red and 2 blue balls, B2 has 3 red and 1 blue, and B3 has 1 red and 3 blue. A bag is chosen randomly, then a ball is drawn randomly from it. What is the probability the ball is red?

Diagram showing three bags with different ball compositions

Solution

Method 1: Classical Probability
Total balls = 12, total red balls = 6. Thus: \[ P(\text{Red}) = \frac{6}{12} = \frac{1}{2} \]

Method 2: Law of Total Probability
Define events:

Since bags are equally likely: \[ P(E_1) = P(E_2) = P(E_3) = \frac{1}{3} \] Conditional probabilities: \[ P(A \mid E_1) = \frac{2}{4} = \frac{1}{2}, \quad P(A \mid E_2) = \frac{3}{4}, \quad P(A \mid E_3) = \frac{1}{4} \] Applying the law: \[ \begin{aligned} P(A) &= P(A \mid E_1)P(E_1) + P(A \mid E_2)P(E_2) + P(A \mid E_3)P(E_3) \\ &= \left(\frac{1}{2} \times \frac{1}{3}\right) + \left(\frac{3}{4} \times \frac{1}{3}\right) + \left(\frac{1}{4} \times \frac{1}{3}\right) \\ &= \frac{1}{6} + \frac{1}{4} + \frac{1}{12} = \frac{2 + 3 + 1}{12} = \frac{6}{12} = \frac{1}{2} \end{aligned} \]

Example 2: Test Pass Rates by Gender

Problem: A math class has 40% males and 60% females. The test pass rates are 50% for males and 70% for females. What percentage of students passed?

Diagram showing class divided into males and females with pass rates

Solution

Define events:

Given: \[ P(E_1) = 0.4, \quad P(E_2) = 0.6, \quad P(A \mid E_1) = 0.5, \quad P(A \mid E_2) = 0.7 \] Applying the law: \[ \begin{aligned} P(A) &= P(A \mid E_1)P(E_1) + P(A \mid E_2)P(E_2) \\ &= (0.5 \times 0.4) + (0.7 \times 0.6) \\ &= 0.20 + 0.42 = 0.62 \end{aligned} \] Therefore, 62% of students passed.

Example 3: Factory Production with Quality Control

Problem: Three factories supply tools. Factory A produces 30% of tools, while B and C produce the rest. Non-defective rates: A (98%), B (95%), C (97%). What should be the production percentages for B and C so that the overall non-defective probability is 96%?

Diagram showing three factories with production percentages and quality rates

Solution

Let:

Since factories cover the entire market: \[ P(A) = 0.3, \quad x + y = 0.7 \quad \Rightarrow \quad y = 0.7 - x \] Let \( ND \) be "non-defective". Given: \[ P(ND \mid A) = 0.98, \quad P(ND \mid B) = 0.95, \quad P(ND \mid C) = 0.97 \] We want \( P(ND) = 0.96 \). Apply the law: \[ \begin{aligned} P(ND) &= P(ND \mid A)P(A) + P(ND \mid B)P(B) + P(ND \mid C)P(C) \\ 0.96 &= 0.98 \times 0.3 + 0.95x + 0.97(0.7 - x) \\ 0.96 &= 0.294 + 0.95x + 0.679 - 0.97x \\ 0.96 &= 0.973 - 0.02x \\ 0.02x &= 0.013 \\ x &= 0.65, \quad y = 0.05 \end{aligned} \] Therefore, Factory B should produce 65% and Factory C 5%.

Example 4: Medical Testing Accuracy

Problem: In a population, 5% have a flu. A test is 95% positive for infected people and 1% positive (false positive) for healthy people. What is the probability a randomly selected person tests positive?

Solution

Define events:

Given: \[ P(A \mid E_1) = 0.95, \quad P(A \mid E_2) = 0.01 \] Applying the law: \[ \begin{aligned} P(A) &= P(A \mid E_1)P(E_1) + P(A \mid E_2)P(E_2) \\ &= 0.95 \times 0.05 + 0.01 \times 0.95 \\ &= 0.0475 + 0.0095 = 0.057 \end{aligned} \] The probability of a positive test is 5.7%.

Related Probability Resources