Science & Engineering

Hypergeometric Distribution Calculator (Without Replacement)

The hypergeometric distribution gives the chance of drawing k successes in n picks when you do not put items back. Enter the population, successes, draws, and target to get the full probability set.

Reviewed and updated

How to use
  1. Enter the population size N and the number of successes K in it.
  2. Enter how many you draw (n) and your target count of successes (k).
For study and estimation. Verify against authoritative data before relying on a result.
Was this helpful?

Drawing without replacement, exactly

The hypergeometric distribution gives the probability of getting k successes when you draw n items from a population of N that holds K successes — and each item is drawn once and kept. Because you do not put items back, the odds shift with every draw, which is the whole reason it differs from the binomial.

P(X = k) = C(K, k) × C(N−K, n−k) ÷ C(N, n)

Read it as: ways to pick k successes from the K available, times ways to pick the remaining n−k draws from the N−K failures, divided by every way to pick n from N. C(a, b) is the binomial coefficient "a choose b".

A worked example — 2 hearts in a 5-card hand

Deal 5 cards from a standard deck and ask for exactly 2 hearts. Here N=52, K=13 hearts, n=5, k=2.

P = C(13, 2) × C(39, 3) ÷ C(52, 5) = 78 × 9139 ÷ 2,598,960 = 0.2743

So about a 27.4% chance. Note the odds of a heart start at 13/52 and drop after each heart you draw — a binomial would wrongly hold them at 25% throughout.

Hypergeometric vs binomial, side by side

HypergeometricBinomial
SamplingWithout replacementWith replacement
PopulationFinite (N)Infinite / constant p
Success oddsChange every drawFixed at p
Meann × K / Nn × p
Best forSmall draws from a fixed groupIndependent repeated trials

Common uses: quality control (defects in an inspected batch), card and lottery odds, and mark-and-recapture population estimates in ecology.

The mean and the finite-population correction

  • Expected successes. The mean is n × K / N — draw 5 cards and you expect 5 × 13/52 = 1.25 hearts.
  • Achievable range. k cannot exceed the smaller of n and K, and cannot be below n − (N−K); outside that range the probability is exactly 0.
  • Tighter spread. The variance carries a factor of (N−n)/(N−1), the finite-population correction, which makes the hypergeometric less spread out than the matching binomial.

Common questions

When do I use the hypergeometric distribution instead of the binomial?

Use hypergeometric when you draw without replacement from a fixed, finite group, so each draw changes the odds for the next one. Use binomial when the probability of success stays constant on every trial, which is what replacing the item (or an effectively infinite population) does.

What do N, K, n and k mean?

N is the total population, K is how many successes it contains, n is how many items you draw, and k is how many of those draws you want to be successes. A deck of 52 cards with 13 hearts, dealt 5, asking for 2 hearts, is N=52, K=13, n=5, k=2.

When can I just use the binomial as an approximation?

When your sample is under about 5% of the population (n divided by N is below 0.05). At that point removing items barely shifts the odds, so binomial and hypergeometric answers nearly match and the binomial is easier to compute.

From the blog

Guides & how-tos

All articles →