Hypergeometric Distribution Calculator
Exact probabilities for sampling without replacement: drawing cards from a deck, inspecting units from a small batch, or matching lottery numbers. Enter the population, the successes it contains, and your sample to get P(X = k) and the cumulative probabilities.
Before You Calculate
- N is the whole population (52 cards, 50 units in the batch), K is how many of them count as successes (4 aces, 5 defective units).
- n is how many you draw, and k is how many successes you ask about.
- Use this instead of the binomial distribution whenever each draw changes the remaining pool — that is exactly what “without replacement” means.
Related Calculators
Binomial Distribution Calculator
Compute exact and cumulative binomial probabilities with mean, variance, and standard deviation.
Combination Calculator (nCr)
Count combinations exactly with big-integer nCr results, even for very large n.
Dice Probability Calculator
Find exact odds of rolling a dice sum exactly, at least, or at most a target value.
Learn More
Probability Distributions
Compare the binomial, Poisson, normal, uniform, and exponential distributions and learn how to choose the right model for counts, measurements, and waiting times.
Binomial vs Poisson vs Hypergeometric
Three questions decide the right counting distribution — fixed trials, independence, replacement — with one inspection scenario computed all three ways.
The Hypergeometric Formula
The probability of exactly k successes in the sample is a ratio of ways to choose:
P(X = k) = [C(K, k) × C(N − K, n − k)] / C(N, n)
Mean: μ = nK/N
Variance: σ² = n × (K/N)(1 − K/N) × (N − n)/(N − 1)
Where:
- N = population size, K = successes in the population
- n = sample size, k = successes in the sample
- C(a, b) = number of ways to choose b items from a
The numerator counts the samples containing exactly k of the K successes (and therefore n − k of the N − K non-successes); the denominator counts all possible samples of size n. Every draw is a plain count of equally likely hands, which is why the result is exact rather than an approximation. The combination calculator computes the individual C(a, b) terms if you want to verify by hand.
Hypergeometric vs Binomial: The Correction Factor
The mean is the same as the binomial's (np with p = K/N), but the variance carries the extra factor (N − n)/(N − 1), the finite population correction. It is less than 1 whenever you sample more than one item: each success drawn depletes the pool, pulling later draws toward fewer successes and shrinking the spread compared with independent draws.
When the sample is a small fraction of the population — a common working rule is n/N ≤ 0.05 — the correction is nearly 1 and the binomial with p = K/N is an excellent approximation. Sampling 10 units from a batch of 10,000 barely dents the pool; sampling 10 from 50 dents it badly, and the exact hypergeometric answer is then meaningfully different.
Worked Example: Acceptance Sampling
A batch of N = 50 units contains K = 5 defective ones. An inspector draws n = 10 units without replacement. What are the chances of finding defects?
- No defects: P(X = 0) = C(45, 10)/C(50, 10) ≈ 0.310563.
- Exactly one: P(X = 1) = [C(5, 1) × C(45, 9)]/C(50, 10) ≈ 0.431337.
- At least one: 1 − 0.310563 ≈ 0.689437 — the batch fails a zero-tolerance inspection about 69% of the time.
The summary reads mean = 10 × 5/50 = 1 defect per sample and variance 10 × 0.1 × 0.9 × 40/49 ≈ 0.7347 (SD ≈ 0.8571). Compare the binomial approximation with p = 0.1: it gives P(X = 0) = 0.9¹⁰ ≈ 0.3487 — noticeably off, because drawing 10 from 50 is a 20% bite of the population.
Frequently Asked Questions
When should I use the hypergeometric distribution instead of the binomial?
Use the hypergeometric whenever draws are made without replacement from a finite population, so each draw changes the composition of what remains: card hands, lottery matches, or inspecting a small batch. The binomial assumes every trial has the same success probability, which only holds with replacement or when the sample is a tiny fraction of the population (roughly n/N <= 5%).
What do the four inputs N, K, n, and k mean?
N is the total population size, K is how many members of that population are 'successes', n is how many you draw, and k is the number of successes in the draw you are asking about. For the chance of two aces in a five-card hand: N = 52, K = 4, n = 5, k = 2, giving about 0.0399.
What is the finite population correction?
It is the factor (N - n)/(N - 1) that multiplies the binomial variance. It reflects that sampling without replacement depletes the pool, making the count of successes less variable than independent draws would be. The correction vanishes (approaches 1) when the population dwarfs the sample and hits zero when you sample everything - at n = N the count is exactly K with no variability at all.
How do lottery odds come from this distribution?
Matching lottery numbers is sampling without replacement: the draw picks n balls from N, and your ticket marks K = n of them as 'successes'. In a 6-of-49 lottery, the chance of matching exactly 3 is [C(6,3) x C(43,3)]/C(49,6), about 1.77%, and the jackpot P(X = 6) is 1/C(49,6), one in 13,983,816 - all direct hypergeometric probabilities.
Why does the calculator restrict which k values are allowed?
The support of the distribution is limited by counting logic: you cannot draw more successes than exist in the population (k <= K) or than you draw (k <= n), and if the sample is bigger than the number of non-successes, some successes are forced in (k >= n - (N - K)). The calculator reports the valid range so an impossible k is flagged rather than silently returning zero.
Are the results exact or approximated?
Exact. Each probability is a ratio of combination counts evaluated in a numerically stable way, not a normal or binomial approximation. That matters most in the tails and for small populations, where approximations can be off by several percentage points - the worked example shows a 12% relative error in the binomial's P(X = 0).