Hypergeometric Distribution Calculator
This hypergeometric distribution calculator works out the exact probability of drawing a chosen number of successes when you sample without replacement from a fixed, finite population, the situation where every draw changes the odds for the next one. You enter four numbers: the population size N, how many successes sit within that whole population K, the size of the sample you are drawing n, and the number of successes you actually want to see in that sample k. From those, the calculator returns P(X = k), the probability of getting exactly that many successes, alongside the expected number of successes for your sample size and a repeat of the k value you asked about, so you can check the result against what you set out to test. Unlike the binomial distribution, which assumes each draw is independent with a constant success probability, the hypergeometric distribution correctly accounts for the population shrinking as each item is removed, which makes it the right tool for problems like auditing a batch for defective units, working out card or lottery odds, and capture-recapture estimates in ecology. Below the calculator you will find the underlying combinatorial formula, a fully worked example you can use to check your own numbers, and the assumptions the calculation relies on, including that inputs are whole numbers within sensible limits and that the population is genuinely finite and fixed.
The formula
The hypergeometric probability is P(X = k) = C(K, k) times C(N minus K, n minus k), all divided by C(N, n), where N is the population, K the successes in it, n the sample size and k the observed successes. The expected number of successes is n times K over N.
Worked example
From a population of 10 with 5 successes, drawing a sample of 4, the chance of exactly 2 successes is C(5,2) times C(5,2) over C(10,4) = 100/210, about 0.476. Enter N=10, K=5, n=4, k=2 to confirm.
Frequently asked questions
When do I use the hypergeometric distribution?
For sampling without replacement from a finite population, where each draw changes the remaining proportions.
How is it different from the binomial?
The binomial assumes a constant success probability (sampling with replacement). The hypergeometric corrects for the shrinking population.
What is the expected number of successes?
n times K over N, the sample size times the proportion of successes in the population.
Who this calculator is for
This calculator is for statistics students, researchers and analysts.
What this calculator assumes
- You enter valid numbers.
- The standard formula is applied.
- Results are rounded for display.
Formula and sources
Related calculators
- Standard Deviation Calculator: spread of data.
- Z-Score Calculator: standard score.
- Mean Median Mode Calculator: averages.