Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Hypergeometric Distribution






Hypergeometric Distribution: Sampling Without Replacement


The hypergeometric distribution arises from sampling without replacement from a finite population containing two types of items, typically labeled success and failure. A fixed number of draws is made, and the random variable counts how many successes appear in the sample. Because items are not replaced, each draw changes the probabilities of subsequent draws, introducing dependence between trials — the key distinction from the binomial experiment.



The Probabilistic Experiment Behind hypergeometric distribution


The hypergeometric distribution counts the number of successes obtained when sampling without replacement from a finite population. The population contains a fixed number of successes and failures, and each draw permanently alters the composition of the population.

Unlike the binomial distribution, trials are not independent. The probability of success changes after each draw because items are not returned. The number of draws is fixed in advance, and the random variable counts how many successes appear in the sample.

This distribution captures situations where resources are limited or where selection without replacement is intrinsic to the experiment. It reflects dependence between outcomes — a key distinction from trial-based models.

Example:

Drawing 55 cards from a standard deck without replacement and counting how many are hearts. Each draw changes the probabilities for subsequent draws, because the deck composition changes.

Notation Used


XHypergeometric(N,K,n)X \sim \text{Hypergeometric}(N, K, n) or XHyp(N,K,n)X \sim \text{Hyp}(N, K, n)distribution of the random variable.

Hypergeometric(N,K,n)\text{Hypergeometric}(N, K, n)used to denote the distribution itself (not the random variable).

H(N,K,n)\text{H}(N, K, n)occasionally used in compact form, especially in software or formulas.

P(X=k)=(Kk)(NKnk)(Nn),for valid kP(X = k) = \frac{\binom{K}{k} \binom{N - K}{n - k}}{\binom{N}{n}}, \quad \text{for valid } kprobability mass function (PMF), where:

NN — total population size

KK — number of success states in the population

nn — number of draws (sample size) without replacement

kk — number of observed successes in the sample

max(0,n(NK))kmin(n,K)\max(0, n - (N - K)) \leq k \leq \min(n, K) — valid range for kk

(ab)=a!b!(ab)!\binom{a}{b} = \frac{a!}{b!(a-b)!} — binomial coefficient

Key properties:

E[X]=nKNE[X] = n \frac{K}{N} — expected value (mean)

Var(X)=nKNNKNNnN1\text{Var}(X) = n \frac{K}{N} \frac{N-K}{N} \frac{N-n}{N-1} — variance

Relationship to binomial distribution:

Hypergeometric(N,K,n)Binomial(n,p)\text{Hypergeometric}(N, K, n) \approx \text{Binomial}(n, p) where p=KNp = \frac{K}{N}, when NN is large relative to nn (sampling with replacement approximation)

See All Probability Symbols and Notations

Parameters


𝑁𝑁: total population size

𝐾𝐾: number of successes in the population

𝑛𝑛: number of draws (without replacement), where 𝑛𝑁𝑛≤𝑁

The hypergeometric distribution models the number of successes in 𝑛𝑛 draws from a finite population of size 𝑁𝑁 that contains exactly 𝐾𝐾 successes, without replacement.

Unlike the binomial distribution, where each trial is independent, here each draw changes the probabilities — once an item is drawn, it doesn't go back. This dependency is what defines the distribution’s behavior.

Probability Mass Function (PMF) and Support (Range)


The probability mass function (PMF) of a hypergeometric distribution is given by:

P(X=k)=(Kk)(NKnk)(Nn),k=max(0,nN+K),,min(n,K)P(X = k) = \frac{\binom{K}{k} \binom{N-K}{n-k}}{\binom{N}{n}}, \quad k = \max(0, n-N+K), \ldots, \min(n, K)


where (ab)=a!b!(ab)!\binom{a}{b} = \frac{a!}{b!(a-b)!} is the binomial coefficient.


Sampling Without Replacement: The hypergeometric distribution models the number of successes when drawing nn items without replacement from a finite population of size NN containing exactly KK success items.

Support (Range of the Random Variable):
* The random variable XX can take on values from max(0,nN+K)\max(0, n-N+K) to min(n,K)\min(n, K).
* X=kX = k means exactly kk successes are drawn in the sample of size nn.
* The lower bound ensures we don't draw more failures than available: nkNKn-k \leq N-K
* The upper bound ensures we don't draw more successes than available: kKk \leq K and knk \leq n
* The support is thus a finite set of non-negative integers.

