← 🔀 Conditional Probability, Bayes & Independence
Subtopic 3 of 4

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

  1. List the causes (hypotheses) and their priors.
  2. Write the likelihood P(evidence | cause) of each.
  3. Multiply to get the joint = prior × likelihood for each cause.
  4. Add the joints: that is P(evidence).
  5. 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 Hprior P(H)likelihood P(two heads | H)joint P(H)·P(E | H)posterior P(H | two heads)
fake coin0.20.5
regular coin0.20.5
total1·0.41

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 Hprior P(H)likelihood P(test positive | H)joint P(H)·P(E | H)posterior P(H | test positive)
has the disease0.00950.161
healthy0.04950.839
total1·0.0591

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)?

Remember: Posterior = prior × likelihood, divided by the sum over all causes.
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.