Hypergeometric Distribution Calculator

This hypergeometric distribution calculator needs the population size, the number of successes, the sample size and the successes you want. Example: 10 winners among 50 tickets, 5 drawn – exactly 2 winners has probability 0.20984.

Example: Population size N 50 · Successes K in the population 10 · Sample size n (without replacement) 5 · Successes wanted k 2 → Result: P(X = 2) = 0.20984 (N = 50, K = 10, n = 5). Source: Wikipedia – Hypergeometric distribution. Updated: .

How many successes in the sample you are looking for.
My ToolboxYour inputs are saved in this browser only.

Result

Result
P(X = 2) = 0.20984 (N = 50, K = 10, n = 5)
All values
QuantityValue
Exactly k: P(X = k)0.20984
At most k: P(X ≤ k)0.95174
At least k: P(X ≥ k)0.2581
Mean n · K / N1
Variance0.734694
Standard deviation0.857143
Possible numbers of successes0 – 5
Calculation steps
  • P(X = k) = C(K, k) · C(N − K, n − k) / C(N, n) = 45 · 9880 / 2118760 = 444600 / 2118760 = 0.20984.
  • Mean n · K / N = 5 · 10 / 50 = 1; variance n · (K/N) · (1 − K/N) · (N − n)/(N − 1) = 0.734694.
Hypergeometric means without replacement. With replacement, or when N is very large compared with n, the binomial distribution is a good approximation.

How it is calculated

The hypergeometric distribution gives the probability of k successes when you draw from a finite population without replacement.

Formula

The population has N items, K of them successes. You draw n items without replacement. Then P(X = k) = C(K, k) · C(N − K, n − k) / C(N, n): count the favourable selections (k successes out of K, n − k failures out of N − K) and divide by all possible selections. The mean is n · K / N and the variance n · (K/N) · (1 − K/N) · (N − n)/(N − 1). The last factor is the finite-population correction and makes the variance smaller than in the binomial case.

Worked example

A raffle drum holds 50 tickets, 10 of them winners. You draw 5 tickets. Exactly 2 winners: C(10, 2) = 45, C(40, 3) = 9880 and C(50, 5) = 2118760, so P = 45 · 9880 / 2118760 = 444600 / 2118760 = 0.20984. At most 2 winners has probability 0.95174, at least 2 winners 0.2581. On average you expect 5 · 10 / 50 = 1 winner, and the variance is 5 · 0.2 · 0.8 · 45/49 = 0.734694.

Frequently asked questions

How do you calculate the hypergeometric distribution?

With P(X = k) = C(K, k) · C(N − K, n − k) / C(N, n). For N = 50, K = 10, n = 5 and k = 2 this gives 0.20984.

How does it differ from the binomial distribution?

The binomial applies when drawing with replacement, the hypergeometric without. If the sample is small compared with N, the two are close.

How do you calculate P(X ≥ k)?

Add the single probabilities from k up to the largest possible value. Here P(X ≥ 2) = 0.2581.

Sources and legal basis

As of: · Editorial policy

Related tools