# Sample size to determine if success proportion is zero

I have a lot of $N$ devices, and I'd like to know if any of them are faulty. What sample size do I need in order to make sure with $100(1-\alpha)\%$ confidence that none are faulty?

-

## 1 Answer

You are asking for the number $m$ to sample so that when one or more devices are faulty, there will be at least a $100(1-\alpha)$% chance that at least one faulty device is in the sample. You have to handle the worst case of just one faulty device. Assuming the sample is random without replacement, we have (by definition) that there are $\binom{N}{m}$ such samples and $\binom{N-1}{m}$ of them do not include the faulty device. Therefore you need to find the smallest $m$ for which

$$\alpha \ge \binom{N-1}{m} / \binom{N}{m} = 1-\frac{m}{N}.$$

The solution is to take $m$ to be any whole number equal to or exceeding $(1-\alpha)N$. In brief, if you want to be (say) 95% confident there are no faulty devices, then you have to sample 95% of the lot.

You would be better off using a sequential sampling procedure if you can: sample the devices one at a time, stopping as soon as a faulty one is found or $100(1-\alpha)$% of them are sampled. For typical high confidence levels, the cost of sampling $100(1-\alpha)$% is so close to the cost of sampling $100$% that it's not worthwhile stopping there; plan to sample them all if necessary.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 12, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9685922861099243, "perplexity_flag": "head"}