📚 Expected Value and Variance of a Function of X | 随机变量函数的期望与方差
In probability and statistics, we often need to work not only with a random variable X itself, but also with a function of X, denoted g(X). Common examples include X2, 3X + 2, or even non-linear expressions like 1/X. Understanding how to compute the expected value E(g(X)) and the variance Var(g(X)) is a core skill in Edexcel A-Level Mathematics. This article will guide you through the definitions, proofs, and worked examples needed to master this topic.
在概率与统计中,我们不仅需要处理随机变量 X 本身,还经常需要处理 X 的函数,记作 g(X)。常见的例子包括 X2、3X + 2,甚至非线性表达式如 1/X。理解如何计算期望 E(g(X)) 和方差 Var(g(X)) 是 Edexcel A-Level 数学的核心能力。本文将通过定义、证明和详细例题,带你掌握这一主题。
1. Functions of a Random Variable | 随机变量的函数
A function of a random variable is any expression that depends on X. If X is the outcome of rolling a die, g(X) could be the square of the outcome, the outcome multiplied by 3, or something more complex. Since X is random, g(X) is also a random variable with its own probability distribution derived from X.
随机变量的函数是指任何依赖于 X 的表达式。如果 X 是掷骰子的结果,g(X) 可以是结果的平方、结果乘以 3,或更复杂的表达式。因为 X 是随机的,g(X) 也是一个随机变量,其概率分布由 X 决定。
For a discrete random variable X taking values x1, x2, …, xn with probabilities p1, p2, …, pn, the function g(X) takes values g(x1), g(x2), …, g(xn) with the same corresponding probabilities.
对于离散随机变量 X,其取值为 x1, x2, …, xn,对应概率为 p1, p2, …, pn,函数 g(X) 的取值为 g(x1), g(x2), …, g(xn),并且具有相同的对应概率。
2. Expected Value of a Function: Definition | 函数的期望:定义
The expected value (or mean) of g(X) is defined as the probability-weighted average of all possible values of g(X). For a discrete random variable X, this is given by:
函数 g(X) 的期望值(或均值)定义为 g(X) 所有可能取值的概率加权平均。对于离散随机变量 X,公式为:
E(g(X)) = Σ g(x) · P(X = x)
其中求和号 Σ 覆盖 X 的所有可能取值 x。
place x by g(x). The same idea applies when you are given a probability distribution table – add a column for g(x), multiply by the probabilities, and sum.
该公式是普通期望 E(X) = Σ x · P(X = x) 的直接推广,只需用 g(x) 替代 x 即可。当你得到一个概率分布表时,同样的思路——添加一列 g(x),乘以概率,再求和。
3. Illustrative Example: Computing E(X2) | 示例:计算 E(X2)
Consider a discrete random variable X with the following probability distribution:
考虑如下离散随机变量 X 的概率分布:
| x | 1 | 2 | 3 |
| P(X=x) | 0.2 | 0.5 | 0.3 |
We want to find E(X2). Here g(x) = x2. Calculate each term:
我们要求 E(X2)。这里 g(x) = x2。计算每一项:
12 × 0.2 = 1 × 0.2 = 0.2
22 × 0.5 = 4 × 0.5 = 2.0
32 × 0.3 = 9 × 0.3 = 2.7
Summing these gives E(X2) = 0.2 + 2.0 + 2.7 = 4.9.
求和得 E(X2) = 0.2 + 2.0 + 2.7 = 4.9。
This example shows that E(X2) is not simply (E(X))2, a common misconception.
这个例子表明 E(X2) 并非简单的 (E(X))2,这是一个常见误区。
4. Variance of a Function: General Formula | 函数的方差:一般公式
The variance of any random variable Y is defined as Var(Y) = E(Y2) – [E(Y)]2. Applying this to Y = g(X) gives:
任何随机变量 Y 的方差定义为 Var(Y) = E(Y2) – [E(Y)]2。将 Y = g(X) 代入得到:
Var(g(X)) = E([g(X)]2) – [E(g(X))]2
即先计算 g(X) 平方的期望,再减去 g(X) 期望的平方。
In practice, you first compute E(g(X)) and then E([g(X)]2) using the sum Σ [g(x)]2 · P(X=x). Then substitute into the variance formula.
实际操作中,你首先使用求和 Σ [g(x)]2 · P(X=x) 计算出 E(g(X)) 和 E([g(X)]2),然后代入方差公式。
5. Linear Functions: E(aX + b) and Var(aX + b) | 线性函数:E(aX + b) 与 Var(aX + b)
When g(X) is a simple linear transformation aX + b, there are powerful shortcut rules that every student must know. For constants a and b:
当 g(X) 是简单的线性变换 aX + b 时,有每个学生都必须掌握的强大快捷公式。对于常数 a 和 b:
E(aX + b) = a E(X) + b
Var(aX + b) = a2 Var(X)
Notice that adding a constant b shifts the expectation but has no effect on the variance. Multiplying by a constant a scales the expectation by a and the variance by a2.
注意,加上常数 b 会平移期望值,但对方差没有影响。乘以常数 a 会使期望乘 a,方差乘 a2。
6. Proving the Linearity of Expectation | 证明期望的线性性质
The rule E(aX + b) = aE(X) + b can be proved directly from the definition for discrete X:
公式 E(aX + b) = aE(X) + b 可以直接由离散 X 的定义证明:
E(aX + b) = Σ (a x + b) P(X = x) = a Σ x P(X = x) + b Σ P(X = x).
按照求和展开:E(aX + b) = Σ (a x + b) P(X = x) = a Σ x P(X = x) + b Σ P(X = x)。
aX + b) = a E(X) + b. This linearity holds for any discrete (and continuous) distribution.
由于 Σ P(X = x) = 1,且 Σ x P(X = x) = E(X),我们得到 E(aX + b) = a E(X) + b。该线性性质对所有离散(和连续)分布都成立。
7. Deriving Variance of a Linear Transformation | 推导线性变换的方差
To establish Var(aX + b) = a2 Var(X), we start from the variance definition and the linearity of expectation:
为建立 Var(aX + b) = a2 Var(X),我们从方差定义和期望的线性性质出发:
Var(aX + b) = E[(aX + b)2] – [E(aX + b)]2
展开平方项:(aX + b)2 = a2X2 + 2abX + b2。
Then E[(aX + b)2] = a2 E(X2) + 2ab E(X) + b2.
同时 [E(aX + b)]2 = (a E(X) + b)2 = a2 [E(X)]2 + 2ab E(X) + b2.
Subtracting gives Var = a2(E(X2) – [E(X)]2) = a2 Var(X). The terms involving b and 2ab cancel out neatly.
相减得到 Var = a2(E(X2) – [E(X)]2) = a2 Var(X)。含有 b 和 2ab 的项巧妙地抵消了。
8. Non-linear Functions: Worked Example with X2 | 非线性函数:X2 的例题
me distribution as before (x = 1, 2, 3; probabilities 0.2, 0.5, 0.3), we already found E(X2) = 4.9. Now we want Var(X2). This requires E((X2)2) = E(X4).
使用之前的分布(x = 1, 2, 3;概率 0.2, 0.5, 0.3),我们已经求得 E(X2) = 4.9。现在要求 Var(X2)。这需要计算 E((X2)2) = E(X4)。
Compute E(X4): 14(0.2) + 16(0.5) + 81(0.3) = 0.2 + 8 + 24.3 = 32.5.
计算 E(X4):14(0.2) + 16(0.5) + 81(0.3) = 0.2 + 8 + 24.3 = 32.5。
Then Var(X2) = E(X4) – [E(X2)]2 = 32.5 – (4.9)2 = 32.5 – 24.01 = 8.49.
因此 Var(X2) = E(X4) – [E(X2)]2 = 32.5 – 24.01 = 8.49。
Notice how the non-linear transformation X2 produced a variance that cannot be obtained by simply applying the linear shortcut.
请注意,非线性变换 X2 产生的方差无法通过简单的线性快捷方式获得。
9. Combined Example: Expectation and Variance of 3X – 2 | 综合例题:3X – 2 的期望与方差
and variance of X from the same table. E(X) = 1(0.2) + 2(0.5) + 3(0.3) = 0.2 + 1.0 + 0.9 = 2.1.
首先,从同一表格中求 X 的基本期望和方差。E(X) = 1(0.2) + 2(0.5) + 3(0.3) = 0.2 + 1.0 + 0.9 = 2.1。
Var(X) = E(X2) – [E(X)]2 = 4.9 – (2.1)2 = 4.9 – 4.41 = 0.49.
现在应用线性公式:E(3X – 2) = 3E(X) – 2 = 3(2.1) – 2 = 6.3 – 2 = 4.3.
Var(3X – 2) = 32 Var(X) = 9 × 0.49 = 4.41.
These results are consistent with what you would get by constructing a new distribution for 3X–2 and computing directly, but the shortcut saves time and reduces errors.
这些结果与直接为 3X–2 构建新分布并计算所得一致,但快捷方法节省时间并减少错误。
10. Common Pitfalls and Misconceptions | 常见错误与误区
Mistake 1: . Remember that adding a constant does not change the spread, so the b disappears and the coefficient a is squared.
错误 1:误认为 Var(aX + b) = a Var(X) + b。请记住,加上常数不会改变离散程度,所以 b 消失,系数 a 需平方。
Mistake 2: Using linear formulas for non-linear functions such as X2 or 1/X. There is no shortcut; you must compute E(g(X)) and E([g(X)]2) from first principles using the distribution.
错误 2:对非线性函数(如 X2 或 1/X)使用线性公式。这里没有捷径;你必须从基本原理出发,利用分布计算 E(g(X)) 和 E([g(X)]2)。
Mistake 3: Forgetting that the sum of probabilities in the distribution must be 1. Always check this before performing calculations.
错误 3:忘记分布中概率之和必须为 1。计算前务必检查这一点。
11. Summary and Exam Tips | 总结与考试技巧
To tackle exam questions on the expected value and variance of a function of X, remember:
要解答关于随机变量函数的期望与方差的考题,请记住:
- For any function g(X), use E(g(X)) = Σ g(x) P(X=x) and Var(g(X)) = E([g(X)]2) – [E(g(X))]2.
- 对于任意函数 g(X),使用 E(g(X)) = Σ g(x) P(X=x) 和 Var(g(X)) = E([g(X)]2) – [E(g(X))]2。
- For linear functions aX + b, simply apply E(aX + b) = aE(X) + b and Var(aX + b) = a2Var(X).
- 对于线性函数 aX + b,直接应用 E(aX + b) = aE(X) + b 和 Var(aX + b) = a2Var(X)。
- Show clear working, including the extra columns for g(x) and [g(x)]2 when the distribution is given in a table.
- 展示清晰的计算步骤,当分布以表格形式给出时,包含 g(x) 和 [g(x)]2 的附加列。
- Double-check that your final variance is non-negative and that the arithmetic is correct.
- 反复检查最终方差为非负且算术正确。
12. Final Words | 结语
Mastering the expectation and variance of a function of X is a vital stepping stone to more advanced topics such as linear combinations of independent random variables and the Central Limit Theorem. With diligent practice of both linear shortcuts and the fundamental sum-based method, you will confidently handle any Edexcel A-Level Statistics question.
掌握随机变量函数的期望与方差是通向更高级主题(如独立随机变量的线性组合和中心极限定理)的关键基石。通过认真练习线性快捷方法和基础的求和法,你将自信地应对任何 Edexcel A-Level 统计问题。
Published by TutorHao | Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图