The hypergeometric distribution describes the probability of selecting exactly $x$ items *from a sub-population* of size $K$, when drawing $n$ times *without replacement* from a population of size $N$.
It models situations where the total population and sub-population are finite and fixed, and draws are dependent on previous outcomes.
| Parameter | Description |
| --------- | ------------------------------------------- |
| $N$ | Size of the overall population |
| $K$ | Size of the sub-population |
| $n$ | Number of draws |
| $x$ | Number of draws belonging to sub-population |
## Probability Mass Function
The probability of observing exactly $x$ successes (items from the sub-population) is given by the following [[Probability Mass Function|PMF]]:
$
\mathbf P(X=x)=\frac{\begin{pmatrix} K\\x \end{pmatrix} * \begin{pmatrix} N-K\\n-x \end{pmatrix}} { \begin{pmatrix} N\\n \end{pmatrix}}
$
**Numerator:**
- *First term:* Number of ways to choose $x$ items from the sub-population $K$.
- *Second term:* Number of ways to choose the remaining $(n-x)$ draws from outside the sub-population $(N-K)$.
**Denominator:** Number of ways to choose $n$ items from a population of $N$.
![[hypergeometric-distribution.png|center|400]]
## Comparison to Multinomial Distribution
| | Hypergeometric | [[Multinomial Distribution]] | |
| --------------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | --- |
| Sampling Method | Draws are without replacement. | Draws are with replacement or modeled as [[Independence of Events\|independent]] independent trials. | |
| Independence | Probabilities of subsequent draws depend on earlier outcomes, as the total population size decreases with each draw. | Probabilities remain constant across all trials, as each draw does not affect the outcomes of others. | |
| Example | If a red ball is drawn, there is one less red ball available for subsequent draws, altering the probabilities. | Rolling a die multiple times assumes each roll has the same probability distribution, independent of previous outcomes. | |