# 超几何分布

**超几何分布**是一种离散概率分布，描述的是从一个包含已知成功对象数的有限总体中，以固定样本量随机无放回抽取样本时，所抽到的“成功”对象数目。它是二项分布的有限总体对应物：由于抽取是不放回的，每次抽取都会改变总体的构成，因此各次抽取是相关的而非独立的。<sup>[1](https://scipy.github.io/devdocs/tutorial/stats/discrete_hypergeom.html)</sup><sup> • </sup><sup>[2](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/12%3A_Finite_Sampling_Models/12.02%3A_The_Hypergeometric_Distribution)</sup>

| 关键事实 | 详情 |
|---|---|
| 设定 | 从包含 N 个元素、其中 M 个被“标记”的总体中无放回地抽取大小为 n 的样本；随机变量计数样本中被标记的元素数<sup>[3](http://encyclopediaofmath.org/wiki/Hypergeometric_distribution)</sup> |
| 概率质量函数 | \( p_m = \dfrac{\binom{M}{m}\binom{N-M}{n-m}}{\binom{N}{n}} \)，定义域为 \( \max(0, M+n-N) \le m \le \min(n, M) \)<sup>[3](http://encyclopediaofmath.org/wiki/Hypergeometric_distribution)</sup> |
| 均值 | \( n \cdot p \)，其中 \( p = M/N \)；在 distributional 软件包的参数化形式下为 \( km/(n+m) \)<sup>[4](https://search.r-project.org/CRAN/refmans/distributional/html/dist_hypergeometric.html)</sup><sup> • </sup><sup>[3](http://encyclopediaofmath.org/wiki/Hypergeometric_distribution)</sup>  |
| 方差 | \( kp(1-p)\left(1 - \frac{k-1}{m+n-1}\right) \)，即二项方差乘以有限总体校正因子<sup>[4](https://search.r-project.org/CRAN/refmans/distributional/html/dist_hypergeometric.html)</sup> |
| 二项极限 | 当总体规模增大时，超几何分布趋于二项分布<sup>[5](https://reference.wolfram.com/language/ref/HypergeometricDistribution.html)</sup> |
| 软件 | Python 中的 `scipy.stats.hypergeom`；R 中的 `dhyper`、`phyper`、`qhyper` 和 `rhyper`<sup>[1](https://scipy.github.io/devdocs/tutorial/stats/discrete_hypergeom.html)</sup><sup> • </sup><sup>[6](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/Hypergeometric.html)</sup>  |
| 统计用途 | Fisher 精确检验中 2 × 2 列联表单元格计数的分布<sup>[7](https://search.r-project.org/R/refmans/stats/html/fisher.test.html)</sup> |

## 定义与参数

该分布通常通过瓮模型引入。一个瓮中装有 \( m \) 个白球和 \( n \) 个黑球；无放回地抽取 \( k \) 个球，随机变量为所抽到的白球数。<sup>[6](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/Hypergeometric.html)</sup> 等价地，一个包含 \( N \) 个元素的总体中有 \( M \) 个被标记元素和 \( N-M \) 个未标记元素，变量计数包含 \( n \) 个项目的随机样本中的被标记元素数。<sup>[3](http://encyclopediaofmath.org/wiki/Hypergeometric_distribution)</sup> SciPy 将同一变量参数化为 \( (M, n, N) \)，计数的是从 \( M \) 个对象（其中 \( n \) 个为“好”对象）的总体中抽取大小为 \( N \) 的样本中的“好”对象数。<sup>[1](https://scipy.github.io/devdocs/tutorial/stats/discrete_hypergeom.html)</sup> 各软件包的参数化方式不同，因此总体规模、成功数和样本量必须与软件的参数顺序相匹配。<sup>[1](https://scipy.github.io/devdocs/tutorial/stats/discrete_hypergeom.html)</sup><sup> • </sup><sup>[6](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/Hypergeometric.html)</sup>

恰好抽到 \( m \) 个被标记元素的概率等于有利样本数除以总样本数：

\[ p_m = \frac{\binom{M}{m}\binom{N-M}{n-m}}{\binom{N}{n}}. \]

该公式仅在支撑集 \( \max(0, M+n-N) \le m \le \min(n, M) \) 上有意义；在此范围之外概率为 0，这可视为约定 \( \binom{a}{b} = 0 \)（当 \( b > a \) 时）的推论。<sup>[3](http://encyclopediaofmath.org/wiki/Hypergeometric_distribution)</sup> 同一约定使得该公式可以对所有 \( m \ge 0 \) 写出。<sup>[3](http://encyclopediaofmath.org/wiki/Hypergeometric_distribution)</sup>

## 矩与有限总体校正

在 LibreTexts 的记号下，均值为 \( n \cdot \frac{r}{m} \)，即样本量乘以总体成功比例；《数学百科全书》指出，该期望与总体规模无关，且与相应二项分布的均值 \( np \) 一致。<sup>[2](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/12%3A_Finite_Sampling_Models/12.02%3A_The_Hypergeometric_Distribution)</sup><sup> • </sup><sup>[3](http://encyclopediaofmath.org/wiki/Hypergeometric_distribution)</sup>  设成功概率为 \( p = m/(m+n) \)、样本量为 \( k \)，则方差为

\[ \operatorname{Var}(X) = kp(1-p)\left(1 - \frac{k-1}{m+n-1}\right) = \frac{km(n)(n+m-k)}{(n+m)^2 (n+m-1)}. \]

乘在二项方差上的因子即有限总体校正。伯克利 SticiGui 教材推导了参数为 \( N \)、\( G \) 和 \( n \) 的超几何变量的标准误，即二项标准误乘以 \( f = (N-n)^{1/2}/(N-1)^{1/2} \)。<sup>[8](https://www.stat.berkeley.edu/~stark/SticiGui/Text/standardError.htm)</sup> 当样本量为 1 时，校正因子等于 1，此时有放回与无放回抽样一致；当样本耗尽总体时，校正因子等于 0，此时样本和为常数。<sup>[8](https://www.stat.berkeley.edu/~stark/SticiGui/Text/standardError.htm)</sup> 因此，无放回抽样比有放回抽样更精确：每多抽取一个元素，都携带了关于总体中不同成员的信息。<sup>[8](https://www.stat.berkeley.edu/~stark/SticiGui/Text/standardError.htm)</sup>

## 与二项分布的关系

当总体规模增大时，超几何分布趋于二项分布。<sup>[5](https://reference.wolfram.com/language/ref/HypergeometricDistribution.html)</sup> 一个常见的经验法则是：若样本量小于总体的 5%，则对无放回收集的数据使用二项分布是可以接受的；一项质量控制研究同样发现，当总体规模很大、\( N \to \infty \) 时，差异可以忽略不计。<sup>[9](https://faculty.ksu.edu.sa/sites/default/files/business-statistics-for-contemporary-decision-making-by-ken-black_0.pdf)</sup><sup> • </sup><sup>[10](https://aemps.ewapub.com/article/view/2956)</sup>

这一区别在实践中很重要。在验收抽样中，超几何分布与其二项或泊松近似之间的差异在通常条件下可能很大，而超几何概率质量函数直接依赖于批量 \( N \)，被认为更适合用于计算抽样方案参数。<sup>[11](https://link.springer.com/article/10.1007/s40092-017-0231-9)</sup> 与二项分布和泊松分布不同，总体规模 \( N \) 直接进入超几何分布的表述之中。<sup>[11](https://link.springer.com/article/10.1007/s40092-017-0231-9)</sup>

## 应用

**验收抽样与质量控制。** 批验收抽样方案由超几何概率计算得出，避免了近似处理，该框架不仅适用于工业和商业，还扩展到公共卫生和政治民意调查。<sup>[11](https://link.springer.com/article/10.1007/s40092-017-0231-9)</sup> 对于周期性生产过程，由于抽样项目之间不具有随机独立性，超几何 p 控制图使用精确的超几何概率，其控制限可根据随时间变化的样本量和总体规模进行调整，这与适用于连续生产的二项 p 控制图形成对比。<sup>[12](https://www.sciencedirect.com/science/article/pii/S0360835219304577)</sup><sup> • </sup><sup>[13](https://www.sciencedirect.com/science/article/pii/S0360835218306703)</sup>  批质量保证抽样最初是一种工业质量控制工具，已被应用于免疫接种、麻风病、结核病和昏睡病控制规划的监测，并针对超几何变量开发了样本量公式。<sup>[14](https://www.tandfonline.com/doi/abs/10.1080/09720502.2012.10700800)</sup>

**Fisher 精确检验。** 在所有边际合计均固定的 2 × 2 列联表中，第一个单元格的计数服从非中心超几何分布，其非中心参数由优势比给出，这是 R. A. Fisher 于 1935 年提出的精确检验的基础。<sup>[7](https://search.r-project.org/R/refmans/stats/html/fisher.test.html)</sup><sup> • </sup><sup>[15](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2397-2335.1935.tb04208.x)</sup>

**富集检验与推广。** 基因组规模的研究检验集合之间共享基因相对于无放回随机抽取的零假设是否富集或耗竭，超几何检验被广泛用于此目的，尽管 Fisher 精确检验在大规模基因组分析中计算量可能很大。<sup>[16](https://onlinelibrary.wiley.com/doi/10.1111/mec.70180)</sup> 该分布还超越了单一瓮的范畴：从两个瓮中独立无放回抽样时交集大小服从经典超几何分布，而广义超几何分布描述的是从有限总体中抽取多个子集时，恰好出现在给定数量子集中的元素数目。<sup>[17](https://arxiv.org/abs/1305.0717)</sup><sup> • </sup><sup>[18](https://arxiv.org/abs/1808.06924)</sup>

## 名称与计算

该名称是历史性的而非描述性的。它来自一个幂级数——超几何级数，由莱昂哈德·欧拉（Leonhard Euler）、卡尔·弗里德里希·高斯（Carl Friedrich Gauss）、伯恩哈德·黎曼（Bernhard Riemann）等人研究；该分布的概率生成函数正是这样一个级数，《数学百科全书》将生成函数的级数等同于超几何函数 \( F(\alpha, \beta; \gamma; x) \)，其中 \( \alpha = -n \)、\( \beta = -M \)、\( \gamma = N - M - n + 1 \)。<sup>[2](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/12%3A_Finite_Sampling_Models/12.02%3A_The_Hypergeometric_Distribution)</sup><sup> • </sup><sup>[3](http://encyclopediaofmath.org/wiki/Hypergeometric_distribution)</sup>

标准软件全面实现了该分布。R 的 `dhyper` 通过二项概率计算密度，使用的是 Catherine Loader 贡献的代码，她是一位以分布计算工作而闻名的统计学家；`phyper` 对密度比值求和，`qhyper` 对累积函数求逆，`rhyper` 使用 Kachitvichyanukul 和 Schmeiser（1985）算法的修正版本。<sup>[6](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/Hypergeometric.html)</sup> SciPy 将该分布暴露为 `scipy.stats.hypergeom`。<sup>[1](https://scipy.github.io/devdocs/tutorial/stats/discrete_hypergeom.html)</sup> Wolfram 语言文档指出，该分布的概率密度函数没有闭式表达式，但其矩和分布函数可直接计算。<sup>[5](https://reference.wolfram.com/language/ref/HypergeometricDistribution.html)</sup>

## References

1. [Hypergeometric Distribution, SciPy v2.0.0.dev Manual](https://scipy.github.io/devdocs/tutorial/stats/discrete_hypergeom.html)
2. [12.2: The Hypergeometric Distribution, Statistics LibreTexts (Siegrist)](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/12%3A_Finite_Sampling_Models/12.02%3A_The_Hypergeometric_Distribution)
3. [Hypergeometric distribution, Encyclopedia of Mathematics](http://encyclopediaofmath.org/wiki/Hypergeometric_distribution)
4. [dist_hypergeometric, R distributional package documentation](https://search.r-project.org/CRAN/refmans/distributional/html/dist_hypergeometric.html)
5. [HypergeometricDistribution, Wolfram Documentation](https://reference.wolfram.com/language/ref/HypergeometricDistribution.html)
6. [The Hypergeometric Distribution, R stats documentation](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/Hypergeometric.html)
7. [fisher.test: Fisher's Exact Test for Count Data, R stats documentation](https://search.r-project.org/R/refmans/stats/html/fisher.test.html)
8. [Standard Error, SticiGui, Philip B. Stark, UC Berkeley](https://www.stat.berkeley.edu/~stark/SticiGui/Text/standardError.htm)
9. [Business Statistics for Contemporary Decision Making, Ken Black](https://faculty.ksu.edu.sa/sites/default/files/business-statistics-for-contemporary-decision-making-by-ken-black_0.pdf)
10. [Yang, Y. (2023). Research on the Comparison of Sampling with and Without Replacement in Quality Control Test, AEMPS 10, 21-27](https://aemps.ewapub.com/article/view/2956)
11. [Acceptance sampling for attributes via hypothesis testing and the hypergeometric distribution, Journal of Industrial Engineering International](https://link.springer.com/article/10.1007/s40092-017-0231-9)
12. [Hypergeometric p-chart with dynamic probability control limits, Computers & Industrial Engineering](https://www.sciencedirect.com/science/article/pii/S0360835219304577)
13. [Improved control charts for fraction non-conforming based on hypergeometric distribution](https://www.sciencedirect.com/science/article/pii/S0360835218306703)
14. [Single, Double and Multiple Sampling Plans: Hypergeometric Distribution, Journal of Interdisciplinary Mathematics 15(4-5)](https://www.tandfonline.com/doi/abs/10.1080/09720502.2012.10700800)
15. [Fisher, R.A. (1935). The Logic of Inductive Inference, Journal of the Royal Statistical Society 98: 39-54](https://rss.onlinelibrary.wiley.com/doi/10.1111/j.2397-2335.1935.tb04208.x)
16. [Molecular Ecology, Wiley Online Library](https://onlinelibrary.wiley.com/doi/10.1111/mec.70180)
17. [The probability of drawing intersections: extending the hypergeometric distribution, arXiv:1305.0717](https://arxiv.org/abs/1305.0717)
18. [General hypergeometric distribution, arXiv:1808.06924](https://arxiv.org/abs/1808.06924)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026; Oct 25, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Probability theory › Probability distributions › Distribution families and classification › Discrete distribution families

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/hypergeometric-distribution

English original: https://www.edgepedia.org/hypergeometric-distribution