Logic Behind the Formula:
* (Kk)\binom{K}{k}: The number of ways to choose kk successes from KK available successes
* (NKnk)\binom{N-K}{n-k}: The number of ways to choose nkn-k failures from NKN-K available failures
* (Nn)\binom{N}{n}: The total number of ways to choose nn items from NN items
* The total probability sums to 1:

k=max(0,nN+K)min(n,K)P(X=k)=k=max(0,nN+K)min(n,K)(Kk)(NKnk)(Nn)=1\sum_{k=\max(0,n-N+K)}^{\min(n,K)} P(X = k) = \sum_{k=\max(0,n-N+K)}^{\min(n,K)} \frac{\binom{K}{k} \binom{N-K}{n-k}}{\binom{N}{n}} = 1

* This follows from Vandermonde's identity.

Hypergeometric Distribution

Sampling without replacement from finite population

Explanation

The hypergeometric distribution models the number of successes when sampling without replacement from a finite population. The probability mass function is P(X=k)=(Kk)(NKnk)(Nn)P(X = k) = \frac{\binom{K}{k} \binom{N-K}{n-k}}{\binom{N}{n}}, where NN is the population size, KK is the number of success states in the population, and nn is the number of draws. The expected value is E[X]=nKNE[X] = n \cdot \frac{K}{N} and the variance is Var(X)=nKN(1KN)NnN1\text{Var}(X) = n \cdot \frac{K}{N} \cdot \left(1-\frac{K}{N}\right) \cdot \frac{N-n}{N-1}. Applications include finding defective items in a sample, analyzing card hands dealt without replacement, and quality control sampling.


