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?
Thanks in advance!!!!!!
 A: Sampling without replacement follows a hypergeometric distribution.    
Assuming you have a 5% defect rate.  The chances of drawing a passing part on the first pick is equal to 228/240 or 95%, now on the chances of drawing 2 passing parts is 228/240 * 227/239 or about 90% chance of happening.  If you continue this out for 20 picks, drawing all passing parts with a 5% defect rate will happen about 34% of the time.  Via trial and error with increasing the defect rate, when the defect rates approaches 16% then the chance of drawing 20 out of 20 passing parts drops below 5%. 
Thus my answer for question #1 is with 20 passes then the defect rate is <13.8% with 95% confidence.
For question #2, again performing the progressive hypergeometric calculations with additional draws.  With a 5% defect rate, one should be able to draw 29 out of 29 defect free parts, 80% of the time. 
Hope this provides some guidance moving forward.  See the Wiki article for more background information: https://en.wikipedia.org/wiki/Hypergeometric_distribution
