PLAYGROUND

DISTRIBUTIONS / DISCRETE / HYPERGEOMETRIC

Hypergeometric distribution

Profile

The Hypergeometric distribution counts successes when sampling without replacement from a finite population. Dependence between draws is exactly what separates it from Binomial.

Sampling Natural model
replacement / independent Binomial
without replacement, finite population Hypergeometric
large population, small fraction Binomial approximation

Origin and terminology

The distribution became established in finite-population sampling, urns, and contingency tables. Its exact-inference role is associated with Fisher and tests of association.

In real models

  • quality control without returning sampled items
  • card selection, genetics, and fixed-margin contingency tables

Comparisons

Check that K and n match the data’s population and sample roles; swapping them changes probabilities.

An urn that remembers every draw

Imagine a box containing conforming and defective parts. Once a part is drawn without replacement, the composition of the box changes. That physical memory produces the Hypergeometric distribution and separates it from the Binomial experiment, which keeps the same probability on every trial.

The finite population correction reduces variance when the sample is an appreciable fraction of the population. If the population is enormous compared with the sample, that effect fades and the Binomial becomes a reasonable approximation. The same logic underpins Fisher’s exact test when table margins are treated as fixed. In auditing and quality control, ignoring sampling without replacement will often overstate uncertainty.

Decision guide

A good candidate when: successes are counted while sampling without replacement from a finite population of known composition.

Compare it with: Binomial with replacement or a negligible sampling fraction. The finite-population correction reduces variance and should not be ignored for large sampling fractions.

References

Hypergeometric Distribution: equations and calculator

Distribution defintion

X∼Hypergeometric(N,K,n)X\sim\mathrm{Hypergeometric}\left(N,K,n\right)

Distribution domain

x∈{max⁡(0,n+K−N),min⁡(n,K)}x\in\left\{\max{(0,n+K-N)}, \min{(n, K )}\right\}

Parameters domain and parameters constraints

N∈N,K∈{0…N},n∈{0…N}N\in\mathbb{N},K\in\left\{0\dots N\right\},n\in\left\{0\dots N\right\}

Cumulative distribution function

FX(x)=∑i=0x(Ki)(N−Kn−i)/(Nn)F_{X}\left(x\right)=\sum_{i=0}^{x}\binom{K}{i}\binom{N-K}{n-i}\bigg/\binom{N}{n}

Probability mass function

fX(x)=(Kx)(N−Kn−x)/(Nn)f_{X}\left(x\right)=\binom{K}{x}\binom{N-K}{n-x}\bigg/\binom{N}{n}

Percent point function/Sample

FX−1(u)=arg⁡min⁡x∣FX(x)−u∣F^{-1}_{X}\left(u\right)=\arg\min_{x}\left| F_{X}\left(x\right)-u \right|

Parametric centered moments

E[Xk]=μk′=∑x=max⁡(0,n+K−N)min⁡(n,K)xkfX(x)E[X^k]=\mu'_{k}=\sum_{x=\max{(0,n+K-N)}}^{\min{(n, K )}}x^{k}f_{X}\left(x\right)

Parametric mean

Mean(X)=μ1′=nKN\mathrm{Mean}(X)=\mu'_{1}=\frac{nK}{N}

Parametric variance

Variance(X)=(μ2′−μ1′2)=nKNN−KNN−nN−1\mathrm{Variance}(X)=(\mu'_{2}-\mu'^{2}_{1})=n\frac{K}{N}\frac{N-K}{N}\frac{N-n}{N-1}

Parametric skewness

Skewness(X)=μ3′−3μ2′μ1′+2μ1′3(μ2′−μ1′2)1.5=(N−2K)(N−1)12(N−2n)[nK(N−K)(N−n)]12(N−2)\mathrm{Skewness}(X)=\frac{\mu'_{3}-3\mu'_{2}\mu'_{1}+2\mu'^{3}_{1}}{(\mu'_{2}-\mu'^{2}_{1})^{1.5}}=\frac{(N-2K)(N-1)^\frac{1}{2}(N-2n)}{[nK(N-K)(N-n)]^\frac{1}{2}(N-2)}

Parametric kurtosis

Kurtosis(X)=μ4′−4μ1′μ3′+6μ1′2μ2′−3μ1′4(μ2′−μ1′2)2=3+1nK(N−K)(N−n)(N−2)(N−3)\mathrm{Kurtosis}(X)=\frac{\mu'_{4}-4\mu'_{1}\mu'_{3}+6\mu'^{2}_{1}\mu'_{2}-3\mu'^{4}_{1}}{(\mu'_{2}-\mu'^{2}_{1})^{2}}=3+\frac{1}{n K(N-K)(N-n)(N-2)(N-3)}

Parametric median

Median(X)=FX−1(0.5)\mathrm{Median}(X)=F^{-1}_{X}\left(0.5\right)

Parametric mode

Mode(X)=⌊(n+1)(K+1)N+2⌋\mathrm{Mode}(X)=\left \lfloor \frac{(n+1)(K+1)}{N+2} \right \rfloor

Additional information and definitions

Computing an analytic expression for the inverse of the cumulative distribution function is not feasible. However, it is possible to calculate the Percentile Point Function by approximating it to the nearest integer.
u:Uniform[0,1] random varibleu:\text{Uniform[0,1] random varible}
⌊x⌋:Floor function\lfloor{x}\rfloor: \text{Floor function}
⌈x⌉:Ceiling Function\lceil{x}\rceil: \text{Ceiling Function}