Drawing without replacement
The hypergeometric distribution gives the probability of drawing a certain number of “successes” when you take a sample without replacement from a finite population. Each draw changes what is left, so the draws are not independent.
The variables
- N: population size (52 cards)
- K: number of successes in the population (4 aces)
- n: number of draws (5 cards)
- k: number of successes drawn (1 ace)
The formula
P(X = k) = C(K, k) × C(N − K, n − k) ÷ C(N, n)
where C(n, k) is the number of combinations of k items among n. The mean number of successes is n × K ÷ N.
Worked example
What is the chance of exactly one ace in a 5-card poker hand?
- Ways to choose 1 ace from 4: C(4, 1) = 4.
- Ways to choose the other 4 cards from 48 non-aces: C(48, 4) = 194,580.
- Total hands: C(52, 5) = 2,598,960.
- P(X = 1) = 4 × 194,580 ÷ 2,598,960 ≈ 29.95%.
- P(X ≥ 1), at least one ace: ≈ 34.12%.
- Average number of aces in a hand: 5 × 4 ÷ 52 ≈ 0.38.
Other uses
- Quality control: a batch of 500 parts contains 10 defective ones. If you inspect 20, what is the chance of finding none? N = 500, K = 10, n = 20, k = 0 gives about 66%.
- Lotteries: in a 6 of 49 game, the chance of matching exactly 3 numbers is C(6, 3) × C(43, 3) ÷ C(49, 6) ≈ 1.77%.
- Card games: the chance of drawing a needed card in collectible card games, where decks are small and every draw counts.
- Ecology: capture-recapture estimates of animal populations.
- Genetics: Fisher’s exact test for 2 × 2 tables is built on the hypergeometric distribution.
Hypergeometric or binomial?
The binomial distribution assumes each draw has the same probability, as when sampling with replacement. When the sample is small compared with the population, under about 5% of it, the two give almost the same answer and the binomial is simpler. When the sample is a large share of the population, use the hypergeometric distribution.
Limits of this calculator
The number of draws is limited to 30 so that the cumulative probabilities can be added up exactly.