# 随机变量的代数

随机变量的代数，是指可以对随机变量施行的算术运算——加法、减法、乘法、除法——的集合，连同求其结果分布的规则。随机变量是从概率空间到实数的可测函数；由于可测函数可以逐点相加、相乘、相除，所得表达式本身仍是随机变量。<sup>[1](https://link.springer.com/chapter/10.1007/978-3-030-20103-6_4)</sup><sup> • </sup><sup>[2](https://people.math.harvard.edu/~knill/teaching/math154_2026/handouts/lecture05.pdf)</sup> 本主题的核心问题在于：即便已知各输入变量的分布，和、积或商的分布通常仍需另行计算。

| 关键事实 | 细节 |
|---|---|
| 封闭性 | 若 X 与 Y 是随机变量，则 X + Y、X · Y 以及 X/Y（Y ≠ 0）也是随机变量。<sup>[1](https://link.springer.com/chapter/10.1007/978-3-030-20103-6_4)</sup> |
| 代数结构 | 在逐点加法与数乘之下，随机变量构成实数域上的向量空间；复值与向量值（例如随机矩阵）的推广也被使用。<sup>[2](https://people.math.harvard.edu/~knill/teaching/math154_2026/handouts/lecture05.pdf)</sup> |
| 独立变量之和 | 对独立随机变量，和的特征函数等于各个特征函数之积：\( M_Y(ju) = \prod_{i=1}^{N} M_{X_i}(ju) \)。<sup>[3](https://ee.stanford.edu/~gray/sp.pdf)</sup> |
| 和的方差 | \( \mathrm{Var}[X+Y] = \mathrm{Var}[X] + \mathrm{Var}[Y] + 2\,\mathrm{Cov}[X,Y] \)；协方差对其自变量是双线性的。<sup>[4](https://lancaster.ac.uk/~prendivs/accessible/math230/math230_notes.tex/Ch7.S1.html)</sup> |
| 变换工具箱 | 拉普拉斯变换与梅林积分变换可给出独立随机变量之和、差、积、商的密度与矩。<sup>[5](https://epubs.siam.org/doi/abs/10.1137/0118054)</sup> |
| 保持不变的分布族 | 成功概率相同的独立伯努利变量之和为二项分布；独立泊松变量之和为泊松分布；独立正态变量之和为正态分布。<sup>[6](https://web.stanford.edu/class/archive/cs/cs109/cs109.1214/lectures/12-IndependentRVs/)</sup><sup> • </sup><sup>[3](https://ee.stanford.edu/~gray/sp.pdf)</sup> |
| 应用 | 测量不确定度分析借助泰勒近似或蒙特卡洛模拟，使输入分布通过测量模型传播。<sup>[7](https://www.nist.gov/publications/concepts-principles-and-methods-assessment-measurement-uncertainty)</sup> |

## 这是怎样一种代数

固定一个概率空间 \( (\Omega, \mathcal{A}, P) \)。当且仅当对所有 \( a \le b \)，集合 \( \{X \in [a,b)\} \) 都属于 σ 代数 \( \mathcal{A} \) 时，映射 \( X : \Omega \to \mathbb{R} \) 是随机变量。<sup>[2](https://people.math.harvard.edu/~knill/teaching/math154_2026/handouts/lecture05.pdf)</sup> 既然随机变量是取实值的函数，它们就承袭了普通函数的逐点运算：\( (X+Y)(\omega) = X(\omega) + Y(\omega) \)，乘积与商同理。施普林格的表述直接给出封闭性：若 X 与 Y 是随机变量，则和 X + Y、积 X · Y 以及商 X/Y（Y ≠ 0）也是随机变量。<sup>[1](https://link.springer.com/chapter/10.1007/978-3-030-20103-6_4)</sup>

在这些运算之下，随机变量的全体构成一个代数 \( \mathcal{L} \)，即实数域上的一个向量空间，其中两个元素还可以相乘。<sup>[2](https://people.math.harvard.edu/~knill/teaching/math154_2026/handouts/lecture05.pdf)</sup> 在互不相交的可测集上取有限和 \( X = \sum_{i=1}^{n} \alpha_i \cdot 1_{A_i} \) 所得的阶梯函数，构成一个子代数，它是定义期望的出发点。<sup>[2](https://people.math.harvard.edu/~knill/teaching/math154_2026/handouts/lecture05.pdf)</sup>

可测性是唯一的限制，而在实践中它是温和的：在取全部子集为 σ 代数的有限概率空间上，每个函数都是随机变量；在取博雷尔 σ 代数的实轴上，所有分段连续函数都是可测的。<sup>[2](https://people.math.harvard.edu/~knill/teaching/math154_2026/handouts/lecture05.pdf)</sup> 一个与可测性相关的要点体现在时间上：定义在一次掷骰上的支付函数，相对于掷骰之前可获得的信息并不是随机变量，但相对于记录结果的更精细的 σ 代数就成为随机变量，因为可测性是相对于特定的 σ 代数定义的。<sup>[1](https://link.springer.com/chapter/10.1007/978-3-030-20103-6_4)</sup>

## 分布问题

分别知道 X 与 Y 的分布，本身并不能确定 X + Y 的分布；起决定作用的是这一对的联合行为。当 X 与 Y 独立时，和的密度是两个密度的卷积；对离散变量，和的概率质量函数通过对所有产生同一取值的数对求和而得。例如两枚均匀骰子，\( \mathbb{P}(X+Y=7) = \sum_x \mathbb{P}(X=x)\,\mathbb{P}(Y=7-x) \)，36 个数对中有六个有利数对，得 \( 6/36 = 1/6 \)。<sup>[8](https://wanghemath.github.io/Book-ProbabilityStatisticalTheory/chapters/chapter-05-transformations.html)</sup>

同样的区分适用于乘积：把边缘密度当作变量相互独立来相乘，只有在独立性的前提下才成立。<sup>[9](https://sunjh22.github.io/knowledge/statistics/probability-randomness/transformations-of-random-variables.html)</sup>

## 变换作为工作工具

**特征函数把和变成积。** 随机变量 X 的特征函数是 \( M_X(ju) = E[e^{juX}] \)。对独立随机变量 \( X_1, \ldots, X_N \)，记其和为 Y，则特征函数可分解为：

\[ M_Y(ju) = \prod_{i=1}^{N} M_{X_i}(ju), \]

若各加项独立同分布、公共特征函数为 \( M_X \)，则 \( M_Y(ju) = M_X^N(ju) \)。<sup>[3](https://ee.stanford.edu/~gray/sp.pdf)</sup> 原因在于，独立性使各因子 \( e^{juX_i} \) 之积的期望等于各自期望之积。<sup>[3](https://ee.stanford.edu/~gray/sp.pdf)</sup>

高斯情形显示了这一机制。均值为 m、方差为 \( \sigma^2 \) 的高斯随机变量，其特征函数为

\[ M_X(ju) = e^{jum - u^2\sigma^2/2}. \]

因此，n 个具有相同密度 \( N(m, \sigma^2) \) 的独立高斯变量之和，其特征函数为 \( e^{ju(nm) - u^2(n\sigma^2)/2} \)，即均值为 nm、方差为 \( n\sigma^2 \) 的高斯变量的特征函数。<sup>[3](https://ee.stanford.edu/~gray/sp.pdf)</sup> 同样的变换方法还能重新得到关于计数的经典封闭性结果：n 个独立伯努利(p)变量之和的特征函数为 \( [(1-p) + pe^{ju}]^n \)，反演即得二项概率质量函数 \( p_{Y_n}(k) = \binom{n}{k}(1-p)^{n-k}p^k \)。<sup>[3](https://ee.stanford.edu/~gray/sp.pdf)</sup> 独立泊松变量之和同样是泊松分布。<sup>[6](https://web.stanford.edu/class/archive/cs/cs109/cs109.1214/lectures/12-IndependentRVs/)</sup>

**拉普拉斯变换与梅林变换处理积与商。** 对独立正变量之积与商，梅林变换扮演特征函数对和所扮演的角色：1969 年一篇 SIAM 论文发展了求独立随机变量有理代数函数的密度与矩的方法，对和、差、积、商四种运算使用拉普拉斯变换与梅林变换，并给出两种变换之间的转换定理。<sup>[5](https://epubs.siam.org/doi/abs/10.1137/0118054)</sup> 商运算还额外要求知道分母变量的负矩。<sup>[10](https://www.sciencedirect.com/science/article/abs/pii/S0266892001000078)</sup>

## 矩：什么保持简单，什么不然

无论是否相依，期望都是线性的：\( E[X+Y] = E[X] + E[Y] \)。方差则不然。展开 \( \mathrm{Var}[X+Y] \) 得

\[ \mathrm{Var}[X+Y] = \mathrm{Var}[X] + \mathrm{Var}[Y] + 2\,\mathrm{Cov}[X,Y], \]

其中 \( \mathrm{Cov}[X,Y] = E[XY] - E[X]E[Y] \)。<sup>[4](https://lancaster.ac.uk/~prendivs/accessible/math230/math230_notes.tex/Ch7.S1.html)</sup> 协方差是双线性的，故 \( \mathrm{Var}[aX+bY] = a^2\mathrm{Var}[X] + b^2\mathrm{Var}[Y] + 2ab\,\mathrm{Cov}[X,Y] \)，且常数与随机变量之间的协方差为 0。<sup>[4](https://lancaster.ac.uk/~prendivs/accessible/math230/math230_notes.tex/Ch7.S1.html)</sup> 对独立变量，协方差项消失，方差相加；对相关变量，该项可正可负，这正是类似投资组合的和的方差取决于相依结构、而不只取决于边缘分布的原因。<sup>[4](https://lancaster.ac.uk/~prendivs/accessible/math230/math230_notes.tex/Ch7.S1.html)</sup>

## 中心极限定理作为代数极限

反复运用求和规则，便引出本主题最具影响的极限结果。亚伯拉罕·德·莫伊弗尔（Abraham de Moivre，1667–1754）最先提出中心极限定理，皮埃尔-西蒙·拉普拉斯（Pierre-Simon Laplace，1749–1827）随后加以证明；定理断言：对均值 μ 有限、方差 σ² 有限且为正的独立同分布随机变量，当 n 增大时，中心化并标准化后的和 (X₁ + ··· + Xₙ − nμ)/(σ√n) 依分布收敛于标准正态分布。<sup>[11](https://strimmerlab.github.io/publications/lecture-notes/probability-distribution-refresher/probability-distribution-refresher-a4.pdf)</sup><sup> • </sup><sup>[15](https://online.stat.psu.edu/stat414/Lesson27)</sup> 历史上，帕夫努季·切比雪夫（Pafnuty Chebyshev）于 1887 年用他的矩方法，对独立但不同分布的加项之和证明了中心极限定理的第一个版本，这一结果随后由他的学生马尔可夫（Markov）与李雅普诺夫（Liapunov）接手发展。<sup>[12](https://encyclopediaofmath.org/wiki/Chebyshev%2C_Pafnutii_Lvovich)</sup>

## 应用

**测量不确定度。** 在计量学中，输出量由测量模型 \( Y = f(X_1, \ldots, X_n) \) 定义，其输入是赋有概率分布的随机变量。直接法通过泰勒近似，或通过解析传播或蒙特卡洛传播，把输入分布传播到输出——这恰恰就是随机变量代数中求若干随机变量之函数的分布这一问题。<sup>[7](https://www.nist.gov/publications/concepts-principles-and-methods-assessment-measurement-uncertainty)</sup> NIST 的不确定度机器（Uncertainty Machine）针对该模型同时实现了 GUM 方法与 GUM 补充文件 1 的蒙特卡洛方法。<sup>[13](https://www.nist.gov/itl/sed/topic-areas/measurement-uncertainty)</sup>

**工程与商业分析。** 针对独立随机变量代数函数的梅林变换方法，是在工程与商业分析的实例中发展起来的，这些领域里不确定输入的和与比之类的量会自然出现。<sup>[5](https://epubs.siam.org/doi/abs/10.1137/0118054)</sup>

**实践中的告诫。** 应用工作中有两点区分很重要。第一，施加于随机变量的运算与施加于其密度的同一说法是两回事：带高斯噪声的测量之和仍是高斯分布，而贝叶斯法则做的是概率密度相乘，那是分布之间的运算，而非变量之间的运算。<sup>[14](https://www.mariushobbhahn.com/2021-04-29-RV_vs_pdf/)</sup> 第二，对变量作尺度变换，既不能造出独立重复，也不能消除研究设计中的混杂；变换改变的是分布，而不是生成数据的相依结构。<sup>[9](https://sunjh22.github.io/knowledge/statistics/probability-randomness/transformations-of-random-variables.html)</sup>

## References

1. [Random Variables (Definition 4.1, Proposition 4.1), Springer Nature Link](https://link.springer.com/chapter/10.1007/978-3-030-20103-6_4)
2. [Probability Theory, MATH 154 Unit 5: Random variables, Harvard University lecture notes](https://people.math.harvard.edu/~knill/teaching/math154_2026/handouts/lecture05.pdf)
3. [R. M. Gray, Probability, Random Processes, and Statistical Analysis (characteristic functions, chs. 3–4), Stanford](https://ee.stanford.edu/~gray/sp.pdf)
4. [Covariance and Correlation, Chapter 7 Linear transformations, Lancaster University math230 notes](https://lancaster.ac.uk/~prendivs/accessible/math230/math230_notes.tex/Ch7.S1.html)
5. [Probability Distributions of Algebraic Functions of Independent Random Variables, SIAM Journal on Applied Mathematics](https://epubs.siam.org/doi/abs/10.1137/0118054)
6. [CS109 Lecture 12: Independent Random Variables, Stanford University](https://web.stanford.edu/class/archive/cs/cs109/cs109.1214/lectures/12-IndependentRVs/)
7. [A. Possolo, Concepts, Principles, and Methods for the Assessment of Measurement Uncertainty, NIST](https://www.nist.gov/publications/concepts-principles-and-methods-assessment-measurement-uncertainty)
8. [Chapter 5: Transformations, Foundations of Probability and Statistical Theory](https://wanghemath.github.io/Book-ProbabilityStatisticalTheory/chapters/chapter-05-transformations.html)
9. [Transformations of Random Variables, Jiahong Sun](https://sunjh22.github.io/knowledge/statistics/probability-randomness/transformations-of-random-variables.html)
10. [Moment operations on random variables, with applications for probabilistic analysis, ScienceDirect](https://www.sciencedirect.com/science/article/abs/pii/S0266892001000078)
11. [Probability Distribution Refresher, Transformations and Convolution, Strimmer Lab notes](https://strimmerlab.github.io/publications/lecture-notes/probability-distribution-refresher/probability-distribution-refresher-a4.pdf)
12. [Chebyshev, Pafnutii Lvovich, Encyclopedia of Mathematics](https://encyclopediaofmath.org/wiki/Chebyshev%2C_Pafnutii_Lvovich)
13. [Measurement Uncertainty, NIST](https://www.nist.gov/itl/sed/topic-areas/measurement-uncertainty)
14. [Sums and products of random variables vs. probability density functions, Marius Hobbhahn](https://www.mariushobbhahn.com/2021-04-29-RV_vs_pdf/)
15. [online.stat.psu.edu](https://online.stat.psu.edu/stat414/Lesson27)

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

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Probability theory › Random variables › Algebra and transformations of random variables › Algebra of random variables (overview)

Copyright 2026 Edgepedia

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

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

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