Skip to content
The Calculatorz
Probability distributions

Hypergeometric Distribution Calculator

Find the probability of drawing a given number of successes without replacement, such as aces in a card hand, defective items in a sample or winning lottery numbers.

Statistical results depend on the assumptions stated in the formula. Check that your data meet them before drawing conclusions.

Population and sample

Distribution

How to use this calculator

Enter the size of the population, how many items in it count as successes, how many you draw without putting them back, and the number of successes you are interested in. The calculator gives the exact and cumulative probabilities and the distribution's mean and standard deviation.

Formula

P(X = k) = C(K, k) × C(N − K, n − k) ÷ C(N, n), where C(a, b) is the number of combinations. Mean = n × K ÷ N. Variance = n × (K/N) × (1 − K/N) × (N − n) ÷ (N − 1). k ranges from max(0, n − (N − K)) to min(n, K).

Calculator credits

Calculator developmentJulia Edwards

Editorial supervision

Expert reviewSaeedM.Phil Statistics, Data Scientist

Published byThe Calculatorz

Last updated

Read how we research, test, review and correct our calculators in our editorial policy.

Frequently asked questions

When should I use the hypergeometric distribution?

When you sample without replacement from a finite population, so each draw changes the chances of the next one.

How is it different from the binomial distribution?

The binomial assumes independent draws with a constant probability (sampling with replacement). For small samples from large populations the two give similar answers.

What is a typical use?

Card games, lotteries, quality-control acceptance sampling and testing whether a set of genes is over-represented in a list.

What are the lottery odds of matching all numbers?

For a 6-from-49 lottery: N = 49, K = 6, n = 6, k = 6 gives 1 in 13,983,816.

What is the finite population correction?

The factor (N − n) ÷ (N − 1) in the variance. It shrinks the variance as the sample becomes a larger share of the population.

Why is a probability zero?

Some values of k are impossible, for example more successes than were in the population or than were drawn.

References & methodology sources

These sources support the calculator’s formula, definitions, thresholds, units or result interpretation.

  1. Ross, S. M. (2019). A first course in probability (10th ed.). Pearson. View source
  2. Olver, F. W. J., Lozier, D. W., Boisvert, R. F., & Clark, C. W. (Eds.). (2024). NIST Digital Library of Mathematical Functions. National Institute of Standards and Technology. View source
  3. Illowsky, B., & Dean, S. (2023). Introductory statistics 2e. OpenStax. View source
  4. Casella, G., & Berger, R. L. (2002). Statistical inference (2nd ed.). Duxbury. View source