Expectation and Variance of Functions of Random Variables | 随机变量函数的期望与方差

📚 Expectation and Variance of Functions of Random Variables | 随机变量函数的期望与方差

In A-Level Further Mathematics (Edexcel), you are often required to find the expectation and variance not only of a random variable X itself, but also of a function of X, such as g(X) = X², 2X + 1, or more complex expressions. This topic builds directly on the definitions of E(X) and Var(X) and extends them to transformed variables encountered in probability models and statistical inference.

在 Edexcel 进阶数学中,我们不仅要计算随机变量 X 自身的期望与方差,还经常需要计算 X 的某个函数 g(X) 的期望与方差,例如 g(X)=X²、g(X)=2X+1 或更复杂的表达式。这一主题直接建立在 E(X) 和 Var(X) 的定义之上,并将其推广到概率模型与统计推断中常见的变换变量。


1. Review of Expectation and Variance | 期望与方差回顾

For a discrete random variable X with probability mass function P(X = x), the expectation is defined as E(X) = Σ x · P(X = x), and the variance is Var(X) = E(X²) − [E(X)]². The variance measures the spread of the distribution around the mean.

对于离散型随机变量 X,设其概率质量函数为 P(X=x),期望定义为 E(X)=Σ x·P(X=x),方差定义为 Var(X)=E(X²)−[E(X)]²。方差衡量分布围绕均值的离散程度。

For a continuous random variable X with probability density function f(x), the expectation is E(X) = ∫ x f(x) dx, and Var(X) = ∫ (x − μ)² f(x) dx = E(X²) − μ², where μ = E(X). These definitions form the foundation for all results in this article.

对于连续型随机变量 X,设其概率密度函数为 f(x),期望为 E(X)=∫ x f(x) dx,方差为 Var(X)=∫ (x−μ)² f(x) dx = E(X²)−μ²,其中 μ=E(X)。这些定义是本文所有结论的基础。

Throughout, we assume that all sums and integrals converge absolutely, which is always true in the standard A-Level context.

本文始终假设所有求和与积分绝对收敛,这在标准 A-Level 考试中总是成立的。


2. Expectation of a Function E[g(X)] | 函数 g(X) 的期望

The most important idea is that E[g(X)] is computed directly using the original distribution of X. You do not need to find the distribution of g(X) first. For a discrete variable, E[g(X)] = Σ g(x) · P(X = x). For a continuous variable, E[g(X)] = ∫ g(x) f(x) dx.

最关键的思想是:E[g(X)] 直接使用 X 的原始分布计算,而不必先求出 g(X) 的分布。对于离散型变量,E[g(X)]=Σ g(x)·P(X=x);对于连续型变量,E[g(X)]=∫ g(x) f(x) dx。

This is sometimes called the “law of the unconscious statistician” because it is easy to forget that the expectation must be weighted by the probabilities or density of X, not by those of g(X).

这个公式有时被称为“无意识统计学家定律”,因为初学者容易忘记:期望必须用 X 的概率或密度加权,而不是用 g(X) 的。

E[g(X)] = Σ g(x) P(X=x) (discrete) or E[g(X)] = ∫ g(x) f(x) dx (continuous)

For example, if X takes values 1, 2, 3 with probabilities 0.2, 0.3, 0.5, then E(X²) = 1²(0.2) + 2²(0.3) + 3²(0.5) = 0.2 + 1.2 + 4.5 = 5.9.

例如,若 X 取值 1,2,3,概率分别为 0.2,0.3,0.5,则 E(X²)=1²×0.2+2²×0.3+3²×0.5=0.2+1.2+4.5=5.9。


3. Linearity of Expectation | 期望的线性性质

For any constants a and b, E(aX + b) = aE(X) + b. This holds for every random variable, whether discrete or continuous, and does not require any independence condition.

对于任意常数 a 和 b,恒有 E(aX+b)=aE(X)+b。该性质对任何随机变量都成立,无论离散还是连续,且不要求独立性条件。

Moreover, for any two random variables X and Y, E(X + Y) = E(X) + E(Y), and more generally E(aX + bY) = aE(X) + bE(Y). This linearity is one of the most powerful tools in probability, as it allows complicated expressions to be broken into simpler parts.

进一步,对于任意两个随机变量 X 和 Y,E(X+Y)=E(X)+E(Y),更一般地 E(aX+bY)=aE(X)+bE(Y)。线性性质是概率论中最强大的工具之一,它允许我们将复杂表达式拆分为简单部分。

However, note that linearity does not extend to nonlinear functions: in general E(X²) ≠ [E(X)]², and E(1/X) ≠ 1/E(X). You must always apply the direct definition for nonlinear g.

