Statistics Quest

Hypergeometric distribution

The hypergeometric distribution counts successes in a sample drawn without replacement from a finite population with a known number of successes.

P(X=k)=(Kk)(N−Kn−k)(Nn)P(X = k) = \frac{\binom{K}{k}\binom{N-K}{n-k}}{\binom{N}{n}}
pmf, for max(0, n − N + K) ≤ k ≤ min(n, K)
NN
population size
KK
number of successes in the population
nn
sample size (drawn without replacement)
kk
number of successes in the sample
E⁡(X)=nKN,Var⁡(X)=nKN(1−KN)N−nN−1\E(X) = n\frac{K}{N}, \qquad \Var(X) = n\frac{K}{N}\Big(1 - \frac{K}{N}\Big)\frac{N-n}{N-1}
Mean and variance
N−nN−1\frac{N-n}{N-1}
the finite population correction factor (squared FPC): sampling without replacement reduces the variance

When to use

Drawing without replacement from a small population: cards from a deck, a batch inspected for defectives, people selected for a committee. It is also the null distribution behind Fisher's exact test.

Assumptions

Every subset of size nn is equally likely (a simple random sample) and the population counts NN and KK are known.

How to interpret

  • Same mean as the binomial with p=K/Np = K/N, but a smaller variance, by the factor (N−n)/(N−1)(N-n)/(N-1).
  • When nn is under about 10% of NN, the binomial gives nearly the same answers.

Common mistakes

  • Using the binomial when a large fraction of the population is sampled, which overstates the variability.
  • Mixing up KK (successes in the population) and kk (successes in the sample).

Example

A batch of N=20N = 20 parts contains K=5K = 5 faulty ones; n=4n = 4 are inspected. P(X=1)=0.4696P(X = 1) = 0.4696; P(at least one faulty)=sf(0)=0.7183P(\text{at least one faulty}) = \text{sf}(0) = 0.7183. The binomial approximation (n=4n = 4, p=0.25p = 0.25) would give 0.68360.6836, noticeably off because 20% of the batch is sampled.