Calculating the probability of zero defects in a batch of parts that has been partly inspected

544 Views Asked by At

This is a simplified version of a real-world problem, I'm happy to add more detail if needed to answer the question.

A batch of 800 parts has been manufactured and most (550) have been sold. It transpires that a critical test has been missed out during manufacture and so the possibility exists that some of the parts may be defective, but it is unknown how likely this is. All of the 250 parts that haven't been sold yet have been retrospectively tested and all have passed.

What is the probability that the whole batch contained no defective parts? How does this number change if more parts from the batch are recalled and tested?

I'm been researching this and my thinking is as follows. For example, suppose the defect rate is 0.01 (so the expected number of defects per 800 parts is 8). The probability of 0 defects in a batch of 800 is $(1-0.01)^{800} = 0.000322$. But, the process of inspecting is following the hypergeometric distribution (sampling without replacement), so the probability of 0 defects in 250 samples is $${\frac {{\binom {8}{0}}{\binom {800-8}{250-0}}}{\binom {800}{250}}} = 0.049116$$ So, can I say that finding 250 parts are good means there is a roughly 5% chance that the defect rate is 0.01, and therefore there is a 95% chance that the defect rate is lower than that? Or is this defective thinking?

If I can say I'm 95% sure the defect rate is 0.01 or lower, then with 550 parts out in the field there is a $(1-0.01)^{550}=0.003975$ probability of no defective parts. So I'm 95% sure there is a roughly 0.4% chance of zero defects

If the above is sound, I can adjust my supposed value of the defect rate to get different confidence figures, for example I'm 31% sure there's a 57% chance of zero defects.

This method runs into trouble though if the defect rate is very low - the formula for the hypergeometric distribution needs integers so if the expected number of defects is lower than 1 I can't estimate the probability. Presumably there's way round this - that's my next avenue to explore.