How do you use Bayes’ theorem?
Answer in short
List the possible causes E₁, …, Eₙ as a partition with chances P(Eᵢ), and the chance P(A|Eᵢ) of the observed result A under each. Total probability gives P(A) = Σ P(Eⱼ) P(A|Eⱼ). Then the chance of one cause after seeing A is P(Eᵢ|A) = P(Eᵢ) P(A|Eᵢ) / P(A).
Stuck on a question? Take a photo and Lagnever AI explains it step by step. Try it for 7 days for ₹2. Get it on Google Play
The question Bayes answers
Two bags hold different mixes of balls; one bag is picked at random and a ball is drawn. It is easy to say how likely red is if we know the bag. The harder, reverse question is: we saw a red ball, so how likely is it that it came from Bag II? Bayes’ theorem answers this kind of reverse question. (The book dates it to 1763, published after its author’s death.)
Step 1: a partition of the sample space
Events E₁, E₂, …, Eₙ form a partition of S when:
- no two of them overlap: Eᵢ ∩ Eⱼ = φ for i ≠ j;
- together they make up S: E₁ ∪ E₂ ∪ … ∪ Eₙ = S;
- each has P(Eᵢ) > 0.
So exactly one of them happens. Any event with a probability strictly between 0 and 1, together with its complement, is a partition. For two events E and F, the four pieces E ∩ F′, E ∩ F, E′ ∩ F and E′ ∩ F′ form another (leaving out any piece that is empty). A sample space has many partitions.
Step 2: the theorem of total probability
For a partition E₁, …, Eₙ and any event A:
P(A) = P(E₁) P(A|E₁) + P(E₂) P(A|E₂) + … + P(Eₙ) P(A|Eₙ).
Why it works. A = A ∩ S = (A ∩ E₁) ∪ … ∪ (A ∩ Eₙ), and these pieces do not overlap because the Eᵢ do not. Add their probabilities and write each one as P(Eᵢ) P(A|Eᵢ) by the multiplication rule.
Example 15 (page 425). P(strike) = 0.65, P(on time | strike) = 0.32, P(on time | no strike) = 0.80. Strike and no strike form a partition, so P(on time) = 0.65 × 0.32 + 0.35 × 0.80 = 0.208 + 0.28 = 0.488.
Step 3: Bayes’ theorem
If E₁, …, Eₙ is a partition and P(A) ≠ 0, then for each i,
P(Eᵢ|A) = P(Eᵢ) P(A|Eᵢ) / [P(E₁) P(A|E₁) + … + P(Eₙ) P(A|Eₙ)].
Proof in three lines. P(Eᵢ|A) = P(A ∩ Eᵢ)/P(A) by definition. The numerator is P(Eᵢ) P(A|Eᵢ) by the multiplication rule. The denominator is the total-probability sum.
Words used with it. The Eᵢ are the hypotheses. P(Eᵢ) is the prior (a priori) probability, known before A is seen; P(Eᵢ|A) is the posterior (a posteriori) probability, after A is seen.
The tree method
- Draw one branch for each cause Eᵢ and write P(Eᵢ) on it. These must add to 1.
- From each cause, draw a branch to A and write P(A|Eᵢ).
- Multiply along each path to A: these are P(Eᵢ) P(A|Eᵢ).
- Add the products: that is P(A).
- The answer is the product for the cause asked about, divided by P(A).
Example 16 (page 426). Bag I has 3 red and 4 black, Bag II has 5 red and 6 black; a bag is chosen at random and the ball is red. Products: ½ × 3/7 = 3/14 and ½ × 5/11 = 5/22. P(red) = 3/14 + 5/22 = 34/77, and P(Bag II | red) = (5/22) ÷ (34/77) = 35/68.
How the evidence shifts the chances
Example 19 (page 428). Machines A, B and C make 25%, 35% and 40% of the bolts, and 5%, 4% and 2% of their bolts are defective. P(defective) = 0.0125 + 0.014 + 0.008 = 0.0345. Given a defective bolt:
| Machine | Prior P(Eᵢ) | P(defective given Eᵢ) | Product | Posterior |
|---|---|---|---|---|
| A | 0.25 | 0.05 | 0.0125 | 25/69 |
| B | 0.35 | 0.04 | 0.0140 | 28/69 |
| C | 0.40 | 0.02 | 0.0080 | 16/69 |
So the bolt came from B with probability 28/69. Machine C makes the most bolts but the fewest defects, so a defective bolt points away from C.
A rare disease (Exercise 13.3 Q5). A test catches 99% of real cases but also flags 0.5% of healthy people, and 0.1% of people have the disease. Picture 200,000 people: 200 are ill and 198 of them test positive; 199,800 are healthy and 999 of them test positive. Of 1,197 positives, only 198 are ill: P(ill | positive) = 198/1197 = 22/133, about 0.165.
More patterns from the book
- Box of coins (Example 17). Three boxes: two gold coins, two silver coins, one of each. A gold coin is drawn; the other coin is gold only if the box was the first. P = (⅓ × 1)/(⅓ × 1 + ⅓ × 0 + ⅓ × ½) = 2/3.
- Late doctor (Example 20). Four means of transport with priors 3/10, 1/5, 1/10, 2/5 and chances of lateness 1/4, 1/3, 1/12, 0. P(train | late) = (3/40)/(3/40 + 1/15 + 1/120) = 1/2.
- Truthful reporter (Example 21). A man tells the truth 3 times in 4 and reports a six. P(six | reported six) = (1/6 × 3/4)/(1/6 × 3/4 + 5/6 × 1/4) = 3/8.
- Machine set-up (Example 24). Correct set-up (prior 0.8) gives 90% good items, wrong set-up (0.2) gives 40%. After 2 good items, P(correct) = 0.8 × 0.81/(0.8 × 0.81 + 0.2 × 0.16) = 648/680 ≈ 0.95.
Every Exercise 13.3 question is worked in the NCERT solutions. For the basics of P(E|F), see conditional probability; back to the Chapter 13 notes.
Practice
-
Two boxes are equally likely to be chosen. Box I has 2 red and 2 blue balls, Box II has 3 red and 1 blue. A red ball is drawn. P(Box II | red) is:
Show answer
Answer: (b) 3/5
-
Machines X and Y make 70% and 30% of the items, with 1% and 2% defective. The probability that a random item is defective is:
Show answer
Answer: (a) 0.013
-
In the Bayes formula, the denominator Σ P(Eⱼ) P(A|Eⱼ) equals:
Show answer
Answer: (c) P(A)
-
For the machines above, find the probability that a defective item came from Y.
Show answer
Answer: P(defective) = 0.7 × 0.01 + 0.3 × 0.02 = 0.007 + 0.006 = 0.013. P(Y | defective) = 0.006/0.013 = 6/13.
-
A coin is either fair or two-headed, each with probability 1/2. It is tossed and shows a head. What is the probability that it is two-headed?
Show answer
Answer: P(head) = 1/2 × 1/2 + 1/2 × 1 = 3/4. P(two-headed | head) = (1/2 × 1)/(3/4) = 2/3.
Questions students ask
Why is Bayes’ theorem called a formula for the probability of causes?
The partition E₁, …, Eₙ lists every possible cause, exactly one of which happened. After seeing the result A, the theorem tells us how likely each cause is. So it reasons backwards, from an effect to its cause.
Is the theorem of total probability part of Bayes’ theorem?
It gives the denominator. Bayes’ theorem is P(Eᵢ ∩ A)/P(A); the numerator comes from the multiplication rule and P(A) from total probability. Some questions, like Exercise 13.3 Q1, ask only for P(A).
Why is the chance so small in the medical test examples?
When a disease is rare, the healthy group is huge, so even a small false-positive rate produces more false positives than true ones. In Exercise 13.3 Q5 only 22 out of every 133 positive results belong to people who have the disease.
Do I always need a tree diagram?
No, the formula is enough. But a tree makes the numbers easy to place: first branches for the causes, then branches for the result. Products along the branches give each P(Eᵢ) P(A|Eᵢ).
Stuck on a question?
Take a photo and Lagnever AI explains it step by step. Try it for 7 days for ₹2.
Get it on Google Play Open in browser
For parents: after the trial, the plan renews monthly by UPI or card autopay. You can cancel anytime in the app.