Probability • Topic 4 of 4

Bayes Basics

Bayes’ theorem reverses a conditional probability: it lets you find P(cause | effect) when you only know P(effect | cause). The setup is always the same — an outcome can arise from two or more sources, and after seeing the outcome you want to know which source it most likely came from. First find the overall probability of the outcome using the total-probability rule P(A) = P(B)·P(A|B) + P(B′)·P(A|B′), then divide the path you care about by that total: P(B|A) = P(B)·P(A|B)/P(A). A tree diagram makes this painless — branch on the source, multiply along each branch to the outcome, then take "the favourable branch over the sum of all branches". The classic CAT framing is two bags or two machines, a ball or item is drawn, and you must work backwards to which bag or machine it came from.

✅ Solved examples

1. Bag A has 3 red and 2 blue; Bag B has 1 red and 4 blue. A bag is chosen at random and a red ball is drawn. Find the probability it came from Bag A.
P(red) = (1/2)(3/5) + (1/2)(1/5) = 3/10 + 1/10 = 4/10. P(A|red) = (3/10)/(4/10) = 3/4.
2. A test is 90% accurate for a disease affecting 1% of people, with a 10% false-positive rate. Given a positive result, find the probability the person has the disease.
P(pos) = (0.01)(0.90) + (0.99)(0.10) = 0.009 + 0.099 = 0.108. P(disease|pos) = 0.009/0.108 = 1/12 ≈ 0.083.
3. Two machines make bolts: M1 makes 60% (2% defective), M2 makes 40% (5% defective). A defective bolt is found. Find the probability it came from M2.
P(def) = (0.6)(0.02) + (0.4)(0.05) = 0.012 + 0.020 = 0.032. P(M2|def) = 0.020/0.032 = 5/8.
4. Box 1 has 2 white and 3 black balls; Box 2 has 4 white and 1 black. A box is picked at random and a white ball is drawn. Find the probability it came from Box 2.
P(white) = (1/2)(2/5) + (1/2)(4/5) = 1/5 + 2/5 = 3/5. P(Box2|white) = (2/5)/(3/5) = 2/3.

✏️ Practice — try these, take hints as needed

1. Bag A: 2 red, 3 green. Bag B: 4 red, 1 green. A bag is chosen at random and a red ball drawn. Probability it came from Bag B?
P(red) = (1/2)(2/5) + (1/2)(4/5).
= 1/5 + 2/5 = 3/5.
Favourable = (2/5).
2/3
2. M1 makes 70% (3% defective), M2 makes 30% (6% defective). A defective item is found. Probability it is from M1?
P(def) = (0.7)(0.03)+(0.3)(0.06).
= 0.021 + 0.018 = 0.039.
Favourable = 0.021.
7/13
3. A disease affects 2% of people; the test is 95% accurate with a 5% false-positive rate. Given a positive test, probability of disease?
P(pos) = (0.02)(0.95)+(0.98)(0.05).
= 0.019 + 0.049 = 0.068.
Favourable = 0.019.
19/68 ≈ 0.279
4. Box 1: 3 white, 1 black. Box 2: 1 white, 3 black. A box chosen at random and a black ball drawn. Probability it is from Box 2?
P(black) = (1/2)(1/4)+(1/2)(3/4).
= 1/8 + 3/8 = 1/2.
Favourable = 3/8.
3/4
5. Two coins: one fair, one two-headed. A coin is picked at random and shows heads. Probability it is the two-headed coin?
P(H) = (1/2)(1/2)+(1/2)(1).
= 1/4 + 1/2 = 3/4.
Favourable = 1/2.
2/3

📝 Topic test — 8 questions

Auto-graded with full solutions; saved to your dashboard. Use the calculator and formula sheet (top-right) any time.

Loading questions…