# 随机变量的独立性

**随机变量的独立性**是指两个或多个随机变量的联合概率分布可以分解为各自边缘分布之积的性质，从而得知其中一个变量的取值不会提供关于其他变量分布的任何信息。形式上，离散随机变量 \( X \) 与 \( Y \) 独立，当且仅当对所有 \( x \) 和 \( y \) 都有 \( p_{X,Y}(x,y) = p_X(x) \, p_Y(y) \)；连续变量独立，当且仅当其联合密度以同样的方式分解。<sup>[1](https://www.stat.cmu.edu/~cshalizi/uADA/12/reminders/uncorrelated-vs-independent.pdf)</sup><sup> • </sup><sup>[2](https://wanghemath.github.io/Book-ProbabilityStatisticalTheory/chapters/chapter-03-joint-conditional-probability.html)</sup>

| 关键事实 | 细节 |
|---|---|
| 定义 | 对所有取值，联合分布等于边缘分布之积：\( p_{X,Y}(x,y) = p_X(x) p_Y(y) \)；等价地，联合累积分布函数分解为 \( F_{X,Y}(x,y) = F_X(x) F_Y(y) \)<sup>[1](https://www.stat.cmu.edu/~cshalizi/uADA/12/reminders/uncorrelated-vs-independent.pdf)</sup><sup> • </sup><sup>[3](https://wcsl.ece.ucsb.edu/sites/default/files/f/intro_comm_systems_madhow_jan2014b_0.pdf)</sup> |
| 条件形式 | 条件分布等于边缘分布：\( p_{Y\mid X}(y \mid x) = p_Y(y) \)<sup>[1](https://www.stat.cmu.edu/~cshalizi/uADA/12/reminders/uncorrelated-vs-independent.pdf)</sup> |
| 与相关的关系 | 独立蕴含零协方差与零相关，但零相关不蕴含独立<sup>[4](https://pages.stat.wisc.edu/~kdlevin/teaching/Fall2022/STAT340/lecs/L05_IndepCondBayes.html)</sup> |
| 高斯例外 | 对于联合高斯随机变量，不相关与独立等价<sup>[5](https://www.ee.iitm.ac.in/uday/notes/wsd/bits.html)</sup> |
| n 个变量的相互独立 | 需要 \( 2^n - n - 1 \) 个非平凡条件；两两独立并不充分<sup>[6](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.05%3A_Independence)</sup> |
| 推论 | 独立变量具有零协方差，因此其方差可加：\( \operatorname{Var}(X+Y) = \operatorname{Var}(X) + \operatorname{Var}(Y) \)<sup>[7](https://alliance.seas.upenn.edu/~cis520/dynamic/2019/wiki/index.php?n=Lectures.Covariance)</sup> |

## 定义与等价形式

这一定义将独立性从事件推广到变量。事件 \( A \) 与 \( B \) 独立，当 \( \P(A \cap B) = \P(A) \P(B) \)；随机变量独立，则指由一个变量决定的每个事件都与由另一个变量决定的每个事件独立。<sup>[6](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.05%3A_Independence)</sup> 用分布的语言来说，对于 \( n \) 个变量 \( X_1, \ldots, X_n \)，独立性意味着

\[
\P[X_1 \in A_1, \ldots, X_n \in A_n] = \P[X_1 \in A_1] \cdots \P[X_n \in A_n]
\]

对任意子集 \( A_1, \ldots, A_n \) 成立，这蕴含联合累积分布函数是边缘累积分布函数之积，且联合密度可分解为边缘密度之积。<sup>[3](https://wcsl.ece.ucsb.edu/sites/default/files/f/intro_comm_systems_madhow_jan2014b_0.pdf)</sup> 对于离散变量，联合概率质量函数分解为边缘概率质量函数之积，而在累积分布函数上检验同样的条件也是等价的。<sup>[8](https://stats.libretexts.org/Courses/Saint_Mary%27s_College_Notre_Dame/DSCI_500B_Essential_Probability_Theory_for_Data_Science_%28Kuter%29/05%3A_Multivariate_Random_Variables/5.01%3A_Joint_Distributions_of_Discrete_Random_Variables)</sup>

**条件形式。** 当 \( \P(Y = y) > 0 \) 时，乘法法则给出用条件分布表述的等价命题：

\[
p_{X \mid Y}(x \mid y) = \frac{p_{X,Y}(x,y)}{p_Y(y)} = \frac{p_X(x) p_Y(y)}{p_Y(y)} = p_X(x).
\]

以 \( Y = y \) 为条件并不改变 \( X \) 的分布，这正是独立性的直观内容：\( Y \) 不携带关于 \( X \) 的信息。<sup>[9](https://mlweb.loria.fr/book/en/independence.html)</sup> 同样的等价关系也出现在事件形式中：对于概率为正的事件，\( \P(A \mid B) = \P(A) \) 成立，当且仅当 \( \P(A \cap B) = \P(A) \P(B) \)。<sup>[6](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.05%3A_Independence)</sup>

## 独立与不相关

两个随机变量不相关，是指其皮尔逊相关系数为零，\( \rho_{X,Y} = 0 \)。由于

\[
\rho_{X,Y} = \frac{\operatorname{Cov}(X,Y)}{\sqrt{(\operatorname{Var} X)(\operatorname{Var} Y)}},
\]

不相关等同于零协方差；又因 \( \operatorname{Cov}(X,Y) = E[XY] - E[X]E[Y] \)，它也等同于 \( E[XY] = E[X]E[Y] \)，即乘积的期望可分解。<sup>[1](https://www.stat.cmu.edu/~cshalizi/uADA/12/reminders/uncorrelated-vs-independent.pdf)</sup>

独立蕴含不相关。若 \( X \) 与 \( Y \) 独立，协方差分解为两个求和，每个都化为 \( \mu - \mu = 0 \)，故 \( \operatorname{Cov}(X,Y) = 0 \)。<sup>[4](https://pages.stat.wisc.edu/~kdlevin/teaching/Fall2022/STAT340/lecs/L05_IndepCondBayes.html)</sup> 反之不成立：可以构造出 \( \rho_{X,Y} = 0 \) 却不独立的随机变量。<sup>[4](https://pages.stat.wisc.edu/~kdlevin/teaching/Fall2022/STAT340/lecs/L05_IndepCondBayes.html)</sup> 标准的反例是 \( Y = X^2 \)，其中 \( X \) 关于零对称，例如 \( [-1, 1] \) 上的均匀分布：这两个变量在函数上相依，这是最强形式的相依，然而它们的协方差为零，因为线性项与二次项的乘积在取平均时正负抵消。<sup>[10](https://web.ma.utexas.edu/users/mks/384G06/indcovcor.pdf)</sup><sup> • </sup><sup>[11](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/04%3A_Expected_Value/4.05%3A_Covariance_and_Correlation)</sup> 之所以存在这一落差，是因为协方差只度量线性关联，而两个变量可以通过非线性关系强烈相依却仍然不相关。<sup>[5](https://www.ee.iitm.ac.in/uday/notes/wsd/bits.html)</sup> 在数据分析中，这使得散点图不可或缺：相关系数接近零可以与明显的非线性模式（如抛物线形的“微笑”曲线）并存。<sup>[12](https://discovery.cs.illinois.edu/guides/Statistics-Formulas/correlated-independent-variables/)</sup>

**高斯例外。** 对于某一族分布，直觉反应是正确的：对于联合高斯随机变量，不相关蕴含独立，因此两个概念重合。<sup>[5](https://www.ee.iitm.ac.in/uday/notes/wsd/bits.html)</sup> “联合”这一限定很重要。完全可能出现 \( X \) 与 \( Y \) 各自边缘高斯且不相关、却不独立的情形；仅凭边缘正态性并不能使这对变量成为二元正态。<sup>[13](https://www.stat.berkeley.edu/~ryantibs/timeseries-f23/homeworks/homework1.html)</sup>

## 多个变量的相互独立

将独立性推广到两个以上变量，需要的远不止两两检验。一族事件 \( \{A_i : i \in I\} \) 独立，是指对每个有限子族 \( J \subseteq I \) 都有 \( \P(\bigcap_{j \in J} A_j) = \prod_{j \in J} \P(A_j) \)。<sup>[6](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.05%3A_Independence)</sup> 对于 \( n \) 个事件，这意味着 \( 2^n - n - 1 \) 个非平凡条件，因为共有 \( 2^n \) 个子族，而空集与 \( n \) 个单元素子族都是平凡的。例如三个事件，需要三个两两乘积加上三重乘积 \( \P(A \cap B \cap C) = \P(A)\P(B)\P(C) \)。<sup>[6](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.05%3A_Independence)</sup> 两两独立并不能达到相互独立：习题中可以构造三个事件，它们两两独立，而其中两个的交集与第三个却以最强的方式相关联。<sup>[6](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.05%3A_Independence)</sup> 类似地，\( X_1, \ldots, X_n \) 相互独立，是指其联合概率质量函数或概率密度函数分解为边缘概率质量函数或概率密度函数之积。<sup>[2](https://wanghemath.github.io/Book-ProbabilityStatisticalTheory/chapters/chapter-03-joint-conditional-probability.html)</sup>

## 推论与用途

独立性既是一条需要检验的定理，也同样是一种建模假设。例如回归分析将观测对 \( (X_1, Y_1), \ldots, (X_n, Y_n) \) 视为独立。<sup>[4](https://pages.stat.wisc.edu/~kdlevin/teaching/Fall2022/STAT340/lecs/L05_IndepCondBayes.html)</sup> 经典概率论本身就建立在实验的独立重复这一观念之上。<sup>[6](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.05%3A_Independence)</sup>

这一假设带来简化。由于独立变量具有零协方差，和的方差等于方差之和，\( \operatorname{Var}(X+Y) = \operatorname{Var}(X) + \operatorname{Var}(Y) \)；没有独立性则需要额外的协方差项。<sup>[7](https://alliance.seas.upenn.edu/~cis520/dynamic/2019/wiki/index.php?n=Lectures.Covariance)</sup> 独立性还允许用无条件概率替代条件概率：对于独立的 \( X_1, \ldots, X_n \)，\( \P[X_1 \in A_1 \mid X_2 \in A_2, \ldots, X_n \in A_n] = \P[X_1 \in A_1] \)。<sup>[3](https://wcsl.ece.ucsb.edu/sites/default/files/f/intro_comm_systems_madhow_jan2014b_0.pdf)</sup> 当每个变量还具有相同的边缘分布时，这些变量被称为独立同分布，这个说法在整个统计学中反复出现。<sup>[14](https://assets.press.princeton.edu/chapters/s10286.pdf)</sup>

存在性原则上不成问题。给定任意一列分布函数 \( F_1(x), F_2(x), \ldots \)，都可以在带勒贝格测度的区间 \( [0,1] \) 上定义可测函数，使其为恰好具有这些分布的独立随机变量；更一般地，柯尔莫哥洛夫关于无穷维空间中概率的定理保证存在一个概率空间，承载具有任意指定分布的独立随机变量。<sup>[15](https://encyclopediaofmath.org/wiki/Independence)</sup>

## 超越两两零相关

由于零相关太弱，不足以证明独立，统计学与机器学习使用更强的工具。近期的理论工作表明，条件化在一般情况下恢复了等价性：在适当的假设下，随机变量的条件不相关（其中条件化遍历适当一类检验集）等价于独立，且条件协方差完全决定了独立性。<sup>[16](https://arxiv.org/abs/2406.01849)</sup> 条件独立——即一旦已知第三个变量 \( Z \)，\( X \) 与 \( Y \) 便独立——是一个独立的概念，它是图模型与因果发现方法的基础。<sup>[17](https://arxiv.org/abs/2105.07555)</sup>

## References

1. [Reminder No. 1: Uncorrelated vs. Independent, Cosma Shalizi, 36-402 Advanced Data Analysis, Carnegie Mellon University (2012)](https://www.stat.cmu.edu/~cshalizi/uADA/12/reminders/uncorrelated-vs-independent.pdf)
2. [Chapter 3: Joint and Conditional Probability, Foundations of Probability and Statistical Theory](https://wanghemath.github.io/Book-ProbabilityStatisticalTheory/chapters/chapter-03-joint-conditional-probability.html)
3. [Independent Random Variables, Introduction to Communication Systems (Madhow), UCSB Wireless Communication Systems Lab](https://wcsl.ece.ucsb.edu/sites/default/files/f/intro_comm_systems_madhow_jan2014b_0.pdf)
4. [STAT340 Lecture 05: Independence, Conditional Probability and Bayes' Rule, University of Wisconsin–Madison](https://pages.stat.wisc.edu/~kdlevin/teaching/Fall2022/STAT340/lecs/L05_IndepCondBayes.html)
5. [Independence, covariance, and correlation, EE6323 Wireless System Design notes, IIT Madras](https://www.ee.iitm.ac.in/uday/notes/wsd/bits.html)
6. [2.5: Independence, Probability, Mathematical Statistics, and Stochastic Processes (Siegrist), Statistics LibreTexts](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/02%3A_Probability_Spaces/2.05%3A_Independence)
7. [CIS520 Machine Learning: Covariance, University of Pennsylvania](https://alliance.seas.upenn.edu/~cis520/dynamic/2019/wiki/index.php?n=Lectures.Covariance)
8. [5.1: Joint Distributions of Discrete Random Variables, Statistics LibreTexts](https://stats.libretexts.org/Courses/Saint_Mary%27s_College_Notre_Dame/DSCI_500B_Essential_Probability_Theory_for_Data_Science_%28Kuter%29/05%3A_Multivariate_Random_Variables/5.01%3A_Joint_Distributions_of_Discrete_Random_Variables)
9. [Independence, Machine Learning book (Loria)](https://mlweb.loria.fr/book/en/independence.html)
10. [M384: Independence, covariance, and correlation, University of Texas at Austin](https://web.ma.utexas.edu/users/mks/384G06/indcovcor.pdf)
11. [4.5: Covariance and Correlation, Probability, Mathematical Statistics, and Stochastic Processes (Siegrist), Statistics LibreTexts](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/04%3A_Expected_Value/4.05%3A_Covariance_and_Correlation)
12. [Correlated, Uncorrelated, and Independent Random Variables, Data Science Discovery, University of Illinois](https://discovery.cs.illinois.edu/guides/Statistics-Formulas/correlated-independent-variables/)
13. [Homework 1, Time Series (Fall 2023), Ryan Tibshirani, UC Berkeley](https://www.stat.berkeley.edu/~ryantibs/timeseries-f23/homeworks/homework1.html)
14. [Introduction to Probability and Random Variables, Princeton University Press](https://assets.press.princeton.edu/chapters/s10286.pdf)
15. [Independence, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Independence)
16. [Conditional uncorrelation equals independence, Journal of Mathematical Analysis and Applications / arXiv:2406.01849](https://arxiv.org/abs/2406.01849)
17. [A Distribution Free Conditional Independence Test with Applications to Causal Discovery, arXiv:2105.07555](https://arxiv.org/abs/2105.07555)

---
*Initially written Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Probability theory › Random variables › Exchangeability, independence, and Gaussian structure › Independence of random variables and events

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/independence-of-random-variables

English original: https://www.edgepedia.org/independence-of-random-variables
