2.2Law of total probability
The idea
When the experiment has a first stage that sets the scene for a second stage, find the probability of the final event by weighting each scenario.
Think of it like this: A weighted average of marks: each scenario contributes (how likely it is) × (the result in it).
Why it exists
The law of total probability is how you handle "pick a coin, then toss" or "first draw changes the next".
How it works
- List the scenarios B₁, B₂, ... for the first stage; they must be disjoint and cover everything.
- Find P(Bᵢ) for each scenario.
- Find P(A | Bᵢ): the chance of the final event inside each scenario.
- Add up P(Bᵢ) × P(A | Bᵢ).
- The column total in the Bayes table below is exactly this number.
Worked example: GATE 2016: a shop has equal numbers of two LED types
P(lasts over 100 h | type 1) = 0.7 and P(... | type 2) = 0.4, each type with probability 1/2. P = 0.5 × 0.7 + 0.5 × 0.4 = 0.55. With the suppliers preset in the table, the total P(reliable) = 0.864.
Now play with it
- →In the table, change one likelihood and watch the total P(evidence) move.
- →Check that the priors still add to 1: the table turns the total red if not.
| hypothesis H | prior P(H) | likelihood P(passes the test | H) | joint P(H)·P(E | H) | posterior P(H | passes the test) |
|---|---|---|---|---|
| made by X | 0.576 | 0.6667 | ||
| made by Y | 0.288 | 0.3333 | ||
| total | 1 | · | 0.864 | 1 |
The column total is P(passes the test) by the law of total probability. Each posterior is the joint divided by that total (Bayes' rule).
Natural-frequency view: out of 10,000 cases, about 8640 show "passes the test", and 33% of those come from "made by Y".
Check yourself
Box 1 (60% of the boxes) has 20% defective items, Box 2 has 50% defective. P(a random item is defective)?
Exam notes (the dense version)
If B₁, ..., Bₙ partition the sample space (disjoint, covering everything), then P(A) = Σ P(Bᵢ) P(A | Bᵢ). Use it when the experiment has a first stage that changes the probabilities of the second: "pick a coin, then toss", "first draw, then second draw".
Previous year questions: Conditional Probability, Bayes & Independence (12)
PYQs are grouped by topic, so this is the full set for Conditional Probability, Bayes & Independence; try the ones that match this subtopic. Open all 12 on the topic page.