Calculators
Hypergeometric Distribution Calculator
Calculate hypergeometric distribution probabilities for draws without replacement from a finite population, plus mean and variance, locally in your browser.
Model draws without replacement from a finite population.
The hypergeometric distribution models drawing n items at random without replacement from a finite population of N items that contains exactly K success states. X counts the success states among the drawn items, so P(X = k) = C(K, k) × C(N − K, n − k) ÷ C(N, n), the mean is nK ÷ N, and the variance is n × (K ÷ N) × ((N − K) ÷ N) × ((N − n) ÷ (N − 1)). For N = 20, K = 7, n = 12 and k = 4, the exact probability is about 0.357585, the mean is 4.2 and the variance is about 1.149474. X can only fall between max(0, n − (N − K)) and min(n, K); values outside that range have probability zero. Because each draw removes its item from the population, the chance of success changes after every draw; the binomial distribution instead assumes independent trials with a constant success probability, as when sampling with replacement or from a much larger population. Enter the population size N as a whole number from 1 to 1000000, the success states K from 0 to N, the draw count n from 1 to N, and the observed successes k from 0 to n; leading zeros and surrounding whitespace are accepted, while signs, decimals, separators and scientific notation are rejected. Probabilities use log-space binomial arithmetic with compensated summation so very large populations and draws stay accurate where naive calculation would drift, displayed to 12 significant digits; extremely small probabilities may round to zero. All calculations stay in your browser.
Frequently Asked Questions
Everything you need to know about this tool, how it works, and privacy.
What does X count?
X counts the success states among n items drawn at random without replacement from a population of N items containing exactly K success states. Its smallest possible value is max(0, n − (N − K)) and its largest is min(n, K).
How does this differ from the binomial distribution?
The binomial distribution assumes independent trials with the same success probability on each trial, as with sampling with replacement. The hypergeometric distribution samples without replacement from a finite population, so each draw changes the remaining composition and the success chance.
When is this model suitable?
Use it for lotteries, card draws, quality-control batches, and other finite-population samples where each item is drawn at most once, such as drawing 12 chips from a bowl of 20 that holds 7 red ones. With replacement, or when the population is huge relative to the draw, the binomial distribution is a close approximation.
Are the results exact?
Results use floating-point arithmetic rounded to 12 significant digits. Probabilities use log-space binomial arithmetic with compensated summation so large populations and draws stay stable near zero or one; extremely small probabilities can round to zero. Inputs and calculations stay in your browser.