Hypergeometric Distribution Calculator
Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 9/10/2026
The hypergeometric distribution gives P(X=k) = C(K,k) × C(N−K,n−k) ÷ C(N,n), the probability of obtaining exactly k successes when drawing n elements without replacement from a population of N elements containing K successes. For 5 cards drawn from a deck of 52 (13 hearts), the probability of getting exactly 2 hearts is about 27.43%.
Explanation
The hypergeometric distribution models sampling without replacement, where each drawn element is not returned to the population before the next draw — unlike the binomial distribution (already covered by our binomial distribution calculator), which assumes an identical success probability at each draw, typically because the element is put back or the population is so large that removing it changes almost nothing. Drawing cards from a deck without returning them, picking balls from an urn, or selecting a sample from a finite population for quality control are typical sampling-without-replacement situations: each removed element changes the composition of what remains, and therefore the probability of the next draw. The formula combines three combination terms (the number of ways to choose k successes from the K available, multiplied by the number of ways to choose the rest of the sample from the non-success elements, all relative to the total number of ways to draw the full sample) already covered individually by our permutations and combinations calculator. The larger the population N relative to the sample size n, the more negligible the difference between drawing with and without replacement becomes, and the hypergeometric distribution then approaches an equivalent binomial distribution — a useful benchmark for knowing which of the two to choose depending on the context.
Example: 5 cards drawn from a deck of 52, probability of exactly 2 hearts
Inputs
Population (N): 52 cards. Successes in the population (K): 13 hearts. Sample drawn (n): 5 cards. Successes sought (k): 2 hearts.
Calculation
P(X=2) = C(13,2) × C(39,3) ÷ C(52,5) = 78 × 9139 ÷ 2,598,960 ≈ 0.2743.
Result
The probability of drawing exactly 2 hearts among 5 cards is about 27.43%.
Frequently asked questions
What is the concrete difference between the binomial and hypergeometric distributions?
The binomial distribution assumes the success probability stays exactly the same at each draw (drawing with replacement, or a population so large that the sampling does not noticeably change it). The hypergeometric distribution accounts for the fact that each drawn element changes the composition of what remains: after drawing a heart from a deck of cards, there are proportionally fewer hearts among the remaining cards, which changes the probability of the next draw.
When can a hypergeometric distribution be approximated by a binomial one?
When the population N is very large relative to the sample size n (a common rule of thumb is n less than about 5% of N), removing a few elements without replacement changes the remaining composition so little that the binomial distribution gives a reasonable approximation, often simpler to calculate.
Why is the population size capped at 170 in this calculator?
Because the calculation relies on factorials, and 171! exceeds the largest value representable in standard numerical precision (double-precision floating point), beyond which the result degenerates into an infinite value in an intermediate calculation — the same limit already applied to our permutations and combinations calculator.