The hypergeometric distribution gives the probability of drawing exactly items of a certain kind when you take items without replacement from a population of items, of which have that feature. It answers questions such as: how likely is a five-card hand to hold two spades, how many winning numbers will a lottery ticket match, or what is the chance that a sample of 10 parts from a lot of 100 contains no defective part.
The difference from the binomial distribution is that each draw changes what is left. After a spade is dealt, there are fewer spades in the deck, so the draws are not independent. When the sample is small compared with the population, the two models give almost the same answer; when the sample is a large share of the population, only the hypergeometric model is correct.
Enter , , and to get , the cumulative probabilities , , and , the mean, variance, standard deviation and the most likely value, plus a chart and a table of every possible outcome. The calculator works with exact ratios between neighbouring terms instead of huge factorials, so populations of millions are handled without overflow.
How to use this calculator
- Population size N: the total number of items (52 cards, 49 lottery balls, 100 parts in a lot).
- Successes in the population K: how many of them have the feature you count (13 spades, 6 winning numbers, 5 defective parts).
- Number of draws n: the sample size, drawn without putting items back.
- Successes in the sample k: the count you are asking about.
Read at the top. "At least" questions, like "at least one defective", use . The table lists every possible with its exact and cumulative probabilities; values outside the support (for example more spades than cards drawn) have probability 0.
The formula
The numerator counts the ways to choose successes among and failures among ; the denominator counts all possible samples of size . The factor is the finite population correction: the variance is smaller than the binomial variance because sampling without replacement removes uncertainty. The mode is .
Worked example
Cards. Deal 5 cards from a standard 52-card deck that contains 13 spades (, , ).
- Exactly 2 spades: 0.2743 (27.4%).
- At least one spade: 0.7785.
- Expected number of spades: 1.25.
Quality control. A lot of 100 parts contains 5 defective ones. An inspector takes 10 parts without replacement (, , ).
- No defective part in the sample: 0.5838 (58.4%).
- Two or more defective parts: 0.0769.
With replacement, the binomial model would give 0.5987 for the first question: close, but not identical, because 10 % of the lot is sampled.
Hypergeometric or binomial?
Use the hypergeometric model whenever the population is finite and items are not put back: card games, lotteries, audits, acceptance sampling, capture–recapture estimates of animal populations, and gene-set enrichment tests (Fisher's exact test is built on this distribution). The binomial distribution with is a convenient approximation when the sample is less than about 5 % of the population. In the example above, sampling 10 out of 100 is 10 %, and the gap between the two answers is visible in the third decimal.
Frequently asked questions
What does "without replacement" mean?
Each item drawn is kept out, so it cannot be drawn again and the composition of what remains changes after every draw. Dealing cards and drawing lottery balls work this way.
How do I calculate the probability of at least one success?
Use the complement: P(X ≥ 1) = 1 − P(X = 0). For one spade or more in a five-card hand, that is 1 − C(39, 5)/C(52, 5). The calculator shows it directly as P(X ≥ k) with k = 1.
When can I use the binomial distribution instead?
When the sample is small compared with the population, roughly n ≤ 5 % of N. Draws then barely change the proportion of successes, and the binomial with p = K/N gives nearly the same result.
Why do some values of k have probability 0?
k cannot exceed the number of draws or the number of successes available, and it cannot be smaller than n − (N − K), the minimum forced when there are not enough failures to fill the sample.
How are the lottery odds computed with this distribution?
In a 6-out-of-49 lottery, N = 49, K = 6 winning numbers and n = 6 numbers on your ticket. Matching all six has probability 1/C(49, 6) = 1 in 13,983,816; matching exactly three is C(6, 3) × C(43, 3)/C(49, 6) ≈ 0.0177.
Sources
- OpenStax, Introductory Statistics 2e, §4.5 Hypergeometric distribution
- W. Feller, An Introduction to Probability Theory and Its Applications, Vol. 1, 3rd ed. (Wiley), §II.6 The hypergeometric distribution
Last updated: