
How to Use the Hypergeometric Calculator

- Enter the population size N and how many successes K it contains.
- Enter the number of draws n and the number of successes k you want.
- Choose exactly, at most, at least, fewer than or more than k.
- Read the probability with odds, all five cumulative values and the chart.
Enter four whole numbers. N is the size of the population, K is how many of those count as successes, n is how many items you draw without putting any back, and k is the number of successes you are asking about. Then choose the probability you need: exactly k, at most k, at least k, fewer than k or more than k.
The result shows the chosen probability as a decimal, a percentage and approximate odds. All five probabilities are listed together, along with the mean and standard deviation of the number of successes. The bar chart shows the whole distribution with the bars that make up your answer highlighted. The example buttons load a card, lottery and quality control problem.
Hypergeometric Formula
C(a, b) = a! ÷ (b! × (a − b)!)
Mean = n × K ÷ N Variance = n × (K÷N) × ((N − K)÷N) × ((N − n)÷(N − 1))
The numerator counts the ways to choose k successes from the K available and n − k failures from the N − K others. The denominator counts every possible sample of n. Cumulative answers such as “at least 2” are sums of these exact terms, computed with log factorials so that large populations stay accurate.
Worked Example: Hearts in a Poker Hand
A deck has N = 52 cards, of which K = 13 are hearts. In a hand of n = 5 cards, what is the chance of exactly k = 2 hearts?
- Ways to pick 2 hearts: C(13, 2) = 78.
- Ways to pick 3 non-hearts: C(39, 3) = 9,139.
- All 5-card hands: C(52, 5) = 2,598,960.
- P(X = 2) = 78 × 9,139 ÷ 2,598,960 = 712,842 ÷ 2,598,960 = 0.27428, about 1 in 3.65.
The calculator also gives P(X ≥ 2) = 0.367047 and P(X ≤ 2) = 0.907233. On average a hand holds 5 × 13 ÷ 52 = 1.25 hearts.
More Examples
| Problem | N, K, n, k | Probability |
|---|---|---|
| Match exactly 3 numbers in a 6/49 lottery | 49, 6, 6, 3 | 0.0176504 (1 in 56.66) |
| Match all 6 numbers in a 6/49 lottery | 49, 6, 6, 6 | 1 in 13,983,816 |
| Exactly 1 defective in a sample of 10 from a lot of 100 with 5 defective | 100, 5, 10, 1 | 0.339391 |
| At least 1 defective in the same sample | 100, 5, 10, ≥ 1 | 0.416248 |
Hypergeometric vs Binomial
The binomial distribution assumes each draw has the same chance of success, which is true when you sample with replacement. Without replacement, every draw changes what is left, so the hypergeometric distribution is the exact model. The factor (N − n) ÷ (N − 1) in the variance, the finite population correction, captures that effect.
When the sample is small compared with the population, usually less than 5 percent, the two distributions give nearly the same answers, and the binomial with p = K ÷ N is a convenient approximation. For card games, lotteries and small batches, use the hypergeometric result.
Solving a Problem Step by Step
- Decide what counts as a success, such as a heart, a winning number or a defective part.
- Count the population N and the successes K in it.
- Note the sample size n and the number of successes k you care about.
- Choose exactly, at most or at least. Words like “no more than” mean at most, and “one or more” means at least 1.
- Read the probability, and check that it makes sense against the mean n × K ÷ N.
For acceptance sampling, a buyer might accept a lot of 100 parts if a sample of 10 contains no defective parts. With 5 defectives in the lot, P(X = 0) = 0.583752, so a bad lot still passes more than half the time. That is why sample size matters.
Tips and Limits
- Define a “success” first, then count K as the number of successes in the whole population.
- “At least one” problems are easiest as 1 − P(X = 0), and the calculator shows P(X ≥ 1) directly.
- Some values of k are impossible. For example, you cannot draw 4 aces in a 3-card hand, and the result says so.
- Populations up to 10 million are supported. Results are exact up to normal floating point rounding.
Frequently asked questions
What is the hypergeometric distribution?
It gives the probability of k successes in n draws without replacement from a population of N items that contains K successes. Each draw changes the remaining mix, so the draws are not independent.
When should I use hypergeometric instead of binomial?
Use the hypergeometric distribution when you sample without replacement from a finite population, such as cards, lottery balls or a production lot. The binomial fits sampling with replacement or very large populations.
How do I calculate at least one success?
Find the probability of zero successes and subtract it from 1. In the calculator, choose At least k and enter k = 1 to get P(X ≥ 1) directly.
What are N, K, n and k?
N is the population size, K is the number of successes in the population, n is the number of items drawn, and k is the number of successes in the draw that you want the probability for.
What are the odds of winning a 6/49 lottery?
Matching all six numbers has probability 1 ÷ C(49, 6) = 1 in 13,983,816. Matching exactly three of the six has probability 0.01765, about 1 in 57.
What is the mean of a hypergeometric distribution?
The mean is n × K ÷ N, the sample size times the fraction of successes in the population. For a 5-card hand, the expected number of hearts is 5 × 13 ÷ 52 = 1.25.