Calculators
Home › Calculators › Hypergeometric Distribution

Hypergeometric Distribution Calculator

Draws without replacement, priced exactly: cards, lots and inspections.

Hypergeometric probabilities

Population N, successes K in it, draws n, successes wanted k.

Quick answer: Five cards from 52 with 4 aces: exactly 2 aces is 0.0399, at least one ace is 0.3412, and the expected count is nK/N = 0.385.

Sampling without putting anything back

Draw n items from a population of N that contains K successes, without replacement, and count the successes in your hand. That count follows the hypergeometric distribution. Cards are the canonical example: deal 5 from a deck of 52 with its 4 aces. The binomial distribution does not apply because the deck changes composition after every card; the hypergeometric prices each hand by counting combinations instead: choose the successes, choose the failures, divide by all possible hands.

Hypergeometric probabilityP(X = k) = C(K, k) C(N − K, n − k) ÷ C(N, n)
Worked example

Five cards, aces wanted. Exactly 2 aces: C(4, 2) × C(48, 3) ÷ C(52, 5) = 6 × 17,296 ÷ 2,598,960 = 0.0399. No aces at all: 0.6588, so at least one ace is 1 − 0.6588 = 0.3412. The expected number of aces is nK/N = 5 × 4/52 ≈ 0.385: most hands hold none, a third hold one or more, almost none hold two.

How it differs from the binomial

The mean formula, nK/N, is the binomial's np wearing the population proportion K/N as p. The variance is where the designs part: sampling without replacement multiplies the binomial variance by the finite population factor (N − n)/(N − 1), always less than 1, because a shrinking population constrains what is left. When n is small next to N that factor sits near 1 and the binomial is a fine approximation (the usual rule: n under 10% of N). Quality inspection is the working home of this distribution: a lot of 500 parts with 20 defectives, a sample of 30, and the acceptance question P(defectives in sample ≤ 1) is hypergeometric, not binomial, because the parts are not replaced.

Watch out

Using the binomial when sampling without replacement from a small population. From a class of 20 students with 7 left-handers, a sample of 5 is a quarter of the population; the binomial overstates the variance by about a third.

Frequently asked questions

When is the hypergeometric distribution the right model?

Sampling without replacement from a finite population with two types of items: defectives in a lot, aces in a deck, tagged fish in a pond sample.

What is the mean of a hypergeometric distribution?

nK/N: the sample size times the population proportion. The variance is that mean times (1 - K/N) times the correction (N - n)/(N - 1).

How does it relate to Fisher's exact test?

Directly: Fisher's test conditions on the margins of a 2x2 table, and the count in one cell then follows a hypergeometric distribution. The test's p-values are hypergeometric probabilities summed over tables.