# Estimating population defects from a sample size

2 questions:

Question #1: I have a lot size of 240 and have drawn out a sample size of 20. Assuming I test the 20 units for go/no-go (i.e. it's binary, pass/fail) and I have Zero failures.....what is the probability that I have a bad unit (i.e. it would fail my go/no-go test) in the lot of 240?

Question #2 Say I have the same lot of 240 units. Assuming I want to be 80% confident that 95% of the units are good (i.e. they would pass the go/no-go test), what should my sample size be?

• Welcome to CV. Since you’re new here, you may want to take our tour, which has information for new users. Since this looks like homework (apologies if it's not), please add the [self-study] tag and read its wiki. Then tell us what you understand thus far, what you've tried & where you're stuck. We'll provide hints to help you get unstuck. Please make these changes as just posting your homework & hoping someone will do it for you is grounds for closing. If this is self-study rather than homework, let us know, and... it's still a good idea to show us what you've tried. Jan 23, 2020 at 15:50
• Thanks for the quick feedback. Actually, it's not homework. It real world problems I need to solve and I have no idea what I'm doing. I've explored sample testing via attributes as well as trying to understand whether or not the binomial distribution is applicable here. And to be honest, I'm just really not sure where to even start to answer my questions. Thanks again! Jan 23, 2020 at 16:00
• The only thing I can think of for the first one is Bayes stats. You have an unknown parameter - which is the true defect rate. Your sample has a 0 defect rate. Depending on the prior distribution of your defect rate, your posterior could be different shapes. But since your sample has a 0 defect rate, assuming uniform prior (since I have no other information about your prior), I would imagine your posterior estimate for defect rate is also 0. You can probably do the beta-binomial conjugate for this one if you don't know how to numerically do stuff. Jan 23, 2020 at 18:11
• Try starting on chapter 6 of Krushke's Bayesian book where you infer binomial probability. Jan 23, 2020 at 18:16
• And the second one, I can only think of trial/error finding a sample size that leads to a HDI that contains 80% of your data and where the tail boundary corresponds to 5% or greater defect rate. Maybe others have smarter methods. Jan 23, 2020 at 18:28