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.

Key Terms

Hypergeometric Distributionsuccesses in nn draws without replacement
Binomial Distributionthe analogous model for sampling with replacement
Expected ValueE[X]=nK/NE[X] = nK/N
VarianceVar(X)\operatorname{Var}(X) with finite population correction

See All Probability Definitions


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.

Hypergeometric Notation

Notation

Hypergeometric Notation

Four letters, two sizes: the hypergeometric's marks run on a case system — capitals for the population, lowercase for the sample — and its pmf is the only one in the family with no probability parameter anywhere in sight. The declaration, the three-coefficient fraction, and the clamped support each carry part of the without-replacement story. All catalogued among the probability symbols.
The declaration tilde and capital/lowercase split come from random variable notation and distribution notation; the coefficients and their spellings from binomial coefficient notation; E[X]E[X] and Var(X)\operatorname{Var}(X) from expected value and variance notation.
XHyp(N,K,n)X \sim \operatorname{Hyp}(N, K, n)
hypergeometric with population N, K successes among them, and n draws
Three slots and a case system: capital NN and KK describe the population (its size, and the successes it contains), lowercase nn and kk describe the sample (its size, and the successes observed) — the letter case is the mnemonic, population above, sample below. Spellings run Hypergeometric\operatorname{Hypergeometric}, Hyp\operatorname{Hyp}, compact HH.
CasesBoth the letters and their order drift between sources — some write (N,n,K)(N, n, K), and software renames the slots outright — so the safe reading is by role, not position: find the population size, the success count, the draw count, and map them onto the source's letters before using any formula.
Do not confuseThe binomial's nn and kk. The lowercase pair means the same thing in both families, but the hypergeometric's capitals have no binomial counterpart — carrying KK into a binomial formula, or reading the binomial's nn as a population, crosses the with/without-replacement line the case system exists to guard.
P(X=k)=(Kk)(NKnk)(Nn)P(X{=}k) = \dfrac{\binom{K}{k}\binom{N-K}{n-k}}{\binom{N}{n}}
choose the successes, choose the failures, over all ways to choose the sample
Three coefficients tell the whole story: kk successes from the KK available, nkn{-}k failures from the NKN{-}K available, divided by every possible sample. The formula's loudest feature is an absence — no probability parameter appears: without replacement there is no fixed pp, and pure counting replaces it.
CasesWhen the population dwarfs the sample, p=K/Np = K/N emerges as a ratio and Hyp(N,K,n)Bin(n,K/N)\operatorname{Hyp}(N, K, n) \approx \operatorname{Bin}(n, K/N) — the binomial as the with-replacement limit; the variance's extra factor NnN1\tfrac{N-n}{N-1}, the finite-population correction, is the mark that measures exactly how far from that limit a given setup sits.
Do not confuseA product of probabilities. The three-coefficient fraction is counting, not multiplying chances — importing the binomial's pkqnkp^k q^{n-k} intuition here double-books the changing composition of the urn after every draw.
max(0,n(NK))kmin(n,K)\max(0,\, n - (N - K)) \le k \le \min(n, K)
k runs only where the draw is feasible: fenced below and above
The family's most intricate support clause: min(n,K)\min(n, K) fences the top — you cannot observe more successes than you drew, nor than exist — and max(0,n(NK))\max(0, n - (N-K)) fences the bottom — once the failures run out, further draws are forced to be successes. The clamps are the feasibility logic written as marks.
CasesThe family now shows three support styles side by side: the binomial's closed list k=0,,nk = 0, \ldots, n, the Poisson's open ellipsis, and the hypergeometric's computed clamps — reading the support line first is the fastest identification of which family a formula belongs to.
Do not confuseThe simple 0kn0 \le k \le n. Using the binomial's range silently assigns probability to impossible draws — the lower clamp in particular is routinely forgotten, and every formula summed over the wrong support quietly leaks mass.

Parameters


NN: total population size

KK: number of successes in the population

nn: number of draws (without replacement), where nNn≤N

The hypergeometric distribution models the number of successes in nn draws from a finite population of size NN that contains exactly KK 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.

Mode and Median

Mode


The mode is the value of kk (number of successes in the sample) with the highest probability—the peak of the PMF.

For the hypergeometric distribution, the mode depends on the parameters NN, KK, and nn:

The mode is (n+1)(K+1)N+2\lfloor \frac{(n+1)(K+1)}{N+2} \rfloor

Intuition: The mode sits near the expected value nKN\frac{nK}{N}, representing the most likely number of successes when sampling without replacement. Unlike the binomial where trials are independent, the hypergeometric mode reflects how depletion of the population affects the probability distribution.

Example:
For N=50N = 50, K=20K = 20, n=10n = 10:

Mode = (10+1)(20+1)50+2=11×2152=4.44=4\lfloor \frac{(10+1)(20+1)}{50+2} \rfloor = \lfloor \frac{11 \times 21}{52} \rfloor = \lfloor 4.44 \rfloor = 4

Getting exactly 4 successes is more likely than any other outcome.

Example:
For N=100N = 100, K=30K = 30, n=20n = 20:

