Interactive module guide
Hypergeometric Distribution Calculator & Guide
This hypergeometric distribution calculator lets you calculate probabilities for draws without replacement from a finite population of successes and failures.
Free · No sign-up · Calculations stay in your browser
The hypergeometric distribution models the number of successes in a sample of n items drawn without replacement from a finite population of N items containing K successes.
Because each draw removes an item, the trials are dependent, and the variance is smaller than the matching binomial variance by the finite-population correction (N−n)/(N−1).
Use this page to compute exact probabilities for quality-control acceptance sampling, card-drawing questions, and audit samples, and to see how quickly the model approaches the binomial once the population dwarfs the sample.
Is this the right module for my question?
Use it when
- Use it whenever sampling is genuinely without replacement from a finite, fixed population: inspecting a sample from a manufactured lot, drawing cards from a deck, or auditing invoices selected from a known file. The three parameters N, K, and n are all part of the design, not estimates.
- Use it for acceptance-sampling arithmetic: the probability that a sample of n contains at most c defectives, computed exactly from the lot size and assumed defective count, is the operating characteristic that sampling plans are built on.
- Use it for enrichment-style questions—whether a subset contains surprisingly many members of a category, as in gene-set enrichment or stratified audits—where the exact tail probability of the overlap count is the quantity of interest.
Choose another method when
- Avoid it when sampling is with replacement or the population is effectively infinite relative to the sample; the binomial model is then simpler and essentially identical. A common rule of thumb switches to the binomial when the sample is under 5–10% of the population.
- Avoid it when the population composition changes during sampling for reasons other than the draws themselves, such as ongoing production replacing inspected items; the fixed-N, fixed-K assumption fails.
- Avoid it when draws are not equally likely—stratified, clustered, or convenience samples give some items higher inclusion probability, and the exact hypergeometric arithmetic no longer describes the design.
Interactive tool
The calculator loads as you approach this section so the guide remains fast on mobile connections.
Example preview
Winning tickets in a small draw
- Inputs
- X ~ Hypergeometric(N=50, K=20, n=10); evaluate at most 4 winners.
- Representative result
- P(X≤4) ≈ 0.6450 for draws made without replacement.
Illustrative only. Load the interactive tool to enter your own values and review assumptions.
Watch the explanation
3:03 minThe player loads only after you press play. You can also watch on YouTube.
Read the complete transcript
The Hypergeometric Distribution. What changes when every sampled item is removed instead of returned before the next draw? A finite population has N items, K successes, and a without-replacement sample of size n. The feasible count starts at max zero, n plus K minus N, and ends at min n K. For X equals k, choose k successes and n minus k failures from the population. Divide those favorable samples by all size-n samples to obtain the exact point mass. Removing a success lowers the next success probability, creating negative dependence between draw indicators.
The mean remains n times K over N, matching a binomial with success share K over N. Variance equals the binomial variance times the finite-population correction, N minus n over N minus one. Sampling the whole population makes that correction zero, so the count becomes exactly K. As the population dwarfs the sample, the correction approaches one and binomial behavior returns. Complementing success labels sends K to N minus K and X to n minus X. The mode lies near the mean, while the median is the first integer CDF crossing. Larger sample fractions narrow the distribution even when n and the success share remain fixed.
Suppose fifty raffle tickets contain twenty winners, and ten tickets are drawn without replacement. The expected winner count is four, but finite-population dependence reduces variance below two. Exactly two winners has probability about point one zero eight three from the coefficient ratio. Summing masses through four gives point six four five zero, roughly sixty-five percent. Five winners is still below ninety-five-percent coverage, while six winners crosses it. The matching binomial variance is two point four, larger by the missing correction factor.
Acceptance sampling uses P of X at most c to evaluate a chosen lot composition. Fisher's exact test conditions on fixed margins, leaving one cell with a hypergeometric reference. Enrichment tests ask whether an observed overlap is unusually large under random subset sampling. Unequal inclusion probabilities break the ordinary formula, even if sampling still avoids replacement. Replenishing or changing the population during selection also violates fixed N and fixed K. Validate every parameter against the support, because impossible counts should receive exactly zero probability. The explorer evaluates known designs; estimating unknown population composition requires separate inferential methods. Report N, K, n, the without-replacement design, event endpoints, and exact probability. Explore finite-population probabilities and sampling tails free at Distri Scope dot com.
How to read the result
The finite-population correction (N−n)/(N−1) is the number to watch: at n=N it is zero—sampling the whole lot leaves no uncertainty—and it approaches one as N grows, recovering binomial behavior.
Compare the reported variance with the binomial value nK/N(1−K/N): the ratio between them is exactly the correction factor, a direct display of how much dependence between draws tightens the count.
The mode ⌊(n+1)(K+1)/(N+2)⌋ sits near the mean nK/N; large gaps between the two indicate a strongly truncated support rather than skew in the usual sense.
Inputs and parameter meaning
Three parameters: population size N, population successes K, and sample size n. They must satisfy K≤N and n≤N, and the calculator reports an error rather than a silent adjustment when a slider combination violates the constraints.
The support runs from max(0, n+K−N) to min(n, K): you cannot draw more successes than exist or than you draw in total, and if failures are scarce the sample must contain some successes. The chart shows exactly this range.
The interval calculator includes both endpoints, matching the discrete convention used across this site.
Formula and available parameters
Density or probability mass
Mean
Variance
- Population size (N): interactive range 2 to 500; default 50.
- Population successes (K): interactive range 1 to 500; default 20.
- Sample draws (n): interactive range 1 to 500; default 10.
What the method is doing
Masses are computed through logarithms of binomial coefficients, so populations up to ten thousand items are handled without overflow, and cumulative probabilities are exact sums over the finite support rather than approximations.
Quantiles are exact searches over the support against the exact CDF; the summary median is the quantile at one half.
The summary panel uses the closed-form moments: mean nK/N, variance nK/N(1−K/N)(N−n)/(N−1), the standard skewness formula, and the exact excess kurtosis, with the shape statistics reported only when N is large enough for their denominators to be defined.
Worked example: winning tickets in a small draw
A box holds N=50 raffle tickets of which K=20 are winners. A participant draws n=10 tickets without replacement and wants the expected number of winners, the probability of drawing exactly two, the probability of at most four, and a sense of how much the without-replacement design tightens the spread. Model the winner count as X~Hypergeometric(N=50, K=20, n=10).
- 1Read the summary: the mean is 10×20/50=4 winners, and the variance is 4×(30/50)×(40/49)≈1.959, giving a standard deviation of about 1.40.
- 2Use the point calculator at k=2: P(X=2)≈0.1083, the exact mass from the ratio of binomial coefficients C(20,2)C(30,8)/C(50,10).
- 3Read the cumulative value at 4: P(X≤4)≈0.6450, so about two thirds of such draws contain four or fewer winners.
- 4Compare with the binomial: with replacement the variance would be 10×0.4×0.6=2.4; the correction factor (50−10)/(50−1)=40/49≈0.816 shrinks it to 1.959, the dependence bonus of a finite lot.
Interpretation
Under the stated design the draw averages four winners with a standard deviation of 1.40, noticeably tighter than the 1.55 a with-replacement model would claim. The exact masses matter here because the population is small: a binomial approximation misstates individual probabilities by amounts that acceptance decisions and fairness claims can feel.
Common mistakes
- Do not use binomial formulas out of habit when the sample is a sizable fraction of the population; the variance overstatement grows with n/N, and tail probabilities inherit the error in the direction that overstates risk.
- Do not confuse K, the successes in the population, with k, the successes in the sample; the notation is close and the roles are entirely different.
- Do not apply the model to sequential processes where the population is replenished between draws—fixed N and K are structural assumptions, and their failure is invisible in the formulas.
Limits and independent validation
The calculator caps the population at ten thousand items; beyond that scale the binomial approximation is essentially exact anyway, and the exact combinatorial sums stop earning their cost.
The page computes design probabilities from known N, K, and n; the inverse problem—inferring K from an observed sample count, as in capture–recapture estimation—needs interval methods beyond this calculator.
Shape statistics are undefined for the smallest populations (skewness needs N≥3, kurtosis N≥4) and are shown as dashes there rather than as numbers.
Before using the result
- Verify the three design numbers against documentation: the lot size, the assumed defective count, and the sample size are inputs to a decision, and a transposed digit changes every probability. The support bounds shown on the chart are a quick sanity check.
- Recompute one small mass by hand from binomial coefficients, or check that all masses sum to one across the visible support; the exact arithmetic leaves no rounding excuse for a discrepancy.
- When the sample is under about 5% of the population, compare with the binomial page: results should nearly coincide, and a large gap indicates a parameter-entry error rather than a modeling effect.
Related modules and resources
Explore Other Probability Distributions
- Normal Distribution Calculator
- Binomial Distribution Calculator
- Poisson Distribution Calculator
- Exponential Distribution Calculator
- Gamma Distribution Calculator
- Beta Distribution Calculator
- Weibull Distribution Calculator
- Lognormal Distribution Calculator
- Continuous Uniform Distribution
- Student’s t Distribution
- Chi-Square Distribution
- F Distribution
- Bernoulli Distribution
- Geometric Distribution
- Negative Binomial Distribution
- Hypergeometric Distribution
- Cauchy Distribution
- Pareto Distribution
- Laplace Distribution
- Logistic Distribution
- Rayleigh Distribution
- Triangular Distribution
- Discrete Uniform Distribution
See every option in the Probability Distribution Explorer or review the DistriScope methodology. Educational information; last reviewed 2026-08-09. Verify consequential calculations independently.