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 Distribution— successes in nn draws without replacement
Binomial Distribution— the analogous model for sampling with replacement
Expected Value— E[X]=nK/NE[X] = nK/N
Variance— Var⁡(X)\operatorname{Var}(X) with finite population correction

See All Probability Definitions →


The Probabilistic Experiment Behind hypergeometric distribution

Counting successes in a fixed number of draws sounds like a job for the binomial distribution.
A bag holds 5 balls, 2 of them red. Draw 2 and count the reds. Each draw is red with chance 25\frac{2}{5}, there are 2 draws — so the natural move is a binomial with n=2n = 2 and p=25p = \frac{2}{5}.
If the balls are not put back, the binomial answers are wrong in every row.
Work out the real probabilities draw by draw and set them beside the binomial guess.
red balls in 2 drawsbinomial guess, p = 2/5actual, without replacement
0(3/5)² = 0.36(3/5)(2/4) = 0.30
12(2/5)(3/5) = 0.480.60
2(2/5)² = 0.16(2/5)(1/4) = 0.10
The failure was predictable: the binomial assumes every draw has the same chance, and here it does not.
Once a ball is out, the bag is different. A red first draw leaves fewer reds; a white one leaves relatively more. It is like a bag of sweets: once the red one is eaten, it cannot come out again. The warning sign is visible before any calculation — a small population, and draws that are not returned.
bag before the drawchance the next ball is red
first draw: 2 red, 3 white2/5 = 0.40
after a red: 1 red, 3 white1/4 = 0.25
after a white: 2 red, 2 white2/4 = 0.50
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.
The definition
The hypergeometric distribution is the distribution of the number of successes in nn draws without replacement from a population of NN items, KK of them successes: P(X=k)=(Kk)(N−Kn−k)(Nn)P(X = k) = \dfrac{\binom{K}{k}\binom{N-K}{n-k}}{\binom{N}{n}}.
So for the bag, N=5N = 5, K=2K = 2, n=2n = 2: P(X=2)=(22)(30)(52)=110P(X = 2) = \dfrac{\binom{2}{2}\binom{3}{0}}{\binom{5}{2}} = \dfrac{1}{10}, matching the table.
It counts successes in a sample, like the binomial — but the sample is taken from a fixed, shrinking stock.
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.
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.
Read backwards, the diagnosis is a test: the smaller the population compared with the sample, the more the binomial misleads.
With 5 balls, removing one changes the odds a lot. With thousands of items and a handful of draws, removing a few hardly changes anything, and the binomial becomes a good approximation. The section on variance compares the two side by side.
The rest of the page covers the notation, the parameters, the PMF and CDF, the mean, variance, mode and median, and further properties.

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.
X∼Hyp⁡(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)(N−Kn−k)(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, n−kn{-}k failures from the N−KN{-}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 N−nN−1\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 pkqn−kp^k q^{n-k} intuition here double-books the changing composition of the urn after every draw.
max⁡(0, n−(N−K))≤k≤min⁡(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−(N−K))\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 0≤k≤n0 \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.
DownloadPNG2×PDF
Notation · Cheat sheet
Distribution Notation at a Glance
The marks from the notation cards across the distribution pages: how each is read and what it means. Every group links to the full card on its page.
Distributions
(Ω,F,P)(\Omega, \mathcal{F}, \mathbb{P})
a probability space
Outcomes, events, and the probability measure.
PX(A)\mathbb{P}_X(A)
the distribution of X
Equals P(X∈A)\mathbb{P}(X \in A).
X=dYX \overset{d}{=} Y
equal in distribution
Same law, not necessarily the same values.
Binomial
X∼Bin⁡(n,p)X \sim \operatorname{Bin}(n, p)
binomial, n trials, p
The number of successes in nn independent trials.
q=1−pq = 1 - p
q, the failure probability
An abbreviation, not a new parameter.
Geometric
Geom⁡(p)\operatorname{Geom}(p)
geometric with p
Two conventions: count trials, or count failures.
qk−1pq^{k-1}p vs qkpq^k p
the two pmfs
The exponent shows which convention is in use.
Negative binomial
NB⁡(r,p)\operatorname{NB}(r, p)
negative binomial
Trials until the rr-th success.
k=r,r+1,…k = r, r{+}1, \ldots
the support starts at r
Fewer trials cannot hold rr successes.
HypergeometricThis page
Hyp⁡(N,K,n)\operatorname{Hyp}(N, K, n)
hypergeometric
Population NN with KK successes; nn draws without replacement.
(Kk)(N−Kn−k)(Nn)\frac{\binom{K}{k}\binom{N-K}{n-k}}{\binom{N}{n}}
the pmf
Successes chosen, failures chosen, over all samples.
Poisson
Pois⁡(λ)\operatorname{Pois}(\lambda)
Poisson with rate lambda
Counts of events in a window.
λ\lambda
lambda
The expected count per window; it depends on the window size.
Discrete uniform
DU⁡(a,b)\operatorname{DU}(a, b)
discrete uniform
Each integer from aa to bb equally likely.
1b−a+1\frac{1}{b - a + 1}
one over the count
The +1+1 counts both endpoints.
Continuous uniform
X∼U(a,b)X \sim U(a, b)
uniform from a to b
The slots are the endpoints, not a centre and a spread.
1b−a\frac{1}{b - a}
one over the width
A flat density; no +1+1 here.
Exponential
Exp⁡(λ)\operatorname{Exp}(\lambda)
exponential with rate lambda
Some books put the scale β=1λ\beta = \frac{1}{\lambda} in the slot.
P(X>x)=e−λxP(X > x) = e^{-\lambda x}
the survival tail
The chance of waiting longer than xx.
Normal
N(μ,σ2)N(\mu, \sigma^2)
normal, mean mu
Second slot: usually the variance; some texts use σ\sigma.
Z∼N(0,1)Z \sim N(0, 1)
capital Z, standard normal
A score z=x−μσz = \frac{x - \mu}{\sigma} counts standard deviations.
φ(z),  Φ(z)\varphi(z), \; \Phi(z)
phi; capital Phi
The standard normal density and its CDF.
Same marks, different job
N(μ,σ2)N(\mu, \sigma^2)Check whether the second slot is the variance or the standard deviation.
Exp⁡(λ)\operatorname{Exp}(\lambda)Rate or scale: the two readings give means 1λ\frac{1}{\lambda} and λ\lambda.
U(a,b)U(a, b) vs DU⁡(a,b)\operatorname{DU}(a, b)Width b−ab - a against a count of b−a+1b - a + 1 values.
Φ\Phi vs φ\varphiCapital is the CDF, lowercase the density.
Distribution Notation at a Glance·/probability/distributionsLearn Math Class

Parameters


NN: total population size

KK: number of successes in the population

nn: number of draws (without replacement), where n≤Nn≤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:

Hypergeometric PMF
P(X=k)=(Kk)(N−Kn−k)(Nn),k=max⁡(0,n−N+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)
Learn more about this formula: Hypergeometric PMF →


where (ab)=a!b!(a−b)!\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,n−N+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: n−k≤N−Kn-k \leq N-K
* The upper bound ensures we don't draw more successes than available: k≤Kk \leq K and k≤nk \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
* (N−Kn−k)\binom{N-K}{n-k}: The number of ways to choose n−kn-k failures from N−KN-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,n−N+K)min⁡(n,K)P(X=k)=∑k=max⁡(0,n−N+K)min⁡(n,K)(Kk)(N−Kn−k)(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)(N−Kn−k)(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]=n⋅KNE[X] = n \cdot \frac{K}{N} and the variance is Var(X)=n⋅KN⋅(1−KN)⋅N−nN−1\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.