Mode = 21×31102=6.38=6\lfloor \frac{21 \times 31}{102} \rfloor = \lfloor 6.38 \rfloor = 6

Median


The median is the value mm such that P(Xm)0.5P(X \leq m) \geq 0.5 and P(Xm)0.5P(X \geq m) \geq 0.5.

For the hypergeometric distribution, there is no simple closed-form expression for the median, but it can be found numerically by solving:

k=0m(Kk)(NKnk)(Nn)0.5\sum_{k=0}^{m} \frac{\binom{K}{k}\binom{N-K}{n-k}}{\binom{N}{n}} \geq 0.5


Properties of the median:
• The median is always close to the mean nKN\frac{nK}{N}
• For large NN, the hypergeometric approaches the binomial, and median behavior converges
• The distribution can be symmetric or skewed depending on parameters

Example:
For N=50N = 50, K=25K = 25, n=10n = 10:
Mean = 10×2550=5\frac{10 \times 25}{50} = 5

The median is 5 (by symmetry, since K=N/2K = N/2)

Example:
For N=100N = 100, K=30K = 30, n=20n = 20:
Mean = 20×30100=6\frac{20 \times 30}{100} = 6

The median is approximately 6 (close to the mean)

Unlike continuous distributions where finding the median requires integration, for discrete distributions, the median is found by summing probabilities until reaching 0.5.

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}.

Interactive Calculator


This interactive calculator computes probabilities for the hypergeometric distribution, which models sampling without replacement from a finite population. Enter your population size (NN), number of success items (KK), and sample size (nn) to calculate the probability of getting a specific number of successes in your sample. Ideal for card games, quality control sampling, lottery calculations, or any scenario where you're drawing items without putting them back.

1. Select probability type: 'All values' for full distribution, or choose a specific query like P(X=k) or P(X≤k)
2. Enter N (population size) - total items available
3. Enter K (success states) - how many items in population are 'successes'
4. Enter n (sample size) - how many items you're drawing
5. For specific queries, enter k (target successes in your sample)
6. Click Calculate to see probabilities and distribution

Hypergeometric Distribution Calculator

Calculate probabilities and distribution properties

Total number of items in population

Number of success items in population

Number of items drawn

,

Hypergeometric at a Glance

The table below collects the full anatomy of the hypergeometric distribution into a single reference card — its three parameters, support bounds, the PMF and CDF, the mean and variance formulas (including the finite-population correction), mode and median behavior, the binomial approximation, and a canonical card-drawing example.
Aspect Formula / statement Note / example
Parameters N (population size), K (successes in population), n (sample size, n ≤ N) draws are made without replacement; trials are not independent
Support k ∈ {max(0, n − N + K), ..., min(n, K)} bounded by physical availability of successes and failures
PMF P(X = k) = C(K, k) · C(N − K, n − k) / C(N, n) favorable combinations over total combinations (Vandermonde's identity)
CDF F(k) = ∑i ≤ k C(K, i) · C(N − K, n − i) / C(N, n) no closed form; computed numerically
Expected value E[X] = n · K / N sample size × population proportion of successes
Variance Var(X) = n · (K/N) · ((N − K)/N) · ((N − n)/(N − 1)) binomial variance with p = K/N times the finite-population correction
Finite population correction (N − n) / (N − 1) — always ≤ 1; → 0 as n → N shrinks variance vs binomial; full census has zero variability
Mode and median mode = ⌊(n + 1)(K + 1) / (N + 2)⌋; median ≈ mean, found numerically both sit near nK/N; symmetric when K = N/2
Binomial approximation Hypergeometric(N, K, n) ≈ Binomial(n, K/N) when N ≫ n rule of thumb: n < 0.05·N — depletion becomes negligible
Canonical example draw 5 cards from 52, count hearts: N = 52, K = 13, n = 5 E[X] = 1.25; P(X = 2) ≈ 0.274

Hypergeometric Distribution FAQ

Why is there no p in the hypergeometric formula?

+
Because without replacement there is no fixed success probability. Each draw changes the urn's composition, so the chance of a success depends on what came before — nothing constant is left for p to name. Pure counting replaces it: three coefficients, no probabilities. When the population dwarfs the sample, K/N emerges as an effective p and the binomial takes over.Read more →

What is the finite population correction?

+
The factor (N − n)/(N − 1) in the hypergeometric variance. It measures how far sampling without replacement departs from sampling with replacement: when the sample is a tiny fraction of the population it sits near 1 and the variance matches the binomial's; when n reaches N it hits 0 — sampling everything leaves nothing to vary.Read more →

What do N, K, n and k mean?

+
Case marks the level: capital N and K describe the population — its size and the successes it contains — while lowercase n and k describe the sample, its size and the successes observed. But letters and their order drift between sources, and software renames the slots outright. Read by role rather than position: find the population size, the success count, the draw count.Read more →

Why doesn't the hypergeometric support start at 0?

+
It often does, but not always. The lower bound is max(0, n − (N − K)): once the failures in the population run out, further draws are forced to be successes, so a minimum becomes unavoidable. The top is min(n, K) — you cannot observe more successes than you drew or than exist. Using the binomial's 0 to n assigns probability to impossible draws.Read more →