但注意,线性性质不能推广到非线性函数:一般而言 E(X²)≠[E(X)]²,E(1/X)≠1/E(X)。对于非线性 g,必须始终使用直接定义计算。


4. Variance of a Function: General Formula | 函数方差的通用公式

For any function g(X), the variance is defined by Var(g(X)) = E[(g(X) − E[g(X)])²]. Expanding the square gives the computational formula:

对于任意函数 g(X),其方差定义为 Var(g(X))=E[(g(X)−E[g(X)])²]。展开平方后得到计算式:

Var(g(X)) = E[g(X)²] − (E[g(X)])²

This formula is always valid. It is often easier to compute E[g(X)²] and E[g(X)] separately, then subtract. Do not attempt to find the distribution of g(X) unless instructed.

该公式始终有效。通常更简便的做法是分别计算 E[g(X)²] 和 E[g(X)],再相减。除非题目明确要求,否则不要试图先求出 g(X) 的分布。

For example, if g(X) = X², then Var(X²) = E(X⁴) − [E(X²)]². This requires the fourth moment of X, so you must be comfortable computing higher moments of standard distributions.

例如,若 g(X)=X²,则 Var(X²)=E(X⁴)−[E(X²)]²。这需要 X 的四阶矩,因此必须熟练计算标准分布的更高阶矩。


5. Variance of a Linear Transformation | 线性变换的方差

When g(X) = aX + b, the variance simplifies dramatically. Because shifting by b does not change spread, and scaling by a multiplies the variance by a², we obtain:

当 g(X)=aX+b 时,方差会大幅简化。由于加减常数 b 不改变离散程度,而乘以 a 会使方差变为原来的 a² 倍,因此得到:

Var(aX + b) = a² Var(X)

Equivalently, the standard deviation satisfies SD(aX + b) = |a| SD(X). This result is essential for standardising normal variables: if X ~ N(μ, σ²), then Z = (X − μ)/σ has mean 0 and variance 1.

等价地,标准差满足 SD(aX+b)=|a| SD(X)。这一结果对正态变量的标准化至关重要:若 X~N(μ,σ²),则 Z=(X−μ)/σ 的均值为 0,方差为 1。

Common mistake: some students write Var(2X) = 2 Var(X). This is false; the correct result is Var(2X) = 4 Var(X). Remember the square.

常见错误:有些学生会写成 Var(2X)=2Var(X)。这是错误的;正确结果是 Var(2X)=4Var(X)。记住要平方。


6. Linear Combinations of Independent Variables | 独立变量的线性组合

If X and Y are independent random variables, and a, b, c, d are constants, then E(aX + bY + c) = aE(X) + bE(Y) + c. The variance is:

若 X 与 Y 是独立随机变量,a、b、c、d 为常数,则 E(aX+bY+c)=aE(X)+bE(Y)+c。其方差为:

Var(aX + bY + c) = a² Var(X) + b² Var(Y)

Notice that the constant c disappears because it only shifts the location, not the spread. Independence is crucial: if X and Y are not independent, a covariance term must be added.

注意常数 c 消失,因为它只改变位置,不改变离散度。独立性至关重要:若 X 与 Y 不独立,则必须加上协方差项。

For example, if X ~ Bin(n₁, p) and Y ~ Bin(n₂, p) are independent, then X + Y ~ Bin(n₁ + n₂, p). Using the linear combination formula, E(X + Y) = n₁p + n₂p = (n₁ + n₂)p, and Var(X + Y) = n₁p(1−p) + n₂p(1−p) = (n₁ + n₂)p(1−p), matching the known binomial result.

例如,若 X~Bin(n₁,p) 与 Y~Bin(n₂,p) 独立,则 X+Y~Bin(n₁+n₂,p)。利用线性组合公式,E(X+Y)=n₁p+n₂p=(n₁+n₂)p,Var(X+Y)=n₁p(1−p)+n₂p(1−p)=(n₁+n₂)p(1−p),与已知二项分布结论一致。


7. Expectation and Variance of Sample Mean | 样本均值的期望与方差

Let X₁, X₂, …, Xₙ be independent and identically distributed random variables with mean μ and variance σ². Define the sample mean X̄ = (1/n) Σ Xᵢ. Then:

设 X₁,X₂,…,Xₙ 是独立同分布的随机变量,均值为 μ,方差为 σ²。定义样本均值 X̄=(1/n)Σ Xᵢ。则:

E(X̄) = μ, Var(X̄) = σ² / n

This result explains why larger samples give more precise estimates: the variance of the sample mean decreases proportionally to 1/n. The derivation uses linearity of expectation and the variance formula for linear combinations.

