2.3Bayes' theorem
The idea
Bayes' theorem reverses a conditional: from "how likely is the evidence under each cause" to "how likely is each cause given the evidence".
Think of it like this: A detective: the clue is more likely under suspect X than Y, but X was also less likely to be there in the first place. Bayes weighs both.
Why it exists
It is the favourite "hard" probability question: fake coins, suppliers, signals, tests, weather tables.
How it works
- List the causes (hypotheses) and their priors.
- Write the likelihood P(evidence | cause) of each.
- Multiply to get the joint = prior × likelihood for each cause.
- Add the joints: that is P(evidence).
- Posterior = (joint of the cause you want) / (total).
Worked example: GATE 2025: 4 regular coins and 1 fake (always heads); two heads seen
Joint(fake) = 1/5 × 1 = 0.2. Joint(regular) = 4/5 × 1/4 = 0.2. Total 0.4. P(fake | HH) = 0.2/0.4 = 0.5. Load the first preset to see the table.
Now play with it
- →Pick the medical-test preset: a 95% accurate test for a 1% condition still leaves a small posterior.
- →Pick the 2021 signal preset and confirm the posterior 0.04.
| hypothesis H | prior P(H) | likelihood P(two heads | H) | joint P(H)·P(E | H) | posterior P(H | two heads) |
|---|---|---|---|---|
| fake coin | 0.2 | 0.5 | ||
| regular coin | 0.2 | 0.5 | ||
| total | 1 | · | 0.4 | 1 |
The column total is P(two heads) 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 4000 show "two heads", and 50% of those come from "fake coin".
| hypothesis H | prior P(H) | likelihood P(test positive | H) | joint P(H)·P(E | H) | posterior P(H | test positive) |
|---|---|---|---|---|
| has the disease | 0.0095 | 0.161 | ||
| healthy | 0.0495 | 0.839 | ||
| total | 1 | · | 0.059 | 1 |
The column total is P(test positive) 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 590 show "test positive", and 16% of those come from "has the disease".
Check yourself
Prior P(H) = 0.1, P(E | H) = 0.9, P(E | not H) = 0.3. What is P(H | E)?
Exam notes (the dense version)
P(Bᵢ | A) = P(Bᵢ) P(A | Bᵢ) / Σⱼ P(Bⱼ) P(A | Bⱼ). It turns "probability of the evidence given each cause" into "probability of each cause given the evidence". Recipe: list the hypotheses with their priors, multiply by the likelihoods to get joints, add them for P(evidence), and divide.
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.