The Hypergeometric Distribution
The distribution for counting successes when you sample without replacement from a finite pool — the honest version of the binomial once each draw changes the odds for the next. It powers card problems, quality inspection, and Fisher's exact test.
Prerequisites: The Binomial Distribution, Counting: Permutations and Combinations
The hypergeometric distribution shows up whenever you reach into a finite pile and grab a handful without putting anything back. Deal five cards from a deck and count the aces; pull ten parts off a shipment and count the defects; audit twelve of a hundred trades and count the errors. Each item you remove changes what's left, so the odds shift with every draw, and that shifting is exactly what separates the hypergeometric from its more famous cousin, the The Binomial Distribution.
Set up the pool with three numbers: items in total, of which are "successes" (aces, defects, whatever you're counting), and you draw a sample of size . The probability of getting exactly successes is a ratio of counting numbers:
Read it as: (ways to pick of the successes) times (ways to pick the remaining from the non-successes), divided by (ways to pick any from all ). It's pure Counting: Permutations and Combinations: favourable arrangements over total arrangements.
With replacement or without: binomial vs hypergeometric
The single question that decides which model you need is: does each draw put the item back? Same experiment, one word of difference, two distributions.
| Binomial | Hypergeometric | |
|---|---|---|
| Sampling | with replacement (or infinite pool) | without replacement (finite pool) |
| Draw-to-draw odds | fixed at every time | shift after each draw |
| PMF | ||
| Mean | ||
| Variance |
Notice the means match if you read : on average, the fraction of successes in your sample equals the fraction in the pool, replacement or not. The variance is where they part company.
The choice is one word: with replacement is binomial, without replacement is hypergeometric. Their means agree ( with ), but the hypergeometric's variance is smaller by the finite-population factor .
The finite-population correction
That extra factor in the variance is the finite-population correction, and it's always at most 1, so sampling without replacement is less variable than sampling with. The intuition: once you've drawn most of a small pool, there's little left to be surprised by, in the extreme, if you draw the entire pool () the correction is zero and you know the count exactly. When the pool is huge relative to your sample ( far bigger than ), the correction is nearly 1 and the hypergeometric becomes indistinguishable from the binomial. That's why "with replacement" is a fine approximation when you're sampling a tiny slice of a big population.
When the pool dwarfs the sample (), stop reaching for factorials, the hypergeometric collapses into a The Binomial Distribution with . Polling 1,000 people out of millions? Binomial is exact enough.
Worked example
A shipment has items, of which are defective. A quality inspector pulls at random, without replacement. What's the chance exactly 2 of the 4 are defective?
Compute each piece: (ways to choose 2 defectives from 5), (ways to choose 2 good ones from 15), and (total ways to choose any 4). So
About a 22% chance of catching exactly two defects. And the expected number of defects in the sample is , the same one-quarter defect rate as the shipment, scaled to four draws.
Don't use the binomial here. With only 20 items, treating the draws as independent (each defective with probability 0.25) overstates the spread, it ignores that pulling a defect leaves fewer defects behind. Small pools demand the finite-population correction.
Where you'll meet it
- Card and lottery problems. "Probability of exactly two aces in a five-card hand" is textbook hypergeometric.
- Quality control and auditing. Inspecting a finite batch without replacement is its native habitat.
- Fisher's exact test. The p-value for a contingency table is computed from hypergeometric probabilities, the small-sample alternative to a chi-squared test.
The hypergeometric completes the counting family: it's the without-replacement partner of the The Binomial Distribution, built entirely from Counting: Permutations and Combinations, and it sits alongside the The Negative Binomial Distribution and the rest of the Common Distributions every quant should recognise on sight.
Related concepts
Practice in interviews
Further reading
- Blitzstein & Hwang, Introduction to Probability, ch. 3
- Ross, A First Course in Probability