Question
In a factory, machines A, B and C produce 25%, 35% and 40% of the total bolts respectively. Of the bolts produced, 5%, 4% and 2% are defective from A, B and C respectively. A bolt is drawn at random and found defective. What is the probability it was made by machine A?
Solution — Step by Step
Let A, B, C be the events that a bolt is from machine A, B, C. Let D be the event that a bolt is defective.
Given: P(A)=0.25, P(B)=0.35, P(C)=0.40.
P(D∣A)=0.05, P(D∣B)=0.04, P(D∣C)=0.02.
P(A∣D)=P(D∣A)P(A)+P(D∣B)P(B)+P(D∣C)P(C)P(D∣A)P(A)
P(D∣A)P(A)=0.05×0.25=0.0125
P(D∣B)P(B)=0.04×0.35=0.014
P(D∣C)P(C)=0.02×0.40=0.008
P(D)=0.0125+0.014+0.008=0.0345
P(A∣D)=0.03450.0125=345125=6925
Final answer: P(A∣D)=6925 (approximately 0.362).
Why This Works
Bayes’ theorem flips conditional probabilities. We knew P(defect∣machine A), but the question asks P(machine A∣defect). The theorem gives us the reverse using the law of total probability for the denominator.
A useful sanity check: P(A∣D)+P(B∣D)+P(C∣D) must equal 1. Computing P(B∣D)=0.014/0.0345=28/69 and P(C∣D)=16/69, we get 25+28+16=69 ✓.
Alternative Method
Imagine 1000 bolts. Machine A produces 250, of which 5% (12.5) are defective. Machine B: 350×4%=14 defective. Machine C: 400×2%=8 defective. Total defective: 34.5. Of these, machine A made 12.5, so P(A∣D)=12.5/34.5=25/69. Same answer, no theorem needed.
Common Mistake
Computing P(A∣D) as just P(D∣A)=0.05 — confusing direction of conditioning. P(D∣A) asks “given the bolt is from A, is it defective?”. P(A∣D) asks “given the bolt is defective, did it come from A?”. They are very different, and Bayes’ theorem is the bridge.