Hypergeometric Distribution Calculator (PMF, CDF, FPC)
Hypergeometric distribution calculator: PMF, CDF, survival, moments, comparison with binomial, finite population correction FPC, Fisher exact test 2x2.
Report a calculation error
Help us improve. Describe what is wrong with the calculation.
Result
| Voce | Valore |
|---|
Show full details
Share result
Disclaimer: this calculation is for informational purposes only. For important decisions, consult a qualified professional.
Hypergeometric distribution: definition
Models the number of successes in n draws WITHOUT REPLACEMENT from finite population of N elements (K successes, N-K failures). Differs from binomial (with replacement) by dependent draws.
PMF: P(X = k) = C(K, k) C(N-K, n-k) / C(N, n) for k in [max(0, n-(N-K)), min(n, K)]
Parameters
- N: total population size.
- K: successes in population (0 <= K <= N).
- n: sample size (1 <= n <= N).
- k: observed successes in sample.
Numerical example
Urn with N=50 balls, K=10 black, 40 white. Draw n=12 without replacement. P(X=3 black) = C(10,3) C(40,9) / C(50,12) = 0.270. Mean = 2.4, SD = 1.219.
Moments
- Mean: nK/N.
- Variance: nK(N-K)(N-n) / (N^2 (N-1)).
- FPC = (N-n)/(N-1): finite population correction. n << N: FPC ~ 1 (binomial). n = N: FPC = 0 (degenerate).
Connection with binomial
For N -> infinity with p = K/N fixed: hypergeometric -> binomial. Rule: n/N binomial OK. Hypergeometric variance is always smaller (FPC < 1).
Special cases
- K = 0: P(X=0) = 1.
- K = N: P(X=n) = 1.
- n = 1: Bernoulli with p = K/N.
- n = N: degenerate (X = K).
- K = N/2 small n: nearly symmetric.
Fisher exact test
For 2x2 contingency tables. Under H0 (no association): cell count is hypergeometric. p-value = P(X >= a | margins fixed). Exact (not asymptotic), preferred to chi-square for small expected frequencies.
Applications
- Quality control: lot acceptance sampling.
- Capture-recapture (ecology): population estimation Lincoln-Petersen.
- Lotteries: combination probabilities.
- Medical: Fisher exact tests.
- Genetics: rare individual sampling.
- Surveys: finite population sampling.
- Card games: poker, bridge probabilities.
- A/B testing: small samples.
Generalizations
- Multivariate hypergeometric: c categories.
- Negative hypergeometric: draws to k successes.
- Beta-binomial: variable probability limit.
- Wallenius non-central: biased draws.
Capture-recapture
Capture K animals, mark, release. Capture n later, count k marked. Lincoln-Petersen: N_est = Kn/k. Chapman (less biased): (K+1)(n+1)/(k+1) - 1. Assumes closed population, no mark effect, homogeneous catchability.
History
Laplace (1812): first systematic study. Pearson (1899): formal analysis. Fisher (1922-1935): exact test for 2x2 tables. Lincoln (1930), Petersen (1896): capture-recapture. Chapman (1951): bias correction.
Calculator modes
Five modes: PMF, CDF, survival, moments with FPC, comparison with binomial. Computation via log factorials for numerical stability.
Fisher's exact test and 2x2 contingency tables
One of the most important uses of the hypergeometric distribution is not to compute a probability directly but to test an association. Arrange the outcomes of a small study in a two-by-two table, say a treatment versus a control against a success versus a failure, and ask whether the two rows differ more than chance allows. Under the null hypothesis that the row and column totals carry no relationship, the count in any single cell follows exactly a hypergeometric distribution, because fixing the margins is equivalent to drawing without replacement from a finite pool. This is the foundation of Fisher's exact test.
The test earns its name because it gives an exact probability rather than an approximation. Summing the hypergeometric probabilities of all tables as extreme or more extreme than the observed one yields a p-value without relying on the large-sample assumptions behind the chi-square test, which is why it is the standard choice when counts are small. Ronald Fisher devised it in the 1920s, famously illustrating it with the lady tasting tea, and it remains indispensable in medicine, genetics and any field where a contingency table must be judged on a handful of observations.
Sampling without replacement: quality control and games
The defining feature of the hypergeometric distribution is that each draw changes what remains, and nowhere is this more practical than in acceptance sampling. To decide whether to accept or reject a production lot, an inspector pulls a sample of n items from a batch of N and counts the defectives. Because the items are not returned, the exact probability of passing depends on the hypergeometric law, and quality engineers use it to design sampling plans that hold both the producer's and the consumer's risk to agreed limits. Treating the problem as binomial would overstate the confidence whenever the sample is a sizeable fraction of the lot.
Games of chance are the other everyday home of the distribution. The probability of drawing a given number of aces in a poker hand, of matching several numbers on a lottery ticket, or of holding a certain count of one suit in bridge are all hypergeometric, since cards and tickets are drawn without replacement. Comparing the hypergeometric result with the binomial one makes the effect of replacement concrete: removing each drawn item tightens the distribution around its mean, an adjustment captured by the finite-population correction factor, which shrinks the variance by the ratio of remaining to total population.
Updated July 2026
Comments (0)
Login to leave a comment.
No comments yet. Be the first!