# 全概率公式

**全概率公式**是概率论中的一个定理，它把某一事件的概率表示为该事件在样本空间的一个分割的各成员给定时所得的各条件概率的加权和。若 \( B_1, B_2, \ldots \) 是两两不相交的事件，其并集为整个样本空间，且每个事件的概率为正，则对任意事件 \( A \)，

\[ \mathbb{P}(A) = \sum_{i} \mathbb{P}(A \mid B_i)\,\mathbb{P}(B_i). \]

它也被称为**分割定理**、**全概率定理**、**全概率法则**或**择一定理**。<sup>[1](https://proofwiki.org/wiki/Total_Probability_Theorem)</sup> 该定理使一个复杂的概率计算得以分解为在样本空间互不相交的各个切片上的较简单的条件计算，再通过加法重新组合起来。<sup>[2](https://faculty.nps.edu/rbassett/_book/probability.html)</sup>

| 关键事实 | 细节 |
|---|---|
| 陈述 | 对 \( \Omega \) 的一个分割 \(\{B_i\}\)，若 \( \mathbb{P}(B_i) > 0 \)，则对每个事件 \( A \) 有 \( \mathbb{P}(A) = \sum_{i} \mathbb{P}(A \mid B_i)\,\mathbb{P}(B_i) \)<sup>[3](https://www.math.cmu.edu/~gautam/c/2026-425/notes/independence.html)</sup> |
| 两集合情形 | \( \mathbb{P}(A) = \mathbb{P}(A \mid B)\mathbb{P}(B) + \mathbb{P}(A \mid B^c)\mathbb{P}(B^c) \)<sup>[4](https://www.probabilitycourse.com/chapter1/1_4_2_total_probability.php)</sup> |
| 证明要素 | 可数可加性以及定义 \( \mathbb{P}(A \mid B) = \mathbb{P}(A \cap B)/\mathbb{P}(B) \)；集合 \( A \cap B_i \) 构成 \( A \) 的一个分割<sup>[5](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.04%3A_Conditional_Probability)</sup> |
| 连续形式 | \( f_X(x) = \int f_{X \mid Y=y}(x)\, f_Y(y)\, dy \)，由条件密度和边缘密度给出边缘密度<sup>[6](https://www.stat.berkeley.edu/~aditya/resources/FullNotes201AFall2022.pdf)</sup> |
| 伴随结果 | 全期望公式：\( \mathbb{E}[X] = \sum_i \mathbb{E}[X \mid B_i]\,\mathbb{P}(B_i) \)<sup>[7](https://keesvs.net/UoM/teaching/martingales/notes/Chapter4.html)</sup> |
| 在贝叶斯定理中的作用 | 为 \( \mathbb{P}(B_j \mid A) \) 提供分母 \( \mathbb{P}(A) = \sum_i \mathbb{P}(A \mid B_i)\mathbb{P}(B_i) \)<sup>[5](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.04%3A_Conditional_Probability)</sup> |
| 公理地位 | 在柯尔莫哥洛夫1933年的《概率论基础》中以“全概率定理”之名陈述<sup>[8](https://liyingli-math.github.io/teaching/mat8030-2024f/Kolmogorov1933.pdf)</sup> |

## 陈述与要求

样本空间 \( \Omega \) 的一个**分割**是一族两两不相交、并集为 \( \Omega \) 的事件；其指标集可以是有限的，也可以是可数无限的。<sup>[3](https://www.math.cmu.edu/~gautam/c/2026-425/notes/independence.html)</sup> 给定这样一个分割 \( \{B_i \mid i \in I\} \)，且对每个 \( i \) 都有 \( \mathbb{P}(B_i) > 0 \)，该定理断言：对每个事件 \( A \)，

\[ \mathbb{P}(A) = \sum_{i \in I} \mathbb{P}(A \mid B_i)\,\mathbb{P}(B_i) \]<sup>[3](https://www.math.cmu.edu/~gautam/c/2026-425/notes/independence.html)</sup>

《数学百科全书》对有限多个两两互斥、并集为必然事件的事件 \( A_1, \ldots, A_r \) 给出了同一公式。<sup>[9](https://encyclopediaofmath.org/wiki/Probability_theory)</sup>

两事件情形是大多数课程中首先遇到的形式。由于 \( B \) 与 \( B^c \) 构成样本空间的一个分割，

\[ \mathbb{P}(A) = \mathbb{P}(A \mid B)\,\mathbb{P}(B) + \mathbb{P}(A \mid B^c)\,\mathbb{P}(B^c). \]<sup>[4](https://www.probabilitycourse.com/chapter1/1_4_2_total_probability.php)</sup>

正概率的要求之所以重要，是因为条件概率 \( \mathbb{P}(A \mid B_i) \) 定义为 \( \mathbb{P}(A \cap B_i)/\mathbb{P}(B_i) \)，而这一表达式只有在 \( \mathbb{P}(B_i) > 0 \) 时才有意义。<sup>[3](https://www.math.cmu.edu/~gautam/c/2026-425/notes/independence.html)</sup> 在实际应用中，概率为零的分割成员可以直接忽略：它们的贡献 \( \mathbb{P}(A \cap B_i) \) 本来就是零；达勒姆的讲义在陈述该公式时默认每当 \( \mathbb{P}(B_k) = 0 \) 便取 \( \mathbb{P}(A \mid B_k)\,\mathbb{P}(B_k) = 0 \)。<sup>[10](https://www.maths.dur.ac.uk/users/ellen.g.powell/SPnotes.html)</sup>

## 证明

证明很短，只用到条件概率的定义和可加性。集合 \( A \cap B_i \) 互不相交（因为 \( B_i \) 互不相交），且其并集为 \( A \)，因此它们构成 \( A \) 的一个分割。于是可数可加性给出

\[ \mathbb{P}(A) = \sum_{i} \mathbb{P}(A \cap B_i) = \sum_{i} \mathbb{P}(A \mid B_i)\,\mathbb{P}(B_i), \]

其中第二个等号是条件概率定义变形后的结果。<sup>[5](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.04%3A_Conditional_Probability)</sup> 对于有限分割，这只需要有限可加性；对于可数无限分割，则需要概率公理的可数加强形式，而这也正是该公式两种版本唯一不同之处。<sup>[11](https://mynameisjanus.github.io/appendix/part-02-probability-foundations/06-law-of-total-probability/)</sup>

柯尔莫哥洛夫1933年的专著以实质上相同的表述收录了该定理：若 \( A_1 + A_2 + \cdots + A_n = E \)，其中 \( A_i \) 两两互斥，且 \( X \) 任意，则 \( \mathbb{P}(X) = \mathbb{P}(A_1)\,\mathbb{P}_{A_1}(X) + \cdots + \mathbb{P}(A_n)\,\mathbb{P}_{A_n}(X) \)，其证明是把 \( X \) 分解为互不相交的片段 \( A_i X \)。<sup>[8](https://liyingli-math.github.io/teaching/mat8030-2024f/Kolmogorov1933.pdf)</sup>

## 连续形式

当作为条件的变量是密度为 \( f_Y \) 的连续随机变量 \( Y \) 时，求和变为积分。对事件 \( A \)，

\[ \mathbb{P}(A) = \int_{-\infty}^{\infty} \mathbb{P}(A \mid Y = y)\, f_Y(y)\, dy, \]<sup>[12](https://courses.cs.washington.edu/courses/cse312/23su/lecture/16-joint-prob-a.pdf)</sup>

而对随机变量 \( X \) 的边缘密度，

\[ f_X(x) = \int f_{X \mid Y=y}(x)\, f_Y(y)\, dy. \]

这可由分解式 \( f_{X,Y}(x,y) = f_{X \mid Y=y}(x) f_Y(y) \) 以及对联合密度关于 \( y \) 积分得到。<sup>[6](https://www.stat.berkeley.edu/~aditya/resources/FullNotes201AFall2022.pdf)</sup> 该公式是推导变换后随机变量分布的主力工具：设 \( X \) 与 \( Y \) 为独立的标准正态变量，以 \( Y = v \) 为条件并对 \( v \) 积分，即可证明 \( U = X/Y \) 具有柯西密度 \( 1/(\pi(1+u^2)) \)；同样的技巧也可用来推导自由度为 \( n \) 的 \( t \) 分布的密度。<sup>[6](https://www.stat.berkeley.edu/~aditya/resources/FullNotes201AFall2022.pdf)</sup>

以 \( Y = y \) 为条件本身是一件微妙的事，因为对连续变量有 \( \mathbb{P}(Y = y) = 0 \)，条件概率的比值定义并不适用。一种途径是把条件分布定义为当 \( \epsilon \to 0 \) 时在给定 \( Y \in (y - \epsilon, y + \epsilon) \) 下的条件分布的极限（若该极限存在）；而正如麻省理工学院18.440课程讲义所说，以零概率事件为条件的一般问题总体上颇为棘手。<sup>[13](https://ocw.mit.edu/courses/18-440-probability-and-random-variables-spring-2014/af1a246d4fcac82622a62711e31fd34d_MIT18_440S14_Lecture24.pdf)</sup>

## 与贝叶斯定理的关系

贝叶斯定理把条件化的方向反过来：对分割 \( \{B_i\} \) 及满足 \( \mathbb{P}(A) > 0 \) 的事件 \( A \)，

\[ \mathbb{P}(B_j \mid A) = \frac{\mathbb{P}(A \mid B_j)\,\mathbb{P}(B_j)}{\mathbb{P}(A)} = \frac{\mathbb{P}(A \mid B_j)\,\mathbb{P}(B_j)}{\sum_{i} \mathbb{P}(A \mid B_i)\,\mathbb{P}(B_i)}. \]<sup>[3](https://www.math.cmu.edu/~gautam/c/2026-425/notes/independence.html)</sup>

分母正是对 \( A \) 应用全概率公式的结果，而这被描述为使用贝叶斯法则最常见的方式。<sup>[5](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.04%3A_Conditional_Probability)</sup><sup> • </sup><sup>[2](https://faculty.nps.edu/rbassett/_book/probability.html)</sup> 在诊断检测中，该公式把阳性检测的总概率计算为真阳性率与假阳性率按人群中患病与无病比例加权的平均值。<sup>[5](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.04%3A_Conditional_Probability)</sup>

## 伴随结果与推广

**全期望公式。** 关于期望的类似陈述说，对分割 \( \{B_i\} \)，

\[ \mathbb{E}[X] = \sum_{i} \mathbb{E}[X \mid B_i]\,\mathbb{P}(B_i). \]

其证明方式相同：写出每个条件期望的定义并应用全概率公式。<sup>[14](https://www.probabilitycourse.com/chapter5/5_1_3_conditioning_independence.php)</sup> 该结果对可数无限分割以及含有零概率事件的分割仍然成立，只需从右端删去零概率事件对应的项；对无限和，绝对收敛性 \( \sum_k |\mathbb{E}(X \mid B_k)|\,\mathbb{P}(B_k) < \infty \) 保证该恒等式有良好定义。<sup>[7](https://keesvs.net/UoM/teaching/martingales/notes/Chapter4.html)</sup><sup> • </sup><sup>[10](https://www.maths.dur.ac.uk/users/ellen.g.powell/SPnotes.html)</sup>

**测度论框架。** 在现代概率论中，条件化是相对于一个子σ代数 \( \mathcal{G} \) 而非单个分割来定义的，条件概率 \( \mathbb{P}(A \mid \mathcal{G}) \) 构成一个随机变量。这些条件概率的可数可加性几乎必然成立，但允许在零测集上例外，这正是该对象被当作随机变量而非逐点定义的测度来处理的原因。<sup>[7](https://keesvs.net/UoM/teaching/martingales/notes/Chapter4.html)</sup> 柯尔莫哥洛夫的一般方法通过拉东–尼科迪姆定理把条件概率和条件期望定义为随机变量，从而把条件化推广到可数分割之外。<sup>[15](https://ndl.ethernet.edu.et/bitstream/123456789/32878/1/Olav%20kallenberg_1997.pdf)</sup>

## 应用

**贝叶斯推断中的边缘化。** 许多具有科学意义的假说是复合的，依赖于诸如冗余参数之类的辅助量。康奈尔大学天体物理与行星科学中心的天文学家兼统计学家托马斯·J·洛雷多（Thomas J. Loredo）与杜克大学统计科学教授罗伯特·L·沃尔珀特（Robert L. Wolpert）在2024年的一篇教程中指出，贝叶斯方法的许多重要能力都源于全概率公式，该公式指引分析者对假说或参数空间做边缘化，从而计算复合假说的概率。<sup>[16](https://www.frontiersin.org/journals/astronomy-and-space-sciences/articles/10.3389/fspas.2024.1326926/full)</sup> 在贝叶斯模型构建中，参数 \( \Theta \) 的先验分布与似然 \( f_{X \mid \Theta=\theta} \) 通过 \( f_X(x) = \int f_{X \mid \Theta=\theta}(x) f_\Theta(\theta)\, d\theta \) 决定数据的边缘分布。<sup>[6](https://www.stat.berkeley.edu/~aditya/resources/FullNotes201AFall2022.pdf)</sup>

**更新理论。** 该公式把递归的时序问题转化为卷积方程。在离散更新模型中，灯泡烧坏后在整数时刻被更换，更新间隔分布为 \( f_k \)，以第一次更换的时刻 \( k \)（它构成一个可数分割）为条件，可得时刻 \( n \) 发生更换的概率 \( r_n \) 满足 \( r_n = \sum_{k=1}^{n} r_{n-k} f_k \)；右端是序列 \( (r_n) \) 与 \( (f_k) \) 的卷积，便于用生成函数方法分析。<sup>[10](https://www.maths.dur.ac.uk/users/ellen.g.powell/SPnotes.html)</sup>

**日常计算。** 当一个事件的概率在给定各个切片的条件下容易表述、而无条件时不易表述时，该公式便是标准工具。从一副洗好的牌中抽两张牌，第二张是A的概率可通过对第一张是否为A作条件化来计算：\( (3/51)(4/52) + (4/51)(48/52) \)。<sup>[2](https://faculty.nps.edu/rbassett/_book/probability.html)</sup> 同样的结构也可处理复合试验，其中乘法定理与已知的各阶段概率共同确定复合试验所有结果的概率。<sup>[9](https://encyclopediaofmath.org/wiki/Probability_theory)</sup>

## References

1. [Total Probability Theorem, ProofWiki](https://proofwiki.org/wiki/Total_Probability_Theorem)
2. [Chapter 6 Probability, Introduction to Statistics and Data Science (Bassett), Naval Postgraduate School](https://faculty.nps.edu/rbassett/_book/probability.html)
3. [Conditional Probability and Independence, lecture notes, Carnegie Mellon University](https://www.math.cmu.edu/~gautam/c/2026-425/notes/independence.html)
4. [Law of Total Probability, ProbabilityCourse.com](https://www.probabilitycourse.com/chapter1/1_4_2_total_probability.php)
5. [2.4: Conditional Probability, Statistics LibreTexts (Siegrist)](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.04%3A_Conditional_Probability)
6. [Statistics 201 lecture notes, University of California, Berkeley](https://www.stat.berkeley.edu/~aditya/resources/FullNotes201AFall2022.pdf)
7. [Chapter 4: Conditional expectation, MATH4/67201 Martingale Theory notes, University of Manchester](https://keesvs.net/UoM/teaching/martingales/notes/Chapter4.html)
8. [A. N. Kolmogorov (1933). Foundations of the Theory of Probability](https://liyingli-math.github.io/teaching/mat8030-2024f/Kolmogorov1933.pdf)
9. [Probability theory, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Probability_theory)
10. [Stochastic Processes (2021/22) Michaelmas term notes, Durham University](https://www.maths.dur.ac.uk/users/ellen.g.powell/SPnotes.html)
11. [Law of Total Probability, Building Quantitative Trading Systems (appendix)](https://mynameisjanus.github.io/appendix/part-02-probability-foundations/06-law-of-total-probability/)
12. [Law of Total Probability (Continuous), CSE 312 lecture slides, University of Washington](https://courses.cs.washington.edu/courses/cse312/23su/lecture/16-joint-prob-a.pdf)
13. [18.440 Probability and Random Variables, Lecture 24, MIT OpenCourseWare](https://ocw.mit.edu/courses/18-440-probability-and-random-variables-spring-2014/af1a246d4fcac82622a62711e31fd34d_MIT18_440S14_Lecture24.pdf)
14. [Conditioning, Independence, CDF, ProbabilityCourse.com](https://www.probabilitycourse.com/chapter5/5_1_3_conditioning_independence.php)
15. [Olav Kallenberg. Foundations of Modern Probability](https://ndl.ethernet.edu.et/bitstream/123456789/32878/1/Olav%20kallenberg_1997.pdf)
16. [Loredo, T. J., and Wolpert, R. L. (2024). Bayesian inference: more than Bayes's theorem. Frontiers in Astronomy and Space Sciences](https://www.frontiersin.org/journals/astronomy-and-space-sciences/articles/10.3389/fspas.2024.1326926/full)

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

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Probability theory › Conditional probability and independence › Law of total probability and partition arguments

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/law-of-total-probability

English original: https://www.edgepedia.org/law-of-total-probability