这一结果解释了为什么更大的样本能给出更精确的估计:样本均值的方差按 1/n 的比例减小。推导过程使用了期望的线性性质以及线性组合的方差公式。

In Edexcel Further Statistics, this appears in the context of unbiased estimators and confidence intervals. You should be able to prove these formulas from first principles.

在 Edexcel 进阶统计中,该结论出现在无偏估计量和置信区间的背景下。你应该能够从基本原理出发证明这些公式。


8. Functions Involving Squares: E(X²) and Var(X²) | 涉及平方的函数:E(X²) 与 Var(X²)

Finding E(X²) is often done via the identity Var(X) = E(X²) − [E(X)]², so E(X²) = Var(X) + [E(X)]². For standard distributions, both Var(X) and E(X) are known, so E(X²) can be written directly.

求 E(X²) 常借助恒等式 Var(X)=E(X²)−[E(X)]²,因此 E(X²)=Var(X)+[E(X)]²。对于标准分布,Var(X) 与 E(X) 均已知,可直接写出 E(X²)。

However, Var(X²) requires E(X⁴), which is not always listed in formula booklets. For a normal distribution, if X ~ N(μ, σ²), the fourth central moment is 3σ⁴, but E(X⁴) depends on μ as well. You must compute it carefully.

然而,Var(X²) 需要 E(X⁴),而它不一定列在公式册中。例如对于正态分布 X~N(μ,σ²),四阶中心矩为 3σ⁴,但 E(X⁴) 还依赖于 μ。你必须仔细计算。

For a standard normal Z ~ N(0,1), E(Z) = 0, Var(Z) = 1, so E(Z²) = 1. Also E(Z⁴) = 3, hence Var(Z²) = E(Z⁴) − [E(Z²)]² = 3 − 1 = 2. This is a useful quick example.

对于标准正态 Z~N(0,1),E(Z)=0,Var(Z)=1,所以 E(Z²)=1。又 E(Z⁴)=3,故 Var(Z²)=E(Z⁴)−[E(Z²)]²=3−1=2。这是一个有用的快速示例。


9. Worked Example: Discrete Random Variable | 例题:离散型随机变量

Suppose X has the following probability distribution:

设 X 的概率分布如下:

x 1 2 3 4
P(X=x) 0.1 0.2 0.3 0.4

Find E(2X + 1) and Var(2X + 1).

求 E(2X+1) 与 Var(2X+1)。

First, E(X) = 1(0.1) + 2(0.2) + 3(0.3) + 4(0.4) = 0.1 + 0.4 + 0.9 + 1.6 = 3.0. Also E(X²) = 1(0.1) + 4(0.2) + 9(0.3) + 16(0.4) = 0.1 + 0.8 + 2.7 + 6.4 = 10.0.

首先,E(X)=1×0.1+2×0.2+3×0.3+4×0.4=0.1+0.4+0.9+1.6=3.0。又 E(X²)=1×0.1+4×0.2+9×0.3+16×0.4=0.1+0.8+2.7+6.4=10.0。

Thus Var(X) = E(X²) − [E(X)]² = 10 − 9 = 1. Then E(2X + 1) = 2(3) + 1 = 7, and Var(2X + 1) = 2² Var(X) = 4 × 1 = 4.

因此 Var(X)=E(X²)−[E(X)]²=10−9=1。于是 E(2X+1)=2×3+1=7,Var(2X+1)=2²×Var(X)=4×1=4。

Now find E(X² + 1) and Var(X² + 1). Here g(X) = X² + 1. E(X² + 1) = E(X²) + 1 = 11. For the variance, Var(X² + 1) = Var(X²) because adding a constant does not change variance.

再求 E(X²+1) 与 Var(X²+1)。这里 g(X)=X²+1。E(X²+1)=E(X²)+1=11。对于方差,Var(X²+1)=Var(X²),因为加常数不改变方差。

We need E(X⁴) = 1⁴(0.1) + 2⁴(0.2) + 3⁴(0.3) + 4⁴(0.4) = 1(0.1) + 16(0.2) + 81(0.3) + 256(0.4) = 0.1 + 3.2 + 24.3 + 102.4 = 130.0. Thus Var(X²) = E(X⁴) − [E(X²)]² = 130 − 100 = 30.

我们需要 E(X⁴)=1⁴×0.1+2⁴×0.2+3⁴×0.3+4⁴×0.4=1×0.1+16×0.2+81×0.3+256×0.4=0.1+3.2+24.3+102.4=130.0。故 Var(X²)=E(X⁴)−[E(X²)]²=130−100=30。


10. Worked Example: Continuous Random Variable | 例题:连续型随机变量

