# Hypergeometric: how likely is k?

Computes exact hypergeometric probabilities P(X = k), P(X < k), P(X ≤ k), P(X > k) and P(X ≥ k) for n draws without replacement from N items with K successes, with the mean and standard deviation.

- Page: https://www.acalculator.org/statistics/hypergeometric-calculator
- JSON spec: https://www.acalculator.org/statistics/hypergeometric-calculator.json
- Version: 4e2396c594c4

## Default answer

Example with the default inputs (Population size (N) 52, Successes in the population (K) 13, Sample size (n) 5, Successes in the sample (k) 2): Drawing 5 from 52 with 13 successes, the chance of exactly 2 successes is 0.27428, and of at least 2 is 0.367047.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| N | Population size (N) | How many items there are in all, from 1 to 1,000. |
| K | Successes in the population (K) | How many of the N items count as a success, from 0 to N. |
| n | Sample size (n) | How many items are drawn without putting any back, from 1 to N. |
| k | Successes in the sample (k) | The number of successes to find the probability of, from 0 to n. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| exactly | P(X = k) | The probability of exactly k successes. |
| below | P(X < k) | The probability of fewer than k successes. |
| atMost | P(X ≤ k) | The probability of k or fewer successes. |
| above | P(X > k) | The probability of more than k successes. |
| atLeast | P(X ≥ k) | The probability of k or more successes. |
| mean | Mean (nK ÷ N) | The expected number of successes in the sample. |
| variance | Variance | n × (K ÷ N) × ((N − K) ÷ N) × ((N − n) ÷ (N − 1)); 0 when N = 1. |
| sd | Standard deviation | The square root of the variance. |

## Method

P(X = k) = C(K, k) × C(N − K, n − k) ÷ C(N, n); P(X ≤ k) = Σ P(X = j) for j ≤ k; mean = nK ÷ N; variance = n (K ÷ N)((N − K) ÷ N)((N − n) ÷ (N − 1)).

## Assumptions

- The n items are drawn at random without putting any back, so every set of n items is equally likely.
- Each item is either a success or not, and the population size N and successes K are known.

## Worked examples

1. N = 52, K = 13, n = 5, k = 2 gives exactly = 0.27428, mean = 1.25. Source: NIST/SEMATECH e-Handbook of Statistical Methods, glossary: hypergeometric distribution (sampling without replacement; population N, sample n, defectives D), https://www.itl.nist.gov/div898/handbook/glossary.htm.
2. N = 49, K = 6, n = 6, k = 6 gives exactly = 0, atMost = 1, below = 1. Source: NIST/SEMATECH e-Handbook of Statistical Methods, glossary: hypergeometric distribution (sampling without replacement; population N, sample n, defectives D), https://www.itl.nist.gov/div898/handbook/glossary.htm.
3. N = 100, K = 10, n = 10, k = 0 gives exactly = 0.330476, atLeast = 1, above = 0.669524, mean = 1, variance = 0.818182. Source: NIST/SEMATECH e-Handbook of Statistical Methods, glossary: hypergeometric distribution (sampling without replacement; population N, sample n, defectives D), https://www.itl.nist.gov/div898/handbook/glossary.htm.
4. N = 10, K = 3, n = 4, k = 3 gives exactly = 0.033333, atLeast = 0.033333, below = 0.966667. Source: NIST/SEMATECH e-Handbook of Statistical Methods, glossary: hypergeometric distribution (sampling without replacement; population N, sample n, defectives D), https://www.itl.nist.gov/div898/handbook/glossary.htm.

## FAQ

### What is the hypergeometric distribution?

It counts successes when you draw without putting items back, so each draw changes the odds of the next. NIST’s e-Handbook describes it as the model for the count of defectives when sampling without replacement, with population N, sample n and D defectives.

### What is the hypergeometric formula?

P(X = k) = C(K, k) × C(N − K, n − k) ÷ C(N, n): the ways to pick k of the K successes, times the ways to fill the rest of the sample from the N − K others, over all the ways to pick n items.

### What is the chance of 2 hearts in a 5-card poker hand?

With N = 52, K = 13, n = 5 and k = 2: C(13, 2) × C(39, 3) ÷ C(52, 5) = 78 × 9,139 ÷ 2,598,960 = 0.2743, about 27.4%.

### When should I use the hypergeometric instead of the binomial?

Use the hypergeometric when you sample without replacement from a small population, such as cards, a lottery or an inspection lot. The binomial assumes each trial has the same chance, which is true with replacement, and close enough when the sample is a small part of a large population.

### What are the odds of winning a 6-from-49 lottery?

Matching all six numbers is P(X = 6) with N = 49, K = 6 and n = 6: 1 ÷ C(49, 6) = 1 in 13,983,816.

### What are the mean and variance?

The mean is n × K ÷ N. The variance is n × (K ÷ N) × ((N − K) ÷ N) × ((N − n) ÷ (N − 1)); the last factor, the finite population correction, makes it smaller than the binomial variance.

## Sources

- NIST/SEMATECH e-Handbook of Statistical Methods, Glossary: hypergeometric distribution (count of defectives when sampling without replacement; parameters N, n and D, all whole numbers). https://www.itl.nist.gov/div898/handbook/glossary.htm (retrieved 2026-10-01)
- NIST/SEMATECH e-Handbook of Statistical Methods, §7.3.3 How can we determine whether two processes produce the same proportion of defectives? (the hypergeometric distribution gives the exact probability of a 2 × 2 table with fixed margins). https://www.itl.nist.gov/div898/handbook/prc/section3/prc33.htm (retrieved 2026-10-01)
