Screening for a Fault in a Production Line
An electronics factory uses two machines, A and B, to produce identical components. Machine A makes 60% of the daily output and machine B makes the remaining 40%. Historical records show that 2% of components from A are defective, while 5% from B are defective. A new automated inspection test is being trialled. The test is not perfectly reliable: it correctly identifies a defective component 90% of the time, but it also wrongly flags a non-defective component 3% of the time. A component is selected at random from the combined output and the inspection test flags it as defective. The production engineer wants to know how likely it is that the component actually came from machine B, because B is older and may need servicing. She also wants to estimate how many false alarms the test would generate in a typical day of 1,000 components, and whether the test is fit for purpose.
1. Calculate the probability that a randomly selected component is flagged by the test.
Read the worked answer
Let (A) = from machine A, (B) = from machine B, (D) = defective, (F) = flagged.
Given:
[
P(A)=0.60,; P(B)=0.40,; P(D\mid A)=0.02,; P(D\mid B)=0.05,
]
[
P(F\mid D)=0.90,\qquad P(F\mid \text{not }D)=0.03.
]
Break the flagged events into four cases:
- A and defective and flagged: (0.60\times0.02\times0.90=0.0108)
- A and non-defective and flagged: (0.60\times0.98\times0.03=0.01764)
- B and defective and flagged: (0.40\times0.05\times0.90=0.018)
- B and non-defective and flagged: (0.40\times0.95\times0.03=0.0114)
Add:
[
P(F)=0.0108+0.01764+0.018+0.0114=0.05784.
]
So about 5.78% of all components are flagged.
2. Given that a component is flagged, find the probability it came from machine B. Show the conditional probability calculation.
Read the worked answer
Use
[
P(B\mid F)=\frac{P(B\cap F)}{P(F)}.
]
From the previous task,
[
P(F)=0.05784.
]
The flagged components from B are either defective or non-defective:
[
P(B\cap F)=P(B\cap D\cap F)+P(B\cap \text{not }D\cap F)
=0.018+0.0114=0.0294.
]
Therefore
[
P(B\mid F)=\frac{0.0294}{0.05784}\approx 0.5083.
]
So, given that a component is flagged, there is about a 50.8% chance it came from machine B. Although B produces only 40% of output, its higher defect rate makes it slightly more likely to appear among flagged items.
3. Estimate the number of false alarms (non-defective components flagged) in 1,000 components, and evaluate whether the test is fit for purpose. Include a suggestion.
Read the worked answer
False alarms occur when a non-defective component is flagged. From the four cases:
[
P(\text{non-defective and flagged})=0.01764+0.0114=0.02904.
]
In 1,000 components, the expected number of false alarms is
[
1000\times0.02904\approx 29.
]
The expected number of true defects flagged is
[
1000\times(0.0108+0.018)=1000\times0.0288\approx 29.
]
So about half of all flagged items are false alarms. The test has a low positive predictive value: roughly 29 false positives versus 29 true positives. If wrongly rejecting good components is costly or disruptive, the test is not fit for purpose as a sole decision-maker. A sensible suggestion is to improve the specificity of the test, or to use a second confirmatory test on flagged items before scrapping or reworking them. The engineer should also compare the cost of false alarms with the cost of missed defects.