Partition and total probability
A product can come from different factories. The chance that a randomly picked item is defective is found by adding the chance through each factory: the chance of the factory times the chance of a defect there.
Events E₁, E₂, …, Eₙ form a partition of the sample space if they are mutually exclusive, together cover the whole sample space, and each has non-zero probability. Then for any event A, the theorem of total probability adds all the paths to A.
Formula: P(A) = P(E₁) P(A|E₁) + P(E₂) P(A|E₂) + … + P(Eₙ) P(A|Eₙ)
Rule 1: Add all paths to A — Chance of each cause times chance of A under that cause.
- Easy: Bag I has 3 red and 2 blue, Bag II has 1 red and 4 blue. A bag is chosen at random: P(red) = ½ × 3/5 + ½ × 1/5 = 2/5.
- Medium: Machines make 50%, 30% and 20% of items, with defect rates 2%, 3% and 5%: P(defective) = 0.01 + 0.009 + 0.01 = 0.029.
- Exam-type: A fair coin and a two-headed coin, one chosen at random: P(head) = ½ × ½ + ½ × 1 = 3/4.
Rule 2: Check the partition — The probabilities of the parts add up to 1.
- Easy: 0.5 + 0.3 + 0.2 = 1, so the three machines form a partition.
- Medium: Day scholars 60% and hostel students 40%; pass rates 90% and 80%: P(pass) = 0.54 + 0.32 = 0.86.
- Exam-type: 30% of people travel by bus and 70% by bike; late 10% and 5%: P(late) = 0.03 + 0.035 = 0.065.
A tree diagram helps. Multiply along each branch to A, then add the branches.
Adding the conditional probabilities without multiplying by the chance of each part.
Along the branch multiply, across the branches add.
Practice questions
- 1Bag I has 3 red and 2 blue, and Bag II has 1 red and 4 blue. A bag is chosen at random. Find P(red).
- 2Machines make 50%, 30% and 20% of items with defect rates 2%, 3% and 5%. Find P(defective).
- 3What three conditions make E₁, E₂, …, Eₙ a partition?
- 4P(E₁) = 0.4, P(E₂) = 0.6, P(A|E₁) = 0.5 and P(A|E₂) = 0.1. Find P(A).
- 560% of students are day scholars and 40% are in the hostel. They pass with probability 0.9 and 0.8. Find P(pass).
- 6A box has a fair coin and a two-headed coin. One is chosen at random and tossed. Find P(head).
- 730% of people travel by bus and 70% by bike. They are late with probability 0.10 and 0.05. Find P(late).
- 8Do the probabilities 0.5, 0.3, 0.2 of three events form a valid partition, if the events are mutually exclusive?
Show answers (try them yourself first)
- 1½ × 3/5 + ½ × 1/5 = 2/5
- 20.5 × 0.02 + 0.3 × 0.03 + 0.2 × 0.05 = 0.029
- 3Mutually exclusive, together the whole sample space, and each with non-zero probability
- 40.4 × 0.5 + 0.6 × 0.1 = 0.26
- 50.6 × 0.9 + 0.4 × 0.8 = 0.86
- 6½ × ½ + ½ × 1 = 3/4
- 70.3 × 0.10 + 0.7 × 0.05 = 0.065
- 8Yes, since 0.5 + 0.3 + 0.2 = 1
Bayes' theorem
A doctor sees a positive test and asks: how likely is it that the patient really has the disease? Bayes' theorem turns the chance of the test result given the disease into the chance of the disease given the test result.
When an event A has occurred, the chance that it came through the partition part Eᵢ is the share of the Eᵢ path in the total chance of A.
Formula: P(Eᵢ|A) = P(Eᵢ) P(A|Eᵢ) / [P(E₁) P(A|E₁) + P(E₂) P(A|E₂) + … + P(Eₙ) P(A|Eₙ)]
Rule 1: Share of the path — One path divided by the total of all paths.
- Easy: Bags problem: given that the ball drawn is red, P(Bag I) = (½ × 3/5)/(2/5) = 3/4.
- Medium: Machines problem: given a defective item, P(it came from machine 1) = 0.01/0.029 = 10/29.
- Exam-type: Coin problem: given a head, P(two-headed coin) = (½ × 1)/(3/4) = 2/3.
Rule 2: Real-life tests — The answer can be surprisingly small.
- Easy: With P(E₁) = 0.4, P(E₂) = 0.6, P(A|E₁) = 0.5, P(A|E₂) = 0.1: P(E₁|A) = 0.2/0.26 = 10/13.
- Medium: Day scholar given pass: 0.54/0.86 = 27/43.
- Exam-type: 1% have a disease. A test is positive for 95% of the sick and 5% of the healthy. P(disease | positive) = 0.0095/0.059 = 19/118, about 0.16.
First find P(A) by total probability, then divide the chosen path by it. The denominator is the same for every cause.
Using P(A|Eᵢ) as the answer instead of P(Eᵢ|A).
Path over total.
Practice questions
- 1In the bags problem, given a red ball, find P(Bag I).
- 2In the machines problem, given a defective item, find P(machine 1).
- 3In the coin problem, given a head, find P(two-headed coin).
- 4P(E₁) = 0.4, P(E₂) = 0.6, P(A|E₁) = 0.5, P(A|E₂) = 0.1. Find P(E₁|A).
- 5In the school problem, find P(day scholar | pass).
- 6In the travel problem, find P(bus | late).
- 71% of people have a disease. A test is positive for 95% of the sick and 5% of the healthy. Find P(disease | positive).
- 8In the same test, find P(no disease | positive).
Show answers (try them yourself first)
- 13/4
- 210/29
- 32/3
- 40.2/0.26 = 10/13
- 50.54/0.86 = 27/43
- 60.03/0.065 = 6/13
- 70.0095/(0.0095 + 0.0495) = 19/118, about 0.16
- 80.0495/0.059 = 99/118, about 0.84