Total probability theorem — solve using partition of sample space

medium CBSE JEE-MAIN JEE Main 2023 3 min read

Question

A factory has three machines M1M_1, M2M_2, and M3M_3 that produce 30%, 45%, and 25% of total output respectively. The defective rates for each machine are 2%, 3%, and 5%. A randomly selected item is found to be defective. Find the probability that it was produced by machine M2M_2.

(JEE Main 2023, similar pattern — uses both total probability and Bayes’ theorem)


Solution — Step by Step

Let EiE_i = event that the item comes from machine MiM_i, and DD = event that item is defective.

P(E1)=0.30P(E_1) = 0.30, P(E2)=0.45P(E_2) = 0.45, P(E3)=0.25P(E_3) = 0.25

P(DE1)=0.02P(D|E_1) = 0.02, P(DE2)=0.03P(D|E_2) = 0.03, P(DE3)=0.05P(D|E_3) = 0.05

The machines form a partition of the sample space (every item comes from exactly one machine). By the total probability theorem:

P(D)=P(E1)P(DE1)+P(E2)P(DE2)+P(E3)P(DE3)P(D) = P(E_1)P(D|E_1) + P(E_2)P(D|E_2) + P(E_3)P(D|E_3) =0.30×0.02+0.45×0.03+0.25×0.05= 0.30 \times 0.02 + 0.45 \times 0.03 + 0.25 \times 0.05 =0.006+0.0135+0.0125=0.032= 0.006 + 0.0135 + 0.0125 = 0.032
P(E2D)=P(E2)P(DE2)P(D)=0.45×0.030.032=0.01350.032P(E_2|D) = \frac{P(E_2)P(D|E_2)}{P(D)} = \frac{0.45 \times 0.03}{0.032} = \frac{0.0135}{0.032} =135320=2764=0.421875= \frac{135}{320} = \frac{27}{64} = \mathbf{0.421875}

The probability that the defective item came from M2M_2 is 276442.2%\dfrac{27}{64} \approx 42.2\%.


Why This Works

The total probability theorem breaks a complex probability into simpler conditional pieces. We do not know P(D)P(D) directly, but we know the defect rate for each machine. The theorem sums up the contributions from all sources.

Bayes’ theorem then “reverses” the conditioning: given that the item IS defective, which machine most likely produced it? Even though M3M_3 has the highest defect rate (5%), M2M_2 is more likely to be the source because it produces the most items (45% of output).

This “prior times likelihood” reasoning is the foundation of Bayesian statistics — a scoring topic in JEE.


Alternative Method

Work with actual numbers instead of probabilities. Assume 10,000 items produced:

  • M1M_1: 3,000 items, 60 defective
  • M2M_2: 4,500 items, 135 defective
  • M3M_3: 2,500 items, 125 defective
  • Total defective: 320

P(E2D)=135/320=27/64P(E_2|D) = 135/320 = 27/64. Same answer, and the counting approach is more intuitive.

For JEE and CBSE, Bayes’ theorem problems almost always follow this factory/machine template. Identify the “sources” (machines, bags, boxes), their proportions, and their conditional probabilities. The calculation is mechanical after that.


Common Mistake

Students confuse P(DE2)P(D|E_2) with P(E2D)P(E_2|D). The first is the probability of a defect given it came from M2M_2 (= 0.03, given). The second is the probability it came from M2M_2 given it is defective (= 27/64, computed). These are very different numbers. Bayes’ theorem exists precisely to convert one into the other.

Want to master this topic?

Read the complete guide with more examples and exam tips.

Go to full topic guide →

Try These Next