haya.Learning made clear
Unit XIII · Probability
12 min readConcept sheetOften a 4-mark case-based or 5-mark question; also a JEE favourite

Bayes' theorem

Bayes' theorem finds the probability of a cause after seeing the result: P(Eᵢ|A) = P(Eᵢ)P(A|Eᵢ)/P(A), with P(A) from total probability.

Bayes' theoremP(Eᵢ|A) = P(Eᵢ)P(A|Eᵢ) / [P(E₁)P(A|E₁) + P(E₂)P(A|E₂) + ... + P(Eₙ)P(A|Eₙ)]
Prior probabilitiesP(Eᵢ), known before the experiment
Posterior probabilitiesP(Eᵢ|A), revised after A is seen; over a partition they add up to 1
Also calledThe formula for the probability of causes

Statement and proof

Let E₁, E₂, ..., Eₙ be a partition of S, and A any event with P(A) ≠ 0.

  1. 1
    Definition: P(Eᵢ|A) = P(A ∩ Eᵢ)/P(A).
  2. 2
    Multiplication theorem: P(A ∩ Eᵢ) = P(Eᵢ) P(A|Eᵢ).
  3. 3
    Total probability: P(A) = P(E₁)P(A|E₁) + P(E₂)P(A|E₂) + ... + P(Eₙ)P(A|Eₙ).
  4. 4★
    So, P(Eᵢ|A) = P(Eᵢ)P(A|Eᵢ) / Σ P(Eⱼ)P(A|Eⱼ), summed over j = 1 to n.

★ key step

Method, and how to draw the tree

  • Name the causes E₁, E₂, ... (machines, bags, groups) and the result A.
  • Draw a tree: the first branches carry the priors P(Eᵢ); the second branches carry P(A|Eᵢ).
  • Multiply along each branch to get P(Eᵢ)P(A|Eᵢ).
  • Add all the branches ending in A to get P(A), the denominator.
  • Divide the branch you want by P(A). That is the posterior P(Eᵢ|A).

Example 1: which machine?

Problem

Machines X, Y and Z make 50%, 30% and 20% of the bolts, with 2%, 3% and 4% defective. A bolt is found defective. Find the probability that it came from each machine.

Working
  1. By total probability, P(D) = 0.010 + 0.009 + 0.008 = 0.027.
  2. P(X|D) = 0.010/0.027 = 10/27
  3. P(Y|D) = 0.009/0.027 = 9/27 = 1/3
  4. P(Z|D) = 0.008/0.027 = 8/27
  5. Check: 10/27 + 9/27 + 8/27 = 1
Answer

P(X|D) = 10/27, P(Y|D) = 1/3, P(Z|D) = 8/27.

Example 2: a screening test

Problem

A disease affects 1% of a town. A test is positive for 95% of people who have it, and also for 5% of people who do not (example values). A person tests positive. Find the probability that the person has the disease.

Working
  1. E₁: has the disease, P(E₁) = 0.01. E₂: does not, P(E₂) = 0.99.
  2. A: tests positive. P(A|E₁) = 0.95 and P(A|E₂) = 0.05.
  3. Numerator: 0.01 × 0.95 = 0.0095
  4. Denominator: 0.0095 + 0.99 × 0.05 = 0.0095 + 0.0495 = 0.059
  5. P(E₁|A) = 0.0095/0.059 = 95/590 = 19/118
Answer

19/118, about 0.16 (rounded to 2 decimal places). Most positive results here are false alarms, because the disease is rare.

Example 3: which bag?

Problem

Bag I has 4 green and 2 white marbles; Bag II has 3 green and 5 white. A coin decides the bag, and a green marble is drawn. Find the probability that it came from Bag I.

Working
  1. P(I) = P(II) = 1/2; P(G|I) = 2/3 and P(G|II) = 3/8
  2. P(G) = 1/3 + 3/16 = 25/48, by total probability
  3. P(I|G) = (1/2 × 2/3)/(25/48) = (1/3)/(25/48)
  4. = (16/48) ÷ (25/48) = 16/25
Answer

P(Bag I | green) = 16/25.

P(A|Eᵢ) vs P(Eᵢ|A)

P(A|Eᵢ), the likelihoodThe chance of the result given the cause, e.g. P(positive | disease) = 0.95. Usually given in the question.
P(Eᵢ|A), the posteriorThe chance of the cause given the result, e.g. P(disease | positive). This is what Bayes' theorem finds.

Mixing these up is the most common error: in Example 2 they are 0.95 and about 0.16.

In real life

Doctors use this reasoning when a screening test for TB or diabetes is positive: the chance of really having the disease depends on how common it is, not only on how accurate the test is. That is why a second test is often advised.

Exam angle

1 marks: “In Bayes' theorem, what is P(Eᵢ|A) called?” The posterior probability of Eᵢ.

3 marks: “In a college, 70% of students are day scholars and 30% are hostellers. 20% of day scholars and 60% of hostellers own a bicycle. A student with a bicycle is chosen. Find the probability that the student is a hosteller.” P(B) = 0.7 × 0.2 + 0.3 × 0.6 = 0.14 + 0.18 = 0.32. P(H|B) = 0.18/0.32 = 9/16.

5 marks: “In a school, 30% of Class 12 students take science, 45% commerce and 25% humanities. The chances of scoring above 90% are 0.2, 0.1 and 0.12. A student scored above 90%. Find the probability that the student is from science.” P(A) = 0.3 × 0.2 + 0.45 × 0.1 + 0.25 × 0.12 = 0.06 + 0.045 + 0.03 = 0.135. P(Science|A) = 0.06/0.135 = 4/9.

Remember it

Bayes = my branch ÷ all the branches.