= Hypergeometric distribution
{title2=$K\sim\operatorname{Hypergeom}(n,c,r)$}
{wiki}
= Hypergeometric
{synonym}
The <hypergeometric distribution> counts marked objects in a uniformly chosen sample of fixed size from a finite population, using <sampling without replacement>. Let $n\geq1$ be the population size, let $0\leq c\leq n$ objects be marked, and sample $0\leq r\leq n$ distinct objects. If $K$ counts the marked objects selected, its <probability mass function> is
$$
\mathbb P(K=k)=\frac{\binom ck\binom{n-c}{r-k}}{\binom nr},
\qquad \max(0,r-(n-c))\leq k\leq\min(c,r).
$$
The bounds describe the <support of a probability distribution> and $k$ must be an <integer>; the mass is zero elsewhere. The denominator counts all size-$r$ <subsets>, while the numerator counts choices of $k$ marked and $r-k$ unmarked objects using <binomial coefficients>. This counting argument requires every size-$r$ sample to have the same <probability>.https://web.mit.edu/14.380/www/handouts/hypergeometric.pdf[MIT 14.30, hypergeometric distribution handout, §§1–4]{ref}
For a constructed example, a box contains ten labelled objects, four red and six blue. Select five without replacement. There are $\binom{10}{5}=252$ possible samples. The <probabilities> for $K=0,1,2,3,4$ are
$$
\frac1{42},\quad\frac5{21},\quad\frac{10}{21},\quad\frac5{21},\quad\frac1{42}.
$$
In particular, $\mathbb P(K=2)=\binom42\binom63/252=120/252=10/21$. Five red objects are impossible because the box only contains four. The <expected value> is $r(c/n)=2$, and the <variance> is $2/3$.
\Image[/hypergeometric-versus-binomial.png]
{title=Five draws from four red and six blue objects: replacement preserves the mean but changes the spread}
The count law also answers a detection question: what is the chance that five draws find at least one red object? By the <complement rule of probability>, it is $1-\mathbb P(K=0)=41/42$, approximately $0.9762$. This can model inspecting five distinct objects from a known finite collection, with a mark indicating the property we want to detect. If repeated inspections can select the same object again, the replacement model instead gives $1-0.6^5=0.92224$. Equal <expected values> therefore do not imply equal chances of detecting a marked object.
The corresponding <binomial distribution> counts red draws when each selected object is put back before the next independent draw: $K_{\mathrm{rep}}\sim\operatorname{Bin}(5,0.4)$. It has the same <expected value> $2$, but <variance> $5(0.4)(0.6)=6/5$, and it permits five red draws. Without replacement, a red first draw leaves red <probability> $3/9$ for the next draw; a blue first draw leaves $4/9$. This <statistical dependence> pulls the total toward the fixed composition of the population, producing the <finite population correction>.
The useful modelling question is whether previously selected objects remain available. A fixed-size sample of distinct items calls for a <hypergeometric distribution>; fresh independent trials with constant success <probability> call for a <binomial distribution>. When the population grows with $c/n\to p$ while $r$ stays fixed, the hypergeometric masses tend to the corresponding <binomial distribution> masses: removing finitely many objects has an increasingly small effect on the next draw's <probability>.
Back to article page