0.0000.0600.1200.1800.2400.300012345678910Value (k)Probability P(X = k)
Hypergeometric PMF, N = 50, K = 20, n = 10

The bars count successes in 10 draws without replacement from a population of 50 that holds 20 successes; the peak is at 4, the value of nK over N, and the bars vanish beyond the smaller of n and K. Each height is a ratio of binomial coefficients. Change N, K and n and watch the range and the peak move on the PMF visualizer.

Summing the bars from the left gives the CDF.

Cumulative Distribution Function (CDF)


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

    Cumulative Distribution Function (CDF)
    FX(k)=P(X≤k)=∑i=0k(Ki)(N−Kn−i)(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,n−N+K)≤k≤min⁡(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:

    Cumulative Distribution Function (CDF)
    P(X≤k)=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:
  • Minimum: max⁡(0,n−N+K)\max(0, n-N+K) (can't draw more failures than exist)
  • Maximum: 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":

    Cumulative Distribution Function (CDF)
    P(X>k)=1−FX(k)P(X > k) = 1 - F_X(k)

    Pitfall: Treating at least as more than
    For at least one ace in a five-card hand, writing 1−FX(1)1 - F_X(1) also removes the hands with exactly one ace, giving P(X≥2)≈0.042P(X \geq 2) \approx 0.042. The right cut is 1−FX(0)≈0.3411 - F_X(0) \approx 0.341.

    The complement rule above covers one wording, and questions use several: "more than", "at least", "fewer than" and "at most". The count of successes takes only whole-number values, so each wording keeps a different set of counts, and the complement keeps the counts on the other side of that line. The CDF is then read at the last count that falls outside the event.

Hypergeometric Distribution CDF

CDF for sampling without replacement

CDF Explanation

The hypergeometric CDF is F(k)=P(X≤k)=∑i=0k(Ki)(N−Kn−i)(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−(N−K))≤k≤min⁡(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.
0.00.20.40.60.81.0012345678910Value (k)Cumulative Probability F(k)
Hypergeometric CDF, N = 50, K = 20, n = 10

The staircase accumulates the PMF and reaches 1 at the last possible count. It sits close to the binomial staircase with p equal to K over N, and the two merge as N grows because drawing without replacement then barely changes the odds. Compare it with the binomial step pattern on the discrete CDF explorer.

The expected value below is the same as the binomial one.

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:

Expected Value (Discrete)
E[X]=∑xx⋅P(X=x)E[X] = \sum_{x} x \cdot P(X = x)
Learn more about this formula: Expected Value (Discrete) →


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

Formula


Hypergeometric Mean
E[X]=n⋅KNE[X] = n \cdot \frac{K}{N}
Learn more about this formula: Hypergeometric Mean →


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

THEOREM
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:

Hypergeometric Mean
E[X]=n⋅KNE[X] = n \cdot \frac{K}{N}
Learn more about this formula: Hypergeometric Mean →


Did you know: Counting a lake's fish by tagging
Ecologists tag K=100K = 100 fish and release them; a later catch of n=50n = 50 holds k=5k = 5 tagged ones. Setting 5=50⋅100N5 = 50 \cdot \frac{100}{N} estimates the lake at N=1000N = 1000 fish, without catching them all.

The result E[X]=n⋅KNE[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 n⋅KNn \cdot \frac{K}{N} successes on average.

The same relation can be read in the other direction. In some studies the population size NN is the unknown, while the number of marked items KK and the sample size nn are chosen in advance and the number of marked items in the sample is observed. Since that count tends to land near its mean, a single sample already says something about the size of the whole population.

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:

Expected Value (Mean)
E[X]=5⋅452=2052≈0.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.

To compute the expected value of a hypergeometric distribution for your own parameters, step by step, use the hypergeometric expected value calculator.

Draws without replacement depend on each other, yet the sample's expected share of successes is exactly the population's share.

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:

Variance and Standard Deviation
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:

Variance and Standard Deviation
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


Hypergeometric Variance
Var(X)=n⋅KN⋅N−KN⋅N−nN−1\mathrm{Var}(X) = n \cdot \frac{K}{N} \cdot \frac{N-K}{N} \cdot \frac{N-n}{N-1}
Learn more about this formula: Hypergeometric Variance →


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 μ=n⋅KN\mu = n \cdot \frac{K}{N}.

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

Variance and Standard Deviation
Var(X)=n⋅KN⋅(1−KN)⋅N−nN−1\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 n⋅KN⋅(1−KN)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 N−nN−1\frac{N-n}{N-1} is called the finite population correction and is less than 1 whenever n>1n > 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


Variance and Standard Deviation
σ=n⋅KN⋅N−KN⋅N−nN−1\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:

Variance and Standard Deviation
Var(X)=5⋅452⋅4852⋅4751\mathrm{Var}(X) = 5 \cdot \frac{4}{52} \cdot \frac{48}{52} \cdot \frac{47}{51}

Variance and Standard Deviation
=5⋅113⋅1213⋅4751≈0.327= 5 \cdot \frac{1}{13} \cdot \frac{12}{13} \cdot \frac{47}{51} \approx 0.327

Variance and Standard Deviation
σ≈0.327≈0.572\sigma \approx \sqrt{0.327} \approx 0.572

Pitfall: Leaving out the correction factor
Dropping 4751\frac{47}{51} gives the binomial variance 5⋅113⋅1213=60169≈0.3555 \cdot \frac{1}{13} \cdot \frac{12}{13} = \frac{60}{169} \approx 0.355, too large for cards that are not put back. With the factor, Var(X)≈0.33\mathrm{Var}(X) \approx 0.33.

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.
Drawing 10 from 20 items with 8 successes, without replacement, against the binomial with p = 0.4: same mean 4, narrower spreadky12345678910blue: binomial, n = 10, p = 0.4amber: 10 of N = 20, K = 8same mean 4variance 2.4 vs 1.26Without replacement the counts bunch closer to the mean
Without replacement against with replacement

Ten draws from a population of 20 items, 8 of them successes. Amber bars: drawing without replacement (hypergeometric). Blue bars: the binomial with the same n = 10 and p = 8/20 = 0.4, as if each item were put back. Both have mean 4, but the amber bars are taller in the middle and thinner in the tails: the variance falls from 2.4 to 2.4 · (20 − 10)/(20 − 1) ≈ 1.26.

The factor (N − n)/(N − 1) is the whole difference: here 10/19, about one half.

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

Did you know: A ticket most likely matches nothing
In a 6-from-49 lottery (N=49N = 49, K=n=6K = n = 6) the mode is ⌊7⋅751⌋=0\lfloor \frac{7 \cdot 7}{51} \rfloor = 0: a ticket matches none of the drawn numbers 43.6% of the time, and all six once in 13,983,816 tickets.

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.

A lottery draw fits this setting directly. The draw picks the winning numbers, which play the role of the KK successes among the NN numbers on offer, and a ticket is a sample of nn numbers chosen without repeats. The number of matches on the ticket is then a hypergeometric count, and the mode formula applies to it as to any other choice of NN, KK and nn.

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(X≤m)≥0.5P(X \leq m) \geq 0.5 and P(X≥m)≥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:

Mode and Median
∑k=0m(Kk)(N−Kn−k)(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:

Applications and Examples
P(X=2)=(132)(52−135−2)(525)=(132)(393)(525)=78⋅91392598960≈0.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

Pitfall: Treating the draws as independent
Using the binomial with p=1352=14p = \frac{13}{52} = \frac{1}{4} gives (52)(0.25)2(0.75)3≈0.264\binom{5}{2}(0.25)^2(0.75)^3 \approx 0.264, as if each card went back. Without replacement the count of hands gives P(X=2)≈0.274P(X = 2) \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.

Each heart that is drawn leaves one fewer heart in the deck, so the chance of a heart on the next card depends on the cards already drawn. The three binomial coefficients count whole hands instead of multiplying chances draw by draw, and that is how the formula keeps track of the shrinking 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

,

Related Distributions


The hypergeometric distribution belongs to sampling without replacement. Its relatives come from putting the items back, from drawing a single item, from sorting the population into more than two kinds, or from drawing until a target is met.

Binomial: the same sample with replacement


Put each item back before the next draw and the draws become independent, each a success with probability p=KNp = \frac{K}{N}. The count of successes is then binomial. Both distributions have the mean n⋅KNn \cdot \frac{K}{N}; the hypergeometric variance is smaller by the factor N−nN−1\frac{N-n}{N-1}. As the population grows with the share of successes held at pp, that factor goes to 11 and the probabilities agree:

Related Distributions
(Kk)(N−Kn−k)(Nn)→(nk)pk(1−p)n−kas N→∞ with KN=p\frac{\binom{K}{k}\binom{N-K}{n-k}}{\binom{N}{n}} \to \binom{n}{k} p^k (1-p)^{n-k} \quad \text{as } N \to \infty \text{ with } \frac{K}{N} = p

For 55 cards from a deck of 5252 the two already differ only a little: two hearts have probability about 0.2740.274 without replacement and 0.2640.264 with it.

Bernoulli: a single draw


With n=1n = 1 the sample is one item, a success with probability KN\frac{K}{N}, which is a Bernoulli trial. The same holds for every single draw of a larger sample when it is looked at on its own: the third card dealt is a heart with probability 1352\frac{13}{52}, like the first. The draws depend on one another, but each has the same chance of success, and that is why the mean is n⋅KNn \cdot \frac{K}{N}.

Multivariate hypergeometric: more than two kinds


Let the population hold mm kinds of item, K1,K2,…,KmK_1, K_2, \ldots, K_m of each, with K1+⋯+Km=NK_1 + \cdots + K_m = N. The chance that a sample of nn holds k1k_1 of the first kind, k2k_2 of the second, and so on, is

Related Distributions
P(X1=k1,…,Xm=km)=(K1k1)(K2k2)⋯(Kmkm)(Nn)P(X_1 = k_1, \ldots, X_m = k_m) = \frac{\binom{K_1}{k_1}\binom{K_2}{k_2} \cdots \binom{K_m}{k_m}}{\binom{N}{n}}

where k1+⋯+km=nk_1 + \cdots + k_m = n. A 55-card hand with exactly two hearts, two spades and one card of another suit has probability (132)(132)(261)(525)=1581842598960≈0.061\frac{\binom{13}{2}\binom{13}{2}\binom{26}{1}}{\binom{52}{5}} = \frac{158184}{2598960} \approx 0.061. The ordinary hypergeometric is the case m=2m = 2: successes and everything else.

Negative hypergeometric: drawing until a target is met


Fix the number of successes wanted, rr, and draw without replacement until they have all appeared. The number of draws follows the negative hypergeometric distribution. It stands to the hypergeometric as the negative binomial stands to the binomial: the first of each pair fixes the successes and counts draws, the second fixes the draws and counts successes.

Of these, the binomial link is used most: when the sample is a small part of the population, the simpler binomial formula can stand in for the hypergeometric one.

Hypergeometric at a Glance

This summary gathers the hypergeometric distribution on one card of ten rows. Each row names one part of the distribution with a line on what it gives and a link to the section that explains it, then states the formula or fact and adds a note or a worked number.

The first rows fix the setup: the population size, the successes it holds, the sample size, and the counts a sample can contain. Then come the probability of an exact count, the running total up to a count, the mean, the variance and the correction factor that sampling without replacement brings, and the mode and median. The last rows give the binomial approximation for large populations and the card-drawing example.
DownloadPNG2×PDF
AspectFormula or statementNote or example
ParametersThe three counts that fix the distribution, as the parameters section explains.NN, the population size; KK, the successes in the population; nn, the sample size, with n≤Nn \leq Ndraws are made without replacement; trials are not independent
SupportThe numbers of successes a sample can hold, set out with the PMF and its support.k∈{max⁡(0,n−N+K),…,min⁡(n,K)}k \in \{\max(0, n - N + K), \ldots, \min(n, K)\}bounded by the physical availability of successes and failures
PMFThe probability of exactly kk successes in the sample, built from counting in the PMF section.P(X=k)=(Kk)(N−Kn−k)(Nn)\displaystyle P(X = k) = \frac{\binom{K}{k} \binom{N-K}{n-k}}{\binom{N}{n}}favorable combinations over total combinations (Vandermonde's identity)
CDFThe probability of at most kk successes, from the CDF section.FX(k)=P(X≤k)=∑i=0k(Ki)(N−Kn−i)(Nn)\displaystyle F_X(k) = P(X \leq k) = \sum_{i=0}^{k} \frac{\binom{K}{i}\binom{N-K}{n-i}}{\binom{N}{n}}no closed form; computed numerically
Expected valueThe average number of successes in the sample, derived in the expected value section.E[X]=n⋅KN\displaystyle E[X] = n \cdot \frac{K}{N}sample size times the population proportion of successes
VarianceHow widely the count of successes spreads, worked out in variance and standard deviation.Var(X)=n⋅KN⋅N−KN⋅N−nN−1\displaystyle \mathrm{Var}(X) = n \cdot \frac{K}{N} \cdot \frac{N-K}{N} \cdot \frac{N-n}{N-1}the binomial variance with p=K/Np = K/N, times the finite population correction
Finite population correctionThe factor that accounts for sampling without replacement, explained in variance and standard deviation.N−nN−1\displaystyle \frac{N-n}{N-1}, always at most 11; it goes to 00 as n→Nn \to Nshrinks the variance compared with the binomial; a full census has zero variability
Mode and medianThe most likely count and the middle of the distribution, found in mode and median.Mode=⌊(n+1)(K+1)N+2⌋\displaystyle \text{Mode} = \left\lfloor \frac{(n+1)(K+1)}{N+2} \right\rfloor; the median is close to the mean and found numericallyboth sit near nK/NnK/N; symmetric when K=N/2K = N/2
Binomial approximationA small sample from a large population behaves almost as if each item went back, as applications and examples notes.Hyp⁡(N,K,n)≈Bin⁡(n,K/N)\operatorname{Hyp}(N, K, n) \approx \operatorname{Bin}(n, K/N) when N≫nN \gg nrule of thumb: n<0.05⋅Nn < 0.05 \cdot N, when depletion becomes negligible
Canonical exampleThe card-drawing setting worked through in applications and examples.draw 5 cards from 52 and count the hearts: N=52N = 52, K=13K = 13, n=5n = 5E[X]=1.25E[X] = 1.25; P(X=2)≈0.274P(X = 2) \approx 0.274
Hypergeometric distribution at a glance·All probability formulasLearn Math Class
Every probability here is a count of hands: favorable choices of successes and failures over all possible samples. The correction factor is the one thing that separates the variance from the binomial one, and it fades as the population grows large next to the sample.

Common Pitfalls

Three mistakes come up again and again in hypergeometric problems. Each one is marked where it happens in the sections above; here each is worked through in full, with the wrong and the right working side by side.
DownloadPNG2×PDF
1Treating at least as more than
The question asks for at least kk successes, and the complement rule for more than kk is used, so the CDF is read at kk instead of at k−1k - 1.
Wrong turn
Error here
For at least one ace in a five-card hand (N=52N = 52, K=4K = 4, n=5n = 5),
P(X≥1)=1−FX(1)P(X \geq 1) = 1 - F_X(1)

≈1−(0.659+0.299)=0.042\approx 1 - (0.659 + 0.299) = 0.042
Right path
At least one ace means 11, 22, 33 or 44 aces, so the complement is a hand with no ace at all.
P(X≥1)=1−FX(0)P(X \geq 1) = 1 - F_X(0)

=1−(485)(525)=1−17123042598960= 1 - \frac{\binom{48}{5}}{\binom{52}{5}} = 1 - \frac{1712304}{2598960}

≈0.341\approx 0.341
Why it happensThe rules 1−FX(k)1 - F_X(k) and 1−FX(k−1)1 - F_X(k-1) differ by a single symbol, and for continuous variables the difference between >> and ≥\geq never matters, so the habit of ignoring it carries over.
How to checkThe event contains the hands with exactly one ace, and those alone have probability 4⋅(484)(525)=7783202598960≈0.299\frac{4 \cdot \binom{48}{4}}{\binom{52}{5}} = \frac{778320}{2598960} \approx 0.299. An answer below that, such as 0.0420.042, cannot be right.
2Leaving out the correction factor
The variance of a sample drawn without replacement is computed with the binomial formula np(1−p)np(1-p) and p=KNp = \frac{K}{N}, and the factor N−nN−1\frac{N-n}{N-1} is left out.
Wrong turn
Error here
For the number of aces in five cards,
Var(X)=5⋅452⋅4852=60169≈0.355\mathrm{Var}(X) = 5 \cdot \frac{4}{52} \cdot \frac{48}{52} = \frac{60}{169} \approx 0.355
Right path
The cards are not put back, so the finite population correction applies.
Var(X)=60169⋅4751=9402873\mathrm{Var}(X) = \frac{60}{169} \cdot \frac{47}{51} = \frac{940}{2873}

≈0.33\approx 0.33
Why it happensThe mean n⋅KNn \cdot \frac{K}{N} is the same as the binomial mean with p=KNp = \frac{K}{N}, so it is natural to expect the variance to match as well. Only the variance feels the dependence between the draws.
How to checkTake the whole population as the sample, n=Nn = N. Drawing all 5252 cards always gives 44 aces, so the variance must be 00. The correction factor 52−5251\frac{52-52}{51} gives exactly 00, while the binomial formula gives 52⋅113⋅1213=4813≈3.6952 \cdot \frac{1}{13} \cdot \frac{12}{13} = \frac{48}{13} \approx 3.69.
3Treating the draws as independent
The probability of kk successes in draws without replacement is computed with the binomial formula, as if every draw had the same chance KN\frac{K}{N} whatever came before.
Wrong turn
Error here
For exactly 22 hearts in 55 cards, with p=1352=14p = \frac{13}{52} = \frac{1}{4},
P(X=2)=(52)(0.25)2(0.75)3P(X = 2) = \binom{5}{2} (0.25)^2 (0.75)^3

=10⋅0.0625⋅0.421875= 10 \cdot 0.0625 \cdot 0.421875

≈0.264\approx 0.264
Right path
Count the hands.
P(X=2)=(132)(393)(525)P(X = 2) = \frac{\binom{13}{2} \binom{39}{3}}{\binom{52}{5}}

=78⋅91392598960≈0.274= \frac{78 \cdot 9139}{2598960} \approx 0.274
Why it happensThe binomial formula is usually learned first, and a question with a fixed number of draws and a success rate of 14\frac{1}{4} looks like a binomial question on the surface. Whether the cards go back is easy to overlook.
How to checkLook at an extreme count, where the gap is largest. For five hearts in five cards the binomial gives (0.25)5≈0.00098(0.25)^5 \approx 0.00098, while the count of hands gives (135)(525)=12872598960≈0.00050\frac{\binom{13}{5}}{\binom{52}{5}} = \frac{1287}{2598960} \approx 0.00050, about half as much: each heart drawn makes the next one less likely.
Common pitfalls with the hypergeometric distribution·/probability/distributions/discrete/hypergeometricLearn Math Class
Each slip miscounts the event or treats the draws as if each item went back. At least kk includes kk itself, the variance carries the correction factor N−nN−1\frac{N - n}{N - 1}, and the chance on each draw changes as items are removed. Taking the whole population as the sample, or looking at an extreme count, catches each slip.

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 →

How do you estimate a population size by capture and recapture?

+
Tag KK animals and release them, then catch nn and count the tagged ones, kk. The count has mean n⋅KNn \cdot \frac{K}{N}, so setting k=n⋅KNk = n \cdot \frac{K}{N} and solving gives N≈nKkN \approx \frac{nK}{k}. With 100100 fish tagged and 55 tagged fish in a later catch of 5050, the lake holds about 50⋅1005=1000\frac{50 \cdot 100}{5} = 1000 fish. The estimate assumes the tagged fish mix back in and are as easy to catch as the rest.Read more →

Does every draw have the same chance of success without replacement?

+
Yes, before anything is seen: each draw on its own is a success with probability KN\frac{K}{N}; only the chances given earlier draws change. In the bag with 2 red balls out of 5, the second draw is red with probability 25⋅14+35⋅24=25\frac{2}{5} \cdot \frac{1}{4} + \frac{3}{5} \cdot \frac{2}{4} = \frac{2}{5}, the same as the first. That is why the mean n⋅KNn \cdot \frac{K}{N} matches the binomial's, while the variance, which feels the dependence, does not.Read more →

What are the chances of matching numbers in a 6-from-49 lottery?

+
The number of matches on a ticket is hypergeometric with N=49N = 49, K=6K = 6, n=6n = 6, and the most likely result is none: a ticket matches no drawn number about 43.6% of the time and exactly one about 41.3%. Three matches come up about 1.8% of the time, and all six once in (496)=13,983,816\binom{49}{6} = 13{,}983{,}816 tickets. The mode formula agrees: ⌊7⋅751⌋=0\lfloor \frac{7 \cdot 7}{51} \rfloor = 0.Read more →