Hypergeometric Distribution Calculator

Hypergeometric distribution sample size calculator

–

Share of lot
–
Detection probability
–
Binomial estimate
–
Risk of missing
–

Detection probability by sample size

P(find more than c)Confidence target

Operating characteristic (OC) curve

Chance of accepting the lot (finding c or fewer defects) for each possible number of defects in it, using the required sample size.

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.

  1. Lot size NItems in the lot or population, up to 1,000,000.
  2. Defects DThe defect level to detect, for example 20 in 1,000 (2%).
  3. ConfidenceChance the sample catches the problem, for example 95%.
  4. Acceptance number cDefects allowed in the sample before rejection; usually 0.
  5. Binary search on nSmallest n with P(X ≤ c) ≤ 1 − confidence, plus OC curve.
How the hypergeometric distribution sample size calculator works

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.

P(accept)=ΣC(D, x)×C(N − D, n − x)÷C(N, n)≤1 − confidence
Binomial shortcut (infinite lot, c = 0): n = ln(1 − confidence) / ln(1 − D/N)
  • 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
Required sample sizes, hypergeometric vs binomial
Lot NDefects DConfidencecHypergeometric nBinomial n
502 (4%)95%03974
5005 (1%)95%0225299
1,00020 (2%)95%0138149
1,00010 (1%)99%0368459
100,0001,000 (1%)99%0458459

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.