1 Introduction to the Hypergeometric Distribution
1.1 Basic scenario: urn sampling without replacement
The hypergeometric distribution describes the randomness in how many “successes” occur when a fixed number of items are drawn from a finite collection where success and failure types are present in known quantities. The defining feature is that drawing is performed without replacement, so the composition of what remains changes after each draw. This mechanism creates dependence between draws: early results affect the chances of later results.
1.2 Definition of success, population size, and sample size
To use the model, the finite population is partitioned into two categories: successes and failures. The population size is denoted by \(N\), the total number of successes in the population by \(K\), and the sample size (number of draws) by \(n\). The random variable of interest, commonly written as \(X\), counts the number of successes observed in the sample.
1.3 When to use it (vs. with-replacement models)
The hypergeometric model is appropriate when sampling is truly without replacement or when the finite population is small enough that depletion effects are non-negligible. If items were instead sampled independently with replacement (so each draw has the same success probability), a binomial model would typically be more suitable. A practical rule is that hypergeometric reasoning is favored when the population is limited and the sampling fraction \(n/N\) is not tiny.
2 Probability Model
2.1 Parameters and notation (N, K, n)
2.1.1 Interpreting K as the number of successes in the population
The parameter \(K\) represents the count of success-type items available before sampling begins. Its value fixes the overall prevalence of successes within the finite population. For example, in an urn containing \(N\) balls with \(K\) labeled as “success,” the hypergeometric distribution models how many of those \(K\) are picked in a draw of size \(n\).
2.1.2 Interpreting n as the number of draws taken
The parameter \(n\) is the number of items selected from the population. Because sampling is without replacement, \(n\) cannot exceed \(N\). The sample size determines how many items are removed from the urn and therefore strongly influences both the range of possible success counts and their probabilities.
2.2 Support (feasible values of the random variable)
2.2.1 Determining the minimum and maximum possible successes
Let \(X\) be the number of successes in the sample. The support is constrained by two bottlenecks: you cannot draw more than the available successes \(K\), and you cannot draw fewer than what must be successes because of limited failures. Concretely, the minimum feasible value is \[ \max(0,\, n-(N-K)), \] since if there are only \(N-K\) failures available, drawing \(n\) items forces at least \(n-(N-K)\) of them to be successes. The maximum feasible value is \[ \min(K,\, n), \] since you cannot exceed either the number of successes in the urn or the number of draws.
2.3 Probability mass function (PMF)
2.3.1 Deriving the PMF using combinations
The hypergeometric PMF gives the probability of observing exactly \(x\) successes: \[ \Pr(X=x)=\frac{\binom{K}{x}\binom{N-K}{n-x}}{\binom{N}{n}}, \] for all integers \(x\) in the feasible range. The numerator counts the ways to choose \(x\) successes from the \(K\) available and \(n-x\) failures from the \(N-K\) failures. The denominator counts all possible sets of \(n\) drawn items from the population.
3 Properties and Interpretation
3.1 Mean (expected number of successes)
The expected number of successes is \[ \mathbb{E}[X]=n\frac{K}{N}. \] This mirrors the intuitive proportion idea: on average, the sample reflects the success rate \(K/N\) of the full population. The without-replacement mechanism affects higher-order behavior, but the first moment retains the same form as a binomial model would use if the success probability were \(K/N\).
3.2 Variance and spread
The variance is \[ \mathrm{Var}(X)=n\frac{K}{N}\left(1-\frac{K}{N}\right)\frac{N-n}{N-1}, \] for \(N>1\). Compared with the binomial variance using \(p=K/N\), the factor \((N-n)/(N-1)\) reduces spread when sampling fraction is substantial. This reduction reflects the fact that once some items are drawn, remaining composition becomes less uncertain than in a with-replacement setting.
3.3 Factorial moments and combinatorial viewpoint
Factorial moments provide another perspective on the distribution’s combinatorial structure. For instance, expressions involving \(\mathbb{E}[(X)_r]\) (where \((X)_r\) denotes a falling factorial) can be written in terms of ratios of combinations, linking back to counting arguments over subsets. This viewpoint is useful when connecting hypergeometric probabilities to estimates based on overlap counts and sampling without replacement.
3.4 Dependence structure: “finite population correction”
The dependence created by drawing without replacement is often summarized by the “finite population correction” factor. It quantifies how much uncertainty is dampened because each draw removes information from the pool. As \(n\) becomes small relative to \(N\), the correction approaches 1 and the model behaves more like an independence-based approximation; as \(n\) approaches \(N\), the correction shrinks, reflecting strong constraints on possible outcomes.
4 Related Distributions and Limits
4.1 Relationship to the binomial distribution
4.1.1 Approximation when population size is large
When the population is large and the sampling fraction is small, the hypergeometric distribution can be approximated by a binomial distribution. Specifically, if \(N\) is much larger than \(n\), then drawing without replacement looks nearly like drawing independently with success probability \(p=K/N\). Under this regime, the hypergeometric mean matches the binomial mean, and the variance difference becomes negligible due to the finite population correction being close to 1.
4.2 Relationship to the negative hypergeometric distribution
The negative hypergeometric distribution concerns the number of draws required to obtain a specified number of successes when sampling continues without replacement. While the hypergeometric distribution fixes the number of draws and counts successes, the negative hypergeometric reverses the setup: it fixes the success target and treats the stopping time as random. Together they form a complementary pair within the family of urn-based sampling models.
4.3 Connections to Fisher’s exact test (conceptual link)
4.3.1 Two-by-two contingency tables and exact probabilities
A prominent application of hypergeometric probabilities arises in exact testing for contingency tables with fixed margins. In a two-by-two table, once the row and column totals are specified, the number of successes in a chosen cell follows a hypergeometric law. This enables calculation of exact tail probabilities rather than relying on large-sample approximations, yielding an “exact” framework grounded in combinatorial sampling constraints.
5 Computation and Practical Use
5.1 Computing probabilities by hand (example workflow)
Manual calculations typically follow the PMF structure using combinations. The general workflow is: (1) confirm parameters \(N\), \(K\), and \(n\); (2) determine the feasible range of \(x\); (3) compute \(\binom{K}{x}\), \(\binom{N-K}{n-x}\), and \(\binom{N}{n}\); and (4) form the ratio. For moderately sized numbers, it is often practical to compute using simplified arithmetic or reduce terms stepwise to avoid excessively large binomial coefficients.
5.2 Numerical methods and software implementation
Software implementations typically evaluate hypergeometric probabilities using numerically stable methods such as log-combination calculations or recurrence relations. This matters because binomial coefficients can overflow standard floating-point ranges even when the final probability is well-defined. Common statistical packages provide functions for the PMF, cumulative distribution function (CDF), and exact tail probabilities.
5.3 Choosing the correct parameters from data
Parameter selection depends on how the two categories and sample design are defined. One must map the data’s “success” category to \(K\), count the total population elements to \(N\), and set \(n\) to the number actually sampled. If data are aggregated from multiple sources or sampling is not strictly without replacement, the hypergeometric model may become misaligned with the data-generating process.
5.4 Common pitfalls (range errors and misinterpreted totals)
A frequent error is using a value of \(x\) outside the feasible support, which yields probability zero under the model but may appear “accidentally nonzero” if the implementation is misused. Another pitfall is misinterpreting what constitutes the population total: sometimes analysts mistakenly use a denominator from a subset rather than the actual finite population from which sampling occurred. Careful bookkeeping of \(N\) versus observed totals is essential.
6 Statistical Inference Using Hypergeometric Probabilities
6.1 Exact one-sided tail probabilities
Inference often begins with tail probabilities of the form \[ \Pr(X\ge x_0)\quad \text{or}\quad \Pr(X\le x_0), \] computed exactly from the PMF. Because the support is discrete and bounded, the exact tail probability is typically obtained by summing the relevant PMF terms. One-sided logic is useful when there is a directional question, such as whether the observed number of successes is unusually high relative to a null model with fixed margins.
6.2 Exact two-sided testing logic (high level)
Two-sided procedures require defining what counts as “extreme” in either direction while preserving the discreteness of the distribution. At a high level, one typically evaluates the probability of outcomes that are at least as unlikely (under the exact model) as the observed value, or uses a symmetry-based criterion when justified. Different exact two-sided definitions can lead to slightly different p-values because discreteness prevents a perfectly smooth notion of “equal extremeness.”
6.3 Effect size intuition under fixed margins
Beyond p-values, effect size intuition can be gained by comparing the observed \(X\) to its expected value \(nK/N\). In fixed-margin settings, departures from expectation reflect how far the observed overlap count deviates from what would be typical under the null distribution. While this intuition does not replace formal effect-size measures, it helps interpret whether results indicate stronger-than-expected or weaker-than-expected concentration of successes.
7 Examples and Worked Problems
7.1 Simple urn example with small counts
Suppose an urn contains \(N=20\) balls, with \(K=7\) labeled successes and \(13\) failures. If \(n=5\) balls are drawn without replacement, then \(X\) can take values from \(\max(0,5-13)=0\) to \(\min(7,5)=5\). The probability of exactly \(x=2\) successes is \[ \Pr(X=2)=\frac{\binom{7}{2}\binom{13}{3}}{\binom{20}{5}}. \] Computing this value illustrates how the model weights combinations consistent with both success and failure availability.
7.2 Sampling from defective/healthy items
In quality control, one may treat defective items as “successes” (or vice versa) depending on the question. For instance, if \(N\) incoming items include \(K\) defectives and \(n\) items are inspected without replacement, the hypergeometric distribution gives the probability of finding exactly \(x\) defectives. This framework is particularly relevant when inspecting a meaningful fraction of a batch, where depletion effects matter.
7.3 Edge cases: very small samples or near-full sampling
If \(n=1\), then \(X\) is Bernoulli with \(\Pr(X=1)=K/N\), because drawing a single item does not introduce complex dependence. At the other extreme, if \(n\) is close to \(N\), the number of failures in the sample becomes small and the success count is tightly constrained, producing a distribution that concentrates near its feasible endpoints. These edge cases emphasize how the support bounds shape the distribution’s shape.
7.4 Interpreting results in terms of odds and likelihood
For discrete models, it is often helpful to interpret results via likelihood ratios comparing the probability of the observed outcome under different hypotheses or parameter values. For example, if a proposed value of \(K\) implies a success probability structure inconsistent with the observed \(x\), the corresponding hypergeometric likelihood can be small. Such comparisons are more informative than focusing solely on cumulative tails when multiple parameter values are plausible.
8 Summary and Key Takeaways
8.1 Core definition and PMF recap
The hypergeometric distribution models the count of successes \(X\) obtained when \(n\) items are drawn without replacement from a finite population of size \(N\) containing \(K\) successes. Its PMF is \[ \Pr(X=x)=\frac{\binom{K}{x}\binom{N-K}{n-x}}{\binom{N}{n}}, \] with \(x\) restricted to feasible values determined by the available successes and failures.
8.2 Parameter checklist for correct application
Correct application requires aligning the study design with the model: \(N\) must be the finite population size, \(K\) the number of successes within it, and \(n\) the number of draws. Additionally, the support constraints must be respected, ensuring that calculated probabilities correspond to outcomes that are possible given those parameters.
8.3 When the hypergeometric model is appropriate
The model is appropriate when sampling is without replacement and the finite population structure is known or reasonably fixed. It is especially relevant for exact probability calculations, overlap counts, and situations where dependence between draws cannot be ignored. When the population is large relative to the sample, hypergeometric results can often be approximated by binomial calculations, but the exact model remains the reference for finite-population scenarios.