A person tests positive for a disease. What’s the actual probability they have it? A ball drawn from a randomly chosen bag turns out to be gold. Which bag did it most likely come from? These “reverse” questions — working backward from an observed outcome to the probability of its underlying cause — are exactly what Bayes’ theorem solves. It’s one of the most heavily tested topics in CBSE boards, CUET, and IPMAT, and this guide walks through the formula, its proof, and four classic solved examples.
What Problem Does Bayes’ Theorem Solve?
Every conditional probability question so far runs “forward”: given a bag was chosen, what’s the probability of drawing a red ball? Bayes’ theorem runs it backward: given a red ball was drawn, what’s the probability it came from a particular bag? This is the reverse probability — the probability of a cause given an observed effect.
Bayes’ Theorem: Statement
Let {E₁, E₂, …, Eₙ} be a partition of S, where each Ei is a nonempty event with nonzero probability, and A is any event with nonzero probability. Then for any i:
P(Ei|A) = [P(Ei) · P(A|Ei)] / [Σⱼ P(Ej) · P(A|Ej)]
The denominator is P(A), computed via the theorem of total probability across the same partition.
Key Terminology
-
E₁, E₂, …, Eₙ are the hypotheses.
-
P(Ei), a hypothesis’s probability before new evidence, is the priori probability.
-
P(Ei|A), the updated probability after observing A, is the posteriori probability.
Because Bayes’ theorem finds the probability of a “cause” given an observed “effect,” it’s often called the formula for the probability of causes.
Proof of Bayes’ Theorem
Starting from the definition of conditional probability: P(Ei|A) = P(A ∩ Ei) / P(A)
By the multiplication rule, P(A ∩ Ei) = P(Ei) · P(A|Ei), so:
P(Ei|A) = [P(Ei) · P(A|Ei)] / P(A)
By the theorem of total probability, P(A) = Σⱼ P(Ej) · P(A|Ej). Substituting into the denominator:
P(Ei|A) = [P(Ei) · P(A|Ei)] / [Σⱼ P(Ej) · P(A|Ej)]
This confirms Bayes’ theorem is really just conditional probability plus the theorem of total probability, combined into one reusable formula.
Solved Examples
Example 1 — Gold Coin From Three Boxes
Three identical boxes each contain two coins. Box I has two gold coins, Box II has two silver coins, and Box III has one of each. A box is chosen at random and a coin drawn is found to be gold. Find the probability the other coin in that box is also gold.
Let E₁, E₂, E₃ be “Box I/II/III chosen,” each P(Ei) = 1/3. Let A: “the coin drawn is gold.”
P(A|E₁) = 1, P(A|E₂) = 0, P(A|E₃) = 1/2
The probability the other coin is gold equals P(E₁|A):
P(E₁|A) = [(1/3)(1)] / [(1/3)(1) + (1/3)(0) + (1/3)(1/2)] = (1/3) / (1/2) = 2/3
Example 2 — Red Ball From Two Bags
Bag I has 3 red and 4 black balls; Bag II has 5 red and 6 black balls. A bag is picked at random and a ball drawn is red. Find the probability it was drawn from Bag II.
P(E₁) = P(E₂) = 1/2, P(A|E₁) = 3/7, P(A|E₂) = 5/11
P(E₂|A) = [(1/2)(5/11)] / [(1/2)(3/7) + (1/2)(5/11)] = (5/22) / (68/154) = 35/68
Example 3 — HIV Test Reliability (Reversing a “Positive” Result)
A test detects HIV correctly 90% of the time in infected people but gives a false positive 1% of the time in healthy people. Only 0.1% of the population actually has HIV. A random person tests positive. Find the probability they actually have HIV.
Let E: “person has HIV,” A: “test result is positive.”
P(E) = 0.001, P(E′) = 0.999, P(A|E) = 0.9, P(A|E′) = 0.01
P(E|A) = (0.001 × 0.9) / [(0.001 × 0.9) + (0.999 × 0.01)] = 0.0009 / 0.01089 ≈ 0.083
Despite a “90% accurate” test, the probability of actually having the disease given a positive result is only about 8.3%. This is why Bayes’ theorem matters in medicine — the disease’s rarity dramatically affects how much weight a positive result should carry.
Example 4 — The Truthful Man and the Die
A man speaks the truth 3 out of 4 times. He throws a die and reports it showed a six. Find the probability it actually was a six.
Let S₁: “six occurs” (P = 1/6), S₂: “six doesn’t occur” (P = 5/6). Let E: “man reports a six.”
P(E|S₁) = 3/4 (truthful), P(E|S₂) = 1/4 (lies)
P(S₁|E) = [(1/6)(3/4)] / [(1/6)(3/4) + (5/6)(1/4)] = (1/8) / (8/24) = 3/8
Even though he’s truthful 75% of the time, the low base rate of actually rolling a six pulls the final probability down to 3/8.
Why Bayes’ Theorem Feels Counter-Intuitive
Examples 3 and 4 highlight the biggest lesson here: the rarity of the “cause” matters just as much as the reliability of the “evidence.” A highly accurate test on a rare condition can still produce more false positives than true positives in absolute terms, since there are far more healthy people than sick people being tested. Always compute the full formula rather than trusting intuition.
Common Mistakes Students Make
-
Forgetting every hypothesis in the denominator. Sum P(Ej)·P(A|Ej) across all Ej, not just the one you’re solving for.
-
Confusing P(A|Ei) with P(Ei|A). The theorem exists precisely because these differ.
-
Skipping priori probabilities. Ignoring how likely each hypothesis was before the evidence is the main reason answers feel counter-intuitive.
Master Bayes’ Theorem Before Your Next Test
Bayes’ theorem questions are almost guaranteed in CBSE boards and a CUET/IPMAT favourite because of how easily intuition goes wrong. Get unlimited AI-generated practice with instant step-by-step solutions with PrepCoin packs from ₹59 on ChampionsPrep — built for CBSE and Maharashtra Board Commerce students.

Bayes' Theorem Class 12: Formula, Proof and Solved Examples
Frequently Asked Questions
What is Bayes' theorem used for? +
It calculates the reverse probability of a cause or hypothesis given that an observed effect has occurred, useful in medical testing, quality control, and scenarios with multiple possible sources for an outcome.
What is the difference between priori and posteriori probability? +
Priori probability is the probability of a hypothesis before any new evidence. Posteriori probability is the updated probability of that hypothesis after observing the evidence.
Why is the denominator of Bayes' theorem the total probability formula? +
Because the probability of the observed evidence across all scenarios must be computed by summing the product of each hypothesis probability and its conditional probability over the entire partition, which is exactly the theorem of total probability.
Why can a 90 percent accurate test still give a low probability of actually having a rare disease? +
Because the disease's rarity means there are far more healthy people than sick people being tested. Even a small false-positive rate among the large healthy group can outnumber the true positives from the small infected group.
Is Bayes' theorem only for two hypotheses? +
No. It works for any partition of the sample space with two or more mutually exclusive, exhaustive hypotheses, and the formula simply sums over however many hypothesis events exist.
AI-powered practice — free to start