Defective Items, Machine Shares and a Quick Test
A factory runs three machines A, B and C. In a day they make 1000 items: A makes 500, B makes 300 and C makes 200. Historical defect rates are 2% for A, 3% for B and 5% for C. At the end of the day an inspector finds one defective item. The production supervisor says: 'C has the highest defect rate, so C is the most likely source of this defective item.' The inspector also considers a quick test that is not part of the current record: it would flag 90% of truly defective items and falsely flag 5% of good items. Before recommending the test, the inspector wants to know whether the base-rate information changes the supervisor's conclusion and how the test would update the probability that a flagged item is defective.
1. Find the probability that the defective item came from each machine. Evaluate the supervisor's claim.
Read the worked answer
Let D be the event that an item is defective. Using the law of total probability,
P(D) = 0.5(0.02) + 0.3(0.03) + 0.2(0.05) = 0.010 + 0.009 + 0.010 = 0.029.
Then, by Bayes' theorem,
P(A | D) = 0.010 / 0.029 = 10/29 ≈ 0.3448, P(B | D) = 0.009 / 0.029 = 9/29 ≈ 0.3103, P(C | D) = 0.010 / 0.029 = 10/29 ≈ 0.3448.
The supervisor's claim is not correct. C has the highest defect rate, but C makes only 200 items, while A makes 500. The larger volume of A offsets its lower defect rate. In fact A and C are tied at about 34.5% each, with B at about 31.0%. The defective item is not most likely to have come from C alone.
2. Using the proposed test, compute the probability that an item is truly defective given that it is flagged. Compare this with the raw defect rate and explain the effect of the false-positive rate.
Read the worked answer
Let F be the event that the test flags an item. We are given P(F | D) = 0.90 and P(F | not D) = 0.05. Also P(D) = 0.029 and P(not D) = 0.971.
P(F) = P(F | D)P(D) + P(F | not D)P(not D) = 0.90(0.029) + 0.05(0.971) = 0.0261 + 0.04855 = 0.07465.
Then
P(D | F) = 0.0261 / 0.07465 ≈ 0.3496.
The raw defect rate is 2.9%, while a flagged item is defective about 35% of the time. The test does raise the probability substantially, but it does not make a flag a near-certain defect. Because most items are good, the 5% false-positive rate produces more false flags (about 4.86% of all items) than true flags (about 2.61%). The base rate and the false-positive rate both matter, so the inspector should not interpret a positive flag as proof of defect.