Bakery Defect Tracing and Batch Sampling
A bakery operates two production lines. Line A makes 60% of the daily output and has a 2% defect rate for cracked or underweight loaves. Line B makes 40% of the output and has a 5% defect rate. A loaf is chosen at random from the day's output and found defective. Separately, the quality manager uses an acceptance rule: draw 20 loaves from a batch and reject the batch if 2 or more are defective. A supplier claims that a particular batch has a 5% defect rate. The manager wants to know how often the rule would reject such a batch, and how many loaves would be needed to reject a 5% batch with 90% probability. Defects are assumed independent within a batch and the batch is large relative to the sample. Any defect traced to Line B triggers a calibration stop on that line.
1. Given that a randomly selected loaf is defective, what is the probability it came from Line B? Interpret the result for the calibration decision.
Read the worked answer
Let D be defective, A and B the lines. (P(A)=0.60), (P(B)=0.40), (P(D|A)=0.02), (P(D|B)=0.05). Total defect probability (P(D)=0.60(0.02)+0.40(0.05)=0.012+0.020=0.032). By Bayes, (P(B|D)=P(D|B)P(B)/P(D)=0.020/0.032=0.625). So 62.5% of defective loaves come from Line B, even though Line B makes only 40% of output. The manager should prioritize B for calibration, but not ignore A: 37.5% of defects still originate there.
2. For a batch with a 5% defect rate, what is the probability that the 20-loaf rule rejects it?
Read the worked answer
Let X be the defective count in 20, with p=0.05. Reject if X≥2. (P(X=0)=0.95^{20}=0.3585). (P(X=1)=\binom{20}{1}(0.05)(0.95^{19})=20(0.05)(0.3774)=0.3774). So (P(X\le1)=0.7359) and (P(X\ge2)=0.2641). The rule rejects only about 26.4% of 5%-defective batches; it passes about 73.6% of them. That is weak evidence of a well-performing acceptance rule if the goal is to catch a 5% batch.
3. How many loaves should be sampled so that a 5%-defective batch is rejected with at least 90% probability, assuming rejection on one or more defectives?
Read the worked answer
Need (P(X\ge1)\ge0.90) for a 5% batch, i.e. (1-0.95^n\ge0.90), so (0.95^n\le0.10). Take logs: (n\ln0.95\le\ln0.10). Since ln0.95=-0.05129 and ln0.10=-2.3026, (n\ge2.3026/0.05129=44.89). Thus n=45. Check: (0.95^{44}=0.1046), rejection 89.5%; (0.95^{45}=0.0994), rejection 90.1%. So 45 loaves are needed. This also shows the 20-loaf rule is far from the stated 90% detection goal.