About the Hypergeometric Calculator
The Hypergeometric Distribution Calculator finds the exact probability of drawing a specific number of successes when sampling without replacement from a finite population, such as pulling a set number of aces from a fixed deck of cards. Because each draw changes the composition of what remains, this differs from the binomial distribution, which assumes constant probability across draws.
How It Works
You enter the total population size (N), the number of success states within that population (K), the sample size drawn (n), and the exact number of successes you want the probability for (k). The calculator uses combinatorics to count how many ways that specific outcome can occur relative to every possible sample, returning the exact probability as a percentage.
Formula & Methodology
The numerator counts the ways to choose k successes from the K available success states, multiplied by the ways to choose the remaining (n - k) sample slots from the (N - K) non-success items. The denominator counts every possible way to draw a sample of size n from the full population of N, regardless of outcome. All four inputs are rounded to the nearest whole number before the calculation runs, since population and sample counts must be whole items.
Examples
Drawing an Ace from a Deck
From a standard 52-card deck (N=52) containing 4 aces (K=4), drawing a 5-card hand (n=5) and wanting exactly 1 ace (k=1) gives P = C(4,1) x C(48,4) / C(52,5) = 4 x 194,580 / 2,598,960, about 29.95%.
Inspecting a Batch for Defects
A batch of 20 parts (N=20) contains 3 defective units (K=3). Pulling 5 parts for inspection (n=5) and wanting zero defects (k=0) gives P = C(3,0) x C(17,5) / C(20,5) = 1 x 6,188 / 15,504, about 39.91%.
Advantages
- Computes exact probabilities for finite-population sampling without replacement, where the binomial distribution would give a slightly wrong answer.
- Avoids the manual factorial arithmetic of combinations, which grows unwieldy quickly even for modest population sizes.
- Automatically returns zero for logically impossible combinations of K, n, and k instead of an undefined or erroneous result.
Common Mistakes
- Using the binomial distribution instead when sampling is actually done without replacement from a small, finite population.
- Confusing K (total success states in the whole population) with k (successes wanted in the specific sample), which the similar labels make easy to mix up.
- Forgetting that this calculator returns the probability of exactly k successes, not k or fewer, or k or more, which requires summing multiple individual probabilities.
Edge Cases to Watch For
- If the successes requested (k) exceed the success states available (K), or the required non-successes (n minus k) exceed the available non-success items (N minus K), the probability is automatically 0 percent.
- Inputs must satisfy 0 ≤ K ≤ N, 0 < n ≤ N, and 0 ≤ k ≤ n, or the calculator returns a validation error.
- All four values are rounded to the nearest integer before use, so fractional entries for population, sample, or success counts are silently rounded rather than rejected.
Common Use Cases
- Card players and game designers calculating exact odds for draws from a fixed deck or pool.
- Quality control inspectors estimating the chance of finding a given number of defective units in a sample pulled from a finite production batch.
- Statistics students and instructors working through sampling-without-replacement problems that binomial formulas can't handle correctly.