Cumulative Distribution Function (CDF)


    The cumulative distribution function (CDF) of a hypergeometric distribution is given by:

    FX(k)=P(Xk)=i=0k(Ki)(NKni)(Nn)F_X(k) = P(X \leq k) = \sum_{i=0}^{k} \frac{\binom{K}{i}\binom{N-K}{n-i}}{\binom{N}{n}}


    Where:
    NN = total population size
    KK = number of success states in the population
    nn = number of draws (sample size)
    kk = number of observed successes in the sample (where max(0,nN+K)kmin(n,K)\max(0, n-N+K) \leq k \leq \min(n, K))

    Intuition Behind the Formula


    Definition: The CDF gives the probability of observing kk or fewer successes when drawing nn items without replacement from a population of size NN containing KK success states.

    Summation of Probabilities:
    We sum the individual probabilities from the minimum possible value up to kk:

    P(Xk)=P(X=0)+P(X=1)+P(X=2)++P(X=k)P(X \leq k) = P(X=0) + P(X=1) + P(X=2) + \cdots + P(X=k)


    Without Replacement Effect: Unlike the binomial distribution, the hypergeometric CDF accounts for sampling without replacement. Each draw changes the composition of the remaining population, creating dependency between draws.

    Boundary Conditions:
    The support is bounded by physical constraints:
  • max(0,nN+K)\max(0, n-N+K) (can't draw more failures than exist)
  • min(n,K)\min(n, K) (can't draw more successes than exist or more items than drawn)

  • Complementary Probability:
    For "more than kk successes":

    P(X>k)=1FX(k)P(X > k) = 1 - F_X(k)

Hypergeometric Distribution CDF

CDF for sampling without replacement

CDF Explanation

The hypergeometric CDF is F(k)=P(Xk)=i=0k(Ki)(NKni)(Nn)F(k) = P(X \leq k) = \sum_{i=0}^{k} \frac{\binom{K}{i} \binom{N-K}{n-i}}{\binom{N}{n}} for max(0,n(NK))kmin(n,K)\max(0, n-(N-K)) \leq k \leq \min(n, K). This represents the probability of drawing kk or fewer success items when sampling nn items without replacement from a population of size NN containing KK success items. The CDF is bounded by the minimum and maximum possible number of successes in the sample. Unlike the binomial CDF, the hypergeometric CDF accounts for the changing probability as items are drawn without replacement.

Expected Value (Mean)


As explained in the general case for calculating expected value, the expected value of a discrete random variable is computed as a weighted sum where each possible value is multiplied by its probability:

E[X]=xxP(X=x)E[X] = \sum_{x} x \cdot P(X = x)


For the hypergeometric distribution, we apply this general formula to the specific probability mass function of this distribution.

Formula


E[X]=nKNE[X] = n \cdot \frac{K}{N}


Where:
NN = total population size
KK = number of success states in the population
nn = number of draws (sample size)

Derivation and Intuition


The hypergeometric distribution describes sampling without replacement. Although the draws are not independent, the expected value has a remarkably simple form.

The proportion of successes in the population is KN\frac{K}{N}. When drawing nn items, each draw has the same marginal probability KN\frac{K}{N} of being a success (even though the draws are dependent).

By symmetry and linearity of expectation, the expected number of successes in nn draws is:

E[X]=nKNE[X] = n \cdot \frac{K}{N}


The result E[X]=nKNE[X] = n \cdot \frac{K}{N} captures the intuition that the expected proportion of successes in the sample matches the proportion in the population. If you sample nn items from a population where the success rate is KN\frac{K}{N}, you expect nKNn \cdot \frac{K}{N} successes on average.

Example


Consider drawing 5 cards from a standard deck of 52 cards, counting the number of aces. Here N=52N = 52, K=4K = 4, and n=5n = 5:

E[X]=5452=20520.385E[X] = 5 \cdot \frac{4}{52} = \frac{20}{52} \approx 0.385


On average, you expect to draw about 0.385 aces in a 5-card hand, which reflects the 4-in-52 proportion of aces in the deck.

Variance and Standard Deviation


The variance of a discrete random variable measures how spread out the values are around the expected value. It is computed as:

Var(X)=E[(Xμ)2]=x(xμ)2P(X=x)\mathrm{Var}(X) = \mathbb{E}[(X - \mu)^2] = \sum_{x} (x - \mu)^2 P(X = x)


Or using the shortcut formula:

Var(X)=E[X2]μ2\mathrm{Var}(X) = \mathbb{E}[X^2] - \mu^2


For the hypergeometric distribution, we apply this formula to derive the variance.

Formula


Var(X)=nKNNKNNnN1\mathrm{Var}(X) = n \cdot \frac{K}{N} \cdot \frac{N-K}{N} \cdot \frac{N-n}{N-1}


Where:
NN = total population size
KK = number of success states in the population
nn = number of draws (sample size)

Derivation and Intuition


The derivation involves computing E[X2]\mathbb{E}[X^2] using indicator random variables and accounting for the dependency created by sampling without replacement.

We know from the expected value section that μ=nKN\mu = n \cdot \frac{K}{N}.

The variance formula can be rewritten to show its relationship to the binomial variance:

Var(X)=nKN(1KN)NnN1\mathrm{Var}(X) = n \cdot \frac{K}{N} \cdot \left(1 - \frac{K}{N}\right) \cdot \frac{N-n}{N-1}


The first three terms nKN(1KN)n \cdot \frac{K}{N} \cdot \left(1 - \frac{K}{N}\right) match the binomial variance formula with p=KNp = \frac{K}{N}.

The additional factor NnN1\frac{N-n}{N-1} is called the finite population correction and is always less than 1. It accounts for the reduction in variance caused by sampling without replacement. As the sample size nn approaches the population size NN, this factor approaches zero, reflecting that sampling the entire population leaves no variability.

Standard Deviation


σ=nKNNKNNnN1\sigma = \sqrt{n \cdot \frac{K}{N} \cdot \frac{N-K}{N} \cdot \frac{N-n}{N-1}}


Example


Consider drawing 5 cards from a standard deck of 52, counting aces. Here N=52N = 52, K=4K = 4, n=5n = 5:

Var(X)=545248524751\mathrm{Var}(X) = 5 \cdot \frac{4}{52} \cdot \frac{48}{52} \cdot \frac{47}{51}


=5113121347510.331= 5 \cdot \frac{1}{13} \cdot \frac{12}{13} \cdot \frac{47}{51} \approx 0.331


σ0.3310.575\sigma \approx \sqrt{0.331} \approx 0.575


The relatively small variance reflects the limited range of possible outcomes (0 to 4 aces) and the constraining effect of sampling without replacement from a finite deck.

Applications and Examples


Practical Example


Suppose you have a deck of N=52N = 52 cards containing K=13K = 13 hearts. You draw n=5n = 5 cards without replacement. The probability of getting exactly k=2k = 2 hearts is:

P(X=2)=(132)(521352)(525)=(132)(393)(525)=78913925989600.274P(X = 2) = \frac{\binom{13}{2} \binom{52-13}{5-2}}{\binom{52}{5}} = \frac{\binom{13}{2} \binom{39}{3}}{\binom{52}{5}} = \frac{78 \cdot 9139}{2598960} \approx 0.274


This means there's about a 27.4% chance of getting exactly 2 hearts when drawing 5 cards from a standard deck.

Note: When NN is very large relative to nn, the hypergeometric distribution approximates the binomial distribution with p=KNp = \frac{K}{N}.