How hypergeometric distribution sample size calculator works?
The hypergeometric distribution sample size calculator searches for the smallest sample n that finds more than c defects with the chosen confidence, using exact probabilities for sampling without replacement from a lot of N items.
- Lot size NItems in the lot or population, up to 1,000,000.
- Defects DThe defect level to detect, for example 20 in 1,000 (2%).
- ConfidenceChance the sample catches the problem, for example 95%.
- Acceptance number cDefects allowed in the sample before rejection; usually 0.
- Binary search on nSmallest n with P(X ≤ c) ≤ 1 − confidence, plus OC curve.
Hypergeometric distribution sample size formula
The hypergeometric sample size is the smallest n with Σx = 0c C(D, x) · C(N − D, n − x) / C(N, n) ≤ 1 − confidence. With c = 0, the condition becomes C(N − D, n) / C(N, n) ≤ 1 − confidence.
- C(D, x)Ways to draw x of the D defects, for x = 0 to c
- C(N − D, n − x)Ways to draw the other n − x items from the good items
- C(N, n)All possible samples of n items
- 1 − confidenceAllowed risk of missing the defects, for example 0.05
| Lot N | Defects D | Confidence | c | Hypergeometric n | Binomial n |
|---|---|---|---|---|---|
| 50 | 2 (4%) | 95% | 0 | 39 | 74 |
| 500 | 5 (1%) | 95% | 0 | 225 | 299 |
| 1,000 | 20 (2%) | 95% | 0 | 138 | 149 |
| 1,000 | 10 (1%) | 99% | 0 | 368 | 459 |
| 100,000 | 1,000 (1%) | 99% | 0 | 458 | 459 |
Hypergeometric distribution sample size calculator FAQ
How do you calculate the sample size with the hypergeometric distribution?
Find the smallest n for which P(X ≤ c) ≤ 1 − confidence, where X is the number of defects in a sample of n from a lot of N items holding D defects. The calculator searches n from c + 1 up to N with exact hypergeometric probabilities.
How many items must I inspect to find a defect with 95% confidence?
A lot of 1,000 items with 20 defects (2%) needs a sample of 138 items for a 95% chance of finding at least 1 defect. A lot of 500 items with 5 defects (1%) needs 225 items.
Why is the hypergeometric sample size smaller than the binomial one?
Sampling without replacement removes each checked item from the lot, so every draw raises the share of defects among the items left. The binomial formula n = ln(1 − confidence) / ln(1 − p) asks for 149 items in the 1,000-item lot and 299 items in the 500-item lot.
What is the acceptance number c?
The acceptance number c is the largest number of defects a sample can hold before the lot is rejected. c = 0 is a zero-acceptance plan. Raising c to 1 in the 1,000-item lot with 30 defects needs 147 items for 95% confidence.