Let X have probability density function f(x) = 2x for 0 ≤ x ≤ 1, and 0 otherwise. Find E(√X) and Var(√X).

设 X 的概率密度函数为 f(x)=2x,0≤x≤1,其余为 0。求 E(√X) 与 Var(√X)。

Using the direct formula, E(√X) = ∫₀¹ √x · 2x dx = ∫₀¹ 2x^(3/2) dx = 2 × [x^(5/2) / (5/2)] from 0 to 1 = 2 × (2/5) = 4/5.

利用直接公式,E(√X)=∫₀¹ √x·2x dx=∫₀¹ 2x^(3/2) dx=2×[x^(5/2)/(5/2)]₀¹=2×(2/5)=4/5。

Next, E[(√X)²] = E(X) = ∫₀¹ x · 2x dx = ∫₀¹ 2x² dx = 2/3. Therefore Var(√X) = E[(√X)²] − [E(√X)]² = 2/3 − (4/5)² = 2/3 − 16/25 = (50 − 48)/75 = 2/75.

接着,E[(√X)²]=E(X)=∫₀¹ x·2x dx=∫₀¹ 2x² dx=2/3。因此 Var(√X)=E[(√X)²]−[E(√X)]²=2/3−(4/5)²=2/3−16/25=(50−48)/75=2/75。

This example illustrates why direct integration is often simpler than finding the distribution of √X, especially for variance.

此例说明,直接积分通常比先求 √X 的分布更简单,尤其是计算方差时。


11. Common Pitfalls and Exam Tips | 常见陷阱与考试技巧

The most common error is applying linearity to nonlinear functions. Remember that E(X²) ≠ [E(X)]² unless X is constant. Similarly, Var(X²) is not the square of Var(X); you must compute the fourth moment.

最常见的错误是将线性性质套用于非线性函数。记住 E(X²)≠[E(X)]²,除非 X 是常数。同样,Var(X²) 不是 Var(X) 的平方;你必须计算四阶矩。

  • Always write down the computational formula Var(g(X)) = E[g(X)²] − (E[g(X)])² before substituting values.
  • 始终先写出计算式 Var(g(X))=E[g(X)²]−(E[g(X)])²,再代入数值。
  • For linear functions, use Var(aX + b) = a² Var(X) directly, but never forget to ignore b.
  • 对于线性函数,直接使用 Var(aX+b)=a² Var(X),但切勿忘记忽略 b。
  • Check whether X and Y are independent before using Var(X + Y) = Var(X) + Var(Y). If not independent, you need covariance.
  • 在使用 Var(X+Y)=Var(X)+Var(Y) 前,先检查 X 与 Y 是否独立。若不独立,则需要协方差。
  • In continuous problems, verify that the pdf integrates to 1 and note the limits of integration carefully.
  • 在连续型问题中,先验证概率密度函数积分为 1,并仔细注意积分限。

In the exam, show every intermediate step: E(X), E(X²), E[g(X)], and E[g(X)²] separately. Method marks are awarded for these stages even if the final answer is wrong.

考试中请展示每个中间步骤:E(X)、E(X²)、E[g(X)] 与 E[g(X)²] 分别列出。即使最终答案错误,这些步骤也能获得步骤分。


12. Connection to Moment Generating Functions and Further Study | 与矩生成函数的联系及拓展

In Further Statistics, the moments E(X), E(X²), E(X³), … are collectively called the moments of the distribution. The function M(t) = E(e^(tX)) is the moment generating function (mgf), and its derivatives at t = 0 give the moments: M'(0) = E(X), M”(0) = E(X²).

在进阶统计中,E(X)、E(X²)、E(X³)……统称为分布的矩。函数 M(t)=E(e^(tX)) 是矩生成函数 (mgf),其在 t=0 处的导数给出各阶矩:M'(0)=E(X),M”(0)=E(X²)。

This provides a powerful alternative method for finding E[g(X)] when g involves exponentials or powers. For example, E(e^(tX)) can be evaluated by summing or integrating e^(tx) against the distribution of X.

这为求 E[g(X)] 提供了一种强有力的替代方法,尤其是当 g 涉及指数或幂时。例如,E(e^(tX)) 可以通过对 e^(tx) 关于 X 的分布求和或积分得到。

Understanding expectation and variance of functions of random variables also prepares you for regression analysis, method of moments estimation, and maximum likelihood estimation in university-level statistics.

理解随机变量函数的期望与方差,也为大学阶段的回归分析、矩估计法和极大似然估计打下基础。


Published by TutorHao | Further Mathematics Revision Series | aleveler.com

更多咨询请联系16621398022(同微信)

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading