Calculateus

Hypergeometric Distribution Calculator

Calculate the probability of drawing a specific number of successes when sampling without replacement.

Result

P(X = 1)
29.947%

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.

P(X = k) = [C(K, k) x C(N - K, n - k)] / C(N, n), where C(a, b) is the number of combinations of b items chosen from a.

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.
Written & fact-checked by the Calculateus TeamLast updated August 5, 2026How we verify our formulas

Frequently asked questions

How is this different from the binomial distribution?

Binomial assumes each trial's probability stays constant (sampling WITH replacement, or an effectively infinite population) - hypergeometric applies when you're sampling WITHOUT replacement from a finite population, so each draw changes the odds for the next one, like drawing cards from a deck without putting them back.

Conclusion

Because it accounts for how each draw changes the remaining population, the hypergeometric distribution gives the exact answer for finite, without-replacement sampling problems that a binomial approximation would only estimate.