Subject: Class 12 Mathematics Chapter: Bayes Theorem Topic: 14.5 Bayes Theorem – Solve probability problems using Bayes theorem
Bayes theorem is one of the most celebrated results in probability theory. While the total probability theorem computes the probability of an effect from the probabilities of its causes, Bayes theorem reverses the question: given that an effect has been observed, what is the probability that a particular cause was responsible? This reverse or posterior probability is exactly what doctors, engineers and data scientists need when interpreting test results, diagnosing diseases, or filtering spam messages.
The theorem derives its name from the Reverend Thomas Bayes, who published the result in the eighteenth century. In everyday terms, Bayes theorem tells us how to update our beliefs in the light of new evidence. For example, a screening test for a rare disease may be highly accurate, yet a positive result may still be quite unlikely to mean the disease is present, because the number of false positives among healthy people can dominate the number of true positives. Bayes theorem quantifies precisely how much weight the evidence carries.
In this section we state Bayes theorem, explain its connection to the total probability theorem, and solve a series of carefully worked examples involving boxes, bags, coins, diseases and machines. We also present a reliable three-step strategy for applying the theorem and point out the common mistakes that cost marks in examinations. Bayes theorem is often the highest-weight question in the probability chapter, so a systematic approach is essential.
Let E1, E2, ..., En be a partition of the sample space S, and let A be an event with P(A) > 0. Bayes theorem gives the probability that Ei occurred, given that A has already occurred.
Theorem: P(Ei|A) = [P(Ei) × P(A|Ei)] / [P(E1)P(A|E1) + P(E2)P(A|E2) + ... + P(En)P(A|En)].
Justification: From the definition of conditional probability, P(Ei|A) = P(Ei ∩ A)/P(A). Using the multiplication theorem, P(Ei ∩ A) = P(Ei) × P(A|Ei). By the total probability theorem, P(A) = Σ P(Ej)P(A|Ej). Substituting both expressions gives the stated formula.
Key points to remember: - P(Ei) is called the prior probability and P(Ei|A) the posterior probability. - The denominator is exactly the total probability of A, so it is the same for every Ei. - The theorem applies only when E1, E2, ..., En form a partition of the sample space. - The roles of the events cannot be swapped; P(Ei|A) and P(A|Ei) are different quantities.
Worked Example 1: Bag I contains 4 white and 6 black balls, and bag II contains 5 white and 5 black balls. A bag is chosen at random and a ball is drawn, which is found to be white. Find the probability that it came from bag I.
Step 1: Let E1 = {bag I}, E2 = {bag II}. P(E1) = P(E2) = 1/2. Step 2: P(white|E1) = 4/10 = 2/5 and P(white|E2) = 5/10 = 1/2. Step 3: P(white) = (1/2)(2/5) + (1/2)(1/2) = 1/5 + 1/4 = 9/20. Step 4: P(E1|white) = [(1/2)(2/5)] / (9/20) = (1/5) ÷ (9/20) = 4/9.
Worked Example 2: A die is thrown. If it shows 1, a ball is drawn from box I containing 2 white and 3 black balls; otherwise from box II containing 4 white and 1 black ball. A white ball is drawn. Find the probability that the die showed 1.
Step 1: E1 = {die shows 1}, P(E1) = 1/6; E2 = {die does not show 1}, P(E2) = 5/6. Step 2: P(white|E1) = 2/5 and P(white|E2) = 4/5. Step 3: P(white) = (1/6)(2/5) + (5/6)(4/5) = 2/30 + 20/30 = 22/30 = 11/15. Step 4: P(E1|white) = [(1/6)(2/5)] ÷ (11/15) = (1/15) ÷ (11/15) = 1/11.
Bayes problems look intimidating but become mechanical with a fixed strategy. The following three steps work for every standard examination question.
Step 1: Identify the partition events E1, E2, ..., En, which are the "causes", and write their prior probabilities P(Ei). Verify that they are mutually exclusive and exhaustive.
Step 2: Identify the observed event A, which is the "effect", and write the conditional probabilities P(A|Ei) for every part of the partition. Do not omit any part.
Step 3: Apply the formula P(Ei|A) = [P(Ei)P(A|Ei)] / Σ P(Ej)P(A|Ej), simplifying the fraction to its lowest terms.
Key points to remember: - The partition events represent the possible sources or causes of the observed outcome. - The event A is always the one that has actually occurred or been observed. - Compute the denominator completely before attempting to simplify. - Use a tree diagram to record priors and conditionals for multi-stage problems.
Worked Example 3: In a school, 30% of the students are in group X and 70% in group Y. In group X, 80% pass the final exam, while in group Y, 90% pass. A student is chosen at random and is found to have passed. Find the probability that the student belongs to group X.
Step 1: P(X) = 0.3, P(Y) = 0.7. Step 2: P(pass|X) = 0.8, P(pass|Y) = 0.9. Step 3: P(pass) = (0.3)(0.8) + (0.7)(0.9) = 0.24 + 0.63 = 0.87. Step 4: P(X|pass) = 0.24 / 0.87 = 24/87 = 8/29.
Worked Example 4: Three machines M1, M2, M3 produce 50%, 30% and 20% of the items in a factory, with defective percentages 3, 4 and 5 respectively. An item selected at random is found defective. Find the probability that it came from machine M1.
Step 1: P(M1) = 0.5, P(M2) = 0.3, P(M3) = 0.2. Step 2: P(D|M1) = 0.03, P(D|M2) = 0.04, P(D|M3) = 0.05. Step 3: P(D) = 0.015 + 0.012 + 0.010 = 0.037. Step 4: P(M1|D) = 0.015 / 0.037 = 15/37.
Let us apply the strategy to more challenging problems, including the classical disease-testing and truth-teller questions.
Worked Example 5: A person tells the truth 3 out of 4 times. A die is thrown and the person reports that a 6 appeared. Find the probability that 6 actually appeared.
Step 1: E = {6 appeared}, P(E) = 1/6; E′ = {6 did not appear}, P(E′) = 5/6. Step 2: P(reports 6|E) = 3/4; P(reports 6|E′) = 1/4. Step 3: P(reports 6) = (1/6)(3/4) + (5/6)(1/4) = 3/24 + 5/24 = 1/3. Step 4: P(E|reports 6) = [(1/6)(3/4)] ÷ (1/3) = (1/8) ÷ (1/3) = 3/8.
Worked Example 6: A disease affects 1% of a population. A test detects the disease with probability 0.9 when it is present and gives a false positive with probability 0.05 when it is absent. Find the probability that a person who tests positive actually has the disease.
Step 1: P(D) = 0.01, P(D′) = 0.99. Step 2: P(+|D) = 0.9, P(+|D′) = 0.05. Step 3: P(+) = (0.01)(0.9) + (0.99)(0.05) = 0.009 + 0.0495 = 0.0585. Step 4: P(D|+) = 0.009 / 0.0585 = 90/585 = 2/13.
Worked Example 7: Bag I has 3 red and 4 black balls, bag II has 5 red and 6 black balls. A ball is transferred from bag I to bag II, then a ball is drawn from bag II which is found to be red. Find the probability that the transferred ball was red.
Step 1: Let R = {transferred ball is red}, B = {transferred ball is black}. P(R) = 3/7, P(B) = 4/7. Step 2: If red transferred, bag II has 6 red and 6 black, so P(drawn red|R) = 6/12 = 1/2. If black transferred, bag II has 5 red and 7 black, so P(drawn red|B) = 5/12. Step 3: P(drawn red) = (3/7)(1/2) + (4/7)(5/12) = 3/14 + 20/84 = 3/14 + 5/21 = 9/42 + 10/42 = 19/42. Step 4: P(R|drawn red) = (3/14) ÷ (19/42) = (3/14)(42/19) = 9/19.
Worked Example 8: A company receives 40% of its supply from supplier A and 60% from supplier B. A is reliable with 95% good items and B with 98% good items. A randomly checked item is found good. Find the probability that it came from supplier A.
Step 1: P(A) = 0.4, P(B) = 0.6. Step 2: P(good|A) = 0.95, P(good|B) = 0.98. Step 3: P(good) = (0.4)(0.95) + (0.6)(0.98) = 0.38 + 0.588 = 0.968. Step 4: P(A|good) = 0.38 / 0.968 = 380/968 = 95/242.
Worked Example 9: A box contains two coins: one fair and one two-headed. A coin is chosen at random and tossed; it shows heads. Find the probability that the two-headed coin was chosen.
Step 1: P(F) = 1/2, P(T) = 1/2. Step 2: P(heads|F) = 1/2, P(heads|T) = 1. Step 3: P(heads) = (1/2)(1/2) + (1/2)(1) = 1/4 + 1/2 = 3/4. Step 4: P(T|heads) = (1/2) ÷ (3/4) = 2/3.
Worked Example 10: Two groups take a test. Group 1 has 2/5 of the candidates with a 3/4 pass rate, and group 2 has 3/5 of the candidates with a 1/2 pass rate. A passed candidate is selected. Find the probability that the candidate belongs to group 1.
Step 1: P(G1) = 2/5, P(G2) = 3/5. Step 2: P(pass|G1) = 3/4, P(pass|G2) = 1/2. Step 3: P(pass) = (2/5)(3/4) + (3/5)(1/2) = 3/10 + 3/10 = 3/5. Step 4: P(G1|pass) = (3/10) ÷ (3/5) = 1/2.
| Term | Symbol | Meaning |
|---|---|---|
| Prior probability | P(Ei) | Probability of the cause before evidence |
| Likelihood | P(A | Ei) |
| Total probability | P(A) | Denominator, weighted sum of likelihoods |
| Posterior probability | P(Ei | A) |
| Bayes formula | P(Ei | A) = P(Ei)P(A |
| Problem | Partition priors | Likelihoods | Denominator P(A) | Posterior answer |
|---|---|---|---|---|
| White ball from two bags | 1/2, 1/2 | 2/5, 1/2 | 9/20 | 4/9 |
| Die showing 1 route | 1/6, 5/6 | 2/5, 4/5 | 11/15 | 1/11 |
| Three machines defective | 0.5, 0.3, 0.2 | 0.03, 0.04, 0.05 | 0.037 | 15/37 |
| Disease test positive | 0.01, 0.99 | 0.9, 0.05 | 0.0585 | 2/13 |
| Two-headed coin heads | 1/2, 1/2 | 1/2, 1 | 3/4 | 2/3 |
flowchart TD
A[Bayes Theorem] --> B[Prior probabilities]
A --> C[Likelihoods]
A --> D[Total probability denominator]
A --> E[Posterior probability]
B --> F[P of Ei for each cause]
C --> G[P of A given Ei]
D --> H[Sum of products]
E --> I[P of Ei given A]
F --> J[Partition must be exhaustive]
D --> K[Computed before dividing]
I --> L[Update belief after evidence]
Bayes theorem converts prior probabilities into posterior probabilities by combining each cause with its likelihood and normalizing through the total probability theorem. Its numerator is a single product while its denominator is the sum of all such products, so the theorem is really a weighted revision of belief after observing evidence. The three-step strategy of listing priors, listing likelihoods, and then dividing by the total probability makes even the most complex Bayes problem mechanical. Because Bayes theorem appears regularly as a long-answer question, a disciplined application of this formula is one of the surest ways to secure full marks in the probability chapter of Class 12.