Bayes' Theorem
Flip a conditional probability around: from P(evidence given cause) to P(cause given evidence). The single most-tested idea in GATE DA probability.
What you'll learn
- Bayes' theorem as the inversion of a conditional: from P(E|H) to P(H|E)
- Prior, likelihood, evidence (normaliser), and posterior — what each term is
- Working a medical-test problem to a numeric answer (a real 2026 question)
- Why base rates make a positive test on a rare condition usually a false alarm
Before you start
You believe something. New evidence shows up. You update. That’s the whole story — Bayes’ theorem is just the precise arithmetic for that update.
It matters because the number you can measure (the test’s accuracy:
P(positive | disease)) is almost never the number you want (the answer to
“do I have it, given I tested positive?”: P(disease | positive)). Bayes is
the rule that flips the conditional around so the numbers come out right — and
it’s the single most-tested idea in GATE DA probability.
The formula
- Prior
P(H)— belief in the hypothesis before the evidence. - Likelihood
P(E | H)— how probable the evidence is if the hypothesis holds. - Evidence
P(E)— total probability of the evidence (the total-probability denominator from the last lesson; it just makes the answer sum to 1). - Posterior
P(H | E)— updated belief after seeing the evidence.
Build the intuition with a coin of unknown bias: the prior (dashed) reshapes into a posterior (bold) as each flip arrives.
Worked example — a real 2026 question
A disease affects 30% of a population. A test detects it correctly 80% of the time (sensitivity), but also gives a 10% false-positive rate on healthy people. A person tests positive. What is the probability they have the disease?
Lay out the pieces, then apply the formula with total probability in the denominator:
P(D) = 0.30, P(+|D) = 0.80, P(+|¬D) = 0.10, P(¬D) = 0.70
P(D | +) = P(+|D)·P(D)
─────────────────────────────
P(+|D)·P(D) + P(+|¬D)·P(¬D)
= 0.80 · 0.30
────────────────────────── = 0.24 / 0.31 ≈ 0.77
0.80·0.30 + 0.10·0.70
So ≈ 0.77. (This is GATE DA 2026, Q57 — answer 0.77.) The disease was common enough (30%) that a positive test is convincing.
Now contrast with a rare disease — drag the prior down here and watch the posterior collapse:
How GATE asks this
Almost always a NAT: a 2-to-4-hypothesis setup (boxes, machines, disease,
spam) where you must compute one posterior to 2 decimals. The recipe never changes:
write the priors and likelihoods, build the evidence denominator by total
probability, divide. GATE DA 2025’s Q31 used three boxes with unequal priors
(½, ⅙, ⅓) and asked P(Box 2 | white ball) — the answer was 0.25, found by
exactly this procedure with three terms in the denominator.
Quick check
Quick check
Practice this in an interview
All questionsBayes' theorem updates a prior probability with new evidence: P(H|E) = P(E|H) P(H) / P(E). In disease testing, ignoring the low base rate (prior) makes a positive test look far more alarming than it really is — most positives are false positives when the disease is rare.
Conditional probability P(A|B) is the probability of A given that B has already occurred, computed as P(A and B) / P(B). It narrows the sample space to B, whereas joint probability P(A and B) lives in the full, unrestricted space.
The law of total probability decomposes P(A) over a mutually exclusive, exhaustive partition of the sample space: P(A) = Σ P(A|Bᵢ)·P(Bᵢ). It is the engine behind the Bayes denominator and any calculation where you want an overall rate built from segment-level rates.
In the Monty Hall problem, a host who knows where the prize is always opens an empty door — this action transfers probability mass to the remaining unopened door, making switching win with probability 2/3 and staying win only 1/3. The key is that the host's action is not random.