📚 Discrete Random Variables: Distributions, Expectation and Variance | 离散随机变量:分布、期望与方差
Discrete random variables form one of the most heavily examined topics in A-Level Statistics. In the Edexcel A-Level Mathematics syllabus you are expected to define a discrete random variable, build its probability distribution, and calculate key measures such as expectation, variance and standard deviation. You must also handle linear transformations, the cumulative distribution function, and the properties of the discrete uniform distribution. This revision guide works through each of these ideas with definitions, formulas, tables and fully checked numerical examples.
离散随机变量是 A-Level 统计学中考查最频繁的内容之一。在 Edexcel A-Level 数学大纲中,你需要能够定义离散随机变量、构建它的概率分布,并计算期望、方差与标准差等关键度量。你还必须掌握线性变换、累积分布函数以及离散型均匀分布的性质。本文用定义、公式、表格和经过核验的数值例题,把这些知识点逐一讲透。
1. What is a Discrete Random Variable? | 什么是离散随机变量?
A random variable is a variable whose value depends on the outcome of a random event. We usually denote the random variable itself by an uppercase letter such as X, and the specific numerical values it can take by lowercase letters such as x. The variable is not a fixed number; it is a rule that assigns a number to each possible outcome of the experiment.
随机变量是一种取值依赖于随机事件结果的变量。我们通常用大写字母(如 X)表示随机变量本身,用小写字母(如 x)表示它可以取到的具体数值。它不是一个固定的数,而是一条把试验的每一个可能结果对应到一个数值的规则。
If the random variable can only take distinct, separate values that we can list one by one, it is called a discrete random variable. These values are usually obtained by counting rather than measuring. For example, the score when rolling a fair six-sided die is a discrete random variable taking the values 1, 2, 3, 4, 5 and 6. The number of heads when flipping three coins is another discrete random variable, with possible values 0, 1, 2 and 3.
如果随机变量只能取可以一一列出、彼此分散的数值,就称为离散随机变量。这类数值通常通过计数而非测量得到。例如,抛掷一枚公平六面骰子得到的点数就是一个离散随机变量,取值为 1、2、3、4、5、6。抛掷三枚硬币时正面朝上的次数也是离散随机变量,可能取值为 0、1、2、3。
Contrast this with a continuous random variable, such as the height of a student or the time taken to run 100 m, where the value can be any number in an interval and is obtained by measuring. For a discrete random variable we normally list the possible values as a set, for example x₁, x₂, x₃, …, xₙ, and the number of possible values may be finite or countably infinite.
与之相对的是连续型随机变量,例如一名学生的身高或跑完 100 米所用的时间,其取值可以是某个区间内的任意实数,通过测量得到。对于离散随机变量,我们通常把可能取值写成一个集合,例如 x₁、x₂、x₃、…、xₙ,可能取值的个数可以是有限个,也可以是可数无穷个。
2. Probability Distributions and the Probability Mass Function | 概率分布与概率质量函数
X together with the probability that X takes that value. The function that gives these probabilities is called the probability mass function (PMF), written as P(X = x).
对于任意离散随机变量 X,我们用它的概率分布来描述它的行为。这个分布列出 X 的每一个可能取值,以及 X 取该值的概率。给出这些概率的函数称为概率质量函数(PMF),记作 P(X = x)。
The PMF is often shown in a table, with the top row listing the values of x and the bottom row listing the corresponding probabilities. For instance, the distribution for a fair six-sided die is:
概率质量函数常用表格呈现,上一行列出 x 的取值,下一行列出对应的概率。例如,公平六面骰子的分布如下:
| x | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| P(X = x) | 1/6 | 1/6 | 1/6 | 1/6 | 1/6 | 1/6 |
A second example is the number of heads obtained when three fair coins are tossed. Counting the eight equally likely outcomes HHH, HHT, HTH, THH, HTT, THT, TTH, TTT gives the following distribution:
第二个例子是抛掷三枚公平硬币时正面朝上的次数。八种等可能结果 HHH、HHT、HTH、THH、HTT、THT、TTH、TTT 给出如下分布:
| x | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| P(X = x) | 1/8 | 3/8 | 3/8 | 1/8 |
Probabilities may be written as fractions, decimals or percentages, but in an exam you should keep fractions exact for as long as possible and only round at the final answer.
概率可以写成分数、小数或百分数,但在考试中应尽量保持分数形式精确计算,只在最后一步才四舍五入。
3. The Two Conditions for a Valid Distribution | 分布成立的两个条件
ity mass function only if two conditions are satisfied. First, every individual probability must lie between 0 and 1 inclusive. Second, the probabilities of all possible values must sum to exactly 1, because the random variable must take one of its listed values.
函数 P(X = x) 只有满足两个条件才是合法的概率质量函数。第一,每一个单独的概率都必须落在 0 与 1 之间(含端点)。第二,所有可能取值的概率之和必须恰好等于 1,因为随机变量必定取到所列出的某一个值。
0 ≤ P(X = x) ≤ 1 and Σ P(X = x) = 1
f the probabilities must equal 1, so k(1) + k(2) + k(3) = 6k = 1, giving k = 1/6. The three probabilities are then 1/6, 1/3 and 1/2, and they clearly add up to 1.
这两个条件是求分布中未知常数的标准方法。设 X 取值 1、2、3,且 P(X = x) = kx。概率之和必须等于 1,于是 k(1) + k(2) + k(3) = 6k = 1,得 k = 1/6。三个概率分别为 1/6、1/3 和 1/2,显然相加为 1。
f information, such as E(X) = 2.5, you may need to use the sum condition and the expectation condition together to form simultaneous equations.
在较长的题目中,k 可能出现在多个项里,所以务必先写出完整的求和式再求解。如果题目还给出另一条信息,例如 E(X) = 2.5,你可能需要把求和条件与期望条件联立成方程组来求解。
4. Expectation E(X) | 期望 E(X)
The expectation, or expected value, of a discrete random variable is its long-run average value. It is a weighted mean of the possible values, where each value is weighted by its probability. The formula is:
离散随机变量的期望(或期望值)是它的长期平均值。它是各可能取值的加权平均,权重就是各自的概率。公式为:
E(X) = μ = Σ x P(X = x)
ugh the die can never show 3.5. The expectation is the value we would expect the average of the scores to approach if we rolled the die a very large number of times.
注意 E(X) 不一定是 X 真正能取到的值。对公平六面骰子,E(X) = (1/6)(1 + 2 + 3 + 4 + 5 + 6) = 21/6 = 3.5,尽管骰子永远不可能掷出 3.5。期望是指如果掷骰子的次数非常巨大,点数的平均值将会趋近的那个值。
Expectation also has a useful physical interpretation: if you imagine placing masses equal to the probabilities at the positions x on a number line, E(X) is the point at which the system balances. In applied questions E(X) is often interpreted as a fair price, an average profit, or an expected number of successes, so always finish with a sentence explaining the value in context.
期望还有一个有用的物理解释:若把大小等于概率的质量放在数轴上的位置 x 处,E(X) 就是整个系统平衡的位置。在应用题中,E(X) 常被解释为公平价格、平均利润或期望成功次数,因此答题结束时一定要用一句话结合情境说明这个值的含义。
5. Variance and Standard Deviation | 方差与标准差
The expectation tells us where the distribution is centred, but not how spread out it is. The variance measures the average squared distance of the values from the mean. For a discrete random variable:
期望告诉我们分布的中心位置,却没有说明它的分散程度。方差度量的是各取值与均值之间距离平方的平均值。对于离散随机变量:
Var(X) = σ² = E((X − μ)²) = Σ (x − μ)² P(X = x)
Because the deviations are squared, the variance is never negative and is measured in squared units of X. To return to the original units we take the square root and obtain the standard deviation:
由于偏差被平方,方差永远非负,其单位是 X 单位的平方。为了回到原来的单位,我们取平方根,得到标准差:
σ = √Var(X)
The standard deviation is the more interpretable measure because it is in the same units as the data. A small standard deviation means the values cluster tightly around the mean; a large one means they are widely spread. In exam questions you are normally asked for the exact variance and then the standard deviation correct to three significant figures.
标准差更便于解释,因为它与数据本身单位相同。标准差小意味着取值紧密聚集在均值附近;标准差大则说明取值分散得很开。考试题目通常要求先给出精确的方差,再给出保留三位有效数字的标准差。
6. The Computational Formula for Variance | 方差的计算公式
Applying the definition directly means subtracting the mean from every value, which is slow and prone to rounding error. A much more efficient version of the same quantity is:
直接使用定义意味着要把每个取值都减去均值,既慢又容易产生舍入误差。同一数值有一个高效得多的等价形式:
Var(X) = E(X²) − [E(X)]²
re each value first and then take the weighted average. The two formulas always give exactly the same answer, and the second is the one recommended in the Edexcel formula booklet and in mark schemes.
其中 E(X²) = Σ x² P(X = x),也就是先把每个取值平方,再求加权平均。两个公式给出的答案完全相同,而第二个是 Edexcel 公式手册与评分标准中推荐使用的形式。
ded die: E(X) = 21/6 = 3.5, and E(X²) = (1/6)(1 + 4 + 9 + 16 + 25 + 36) = 91/6. Therefore:
把它用在公平六面骰子上:E(X) = 21/6 = 3.5,而 E(X²) = (1/6)(1 + 4 + 9 + 16 + 25 + 36) = 91/6。因此:
Var(X) = 91/6 − (7/2)² = 91/6 − 49/4 = 35/12 ≈ 2.917
The standard deviation is σ = √35/12 A very common error is to write E(X)² instead of [E(X)]², or to forget to square the mean at all, so check this line carefully every time.
标准差为 σ = √35/12 ≈ 1.71(三位有效数字)。一个极常见的错误是把 [E(X)]² 写成 E(X²),或者干脆忘记对均值平方,所以每次都要仔细检查这一步。
7. Linear Transformations of a Random Variable | 随机变量的线性变换
and b are constants. The mean and variance of Y are related to those of X in a simple way:
考试题经常把新的随机变量定义为 X 的线性函数,例如 Y = aX + b,其中 a、b 为常数。Y 的均值与方差和 X 的有简单关系:
E(aX + b) = a E(X) + b
Var(aX + b) = a² Var(X)
σ(aX + b) = |a| σ(X)
The key idea is that adding a constant b shifts every value by the same amount, so it moves the mean but does not change the spread, which is why b does not appear in the variance formula. Multiplying by a stretches or compresses the distribution, so the variance is multiplied by a², the square of the scale factor.
关键思想是:加上常数 b 会把每个取值都平移相同的量,因此均值随之移动,但分散程度不变,这就是 b 不出现在方差公式中的原因。乘以 a 会拉伸或压缩整个分布,因此方差要乘以比例因子的平方 a²。
hat the subtraction of 2 affects only the mean, never the variance or the standard deviation.
例如,若 E(X) = 2.7、Var(X) = 0.81,则对于 Y = 3X − 2,有 E(Y) = 3(2.7) − 2 = 6.1,Var(Y) = 9(0.81) = 7.29,σ(Y) = 3(0.9) = 2.7。请特别注意:减去 2 只影响均值,绝不影响方差或标准差。
8. The Discrete Uniform Distribution | 离散型均匀分布
The simplest discrete distribution is the discrete uniform distribution, in which every one of the n possible values is equally likely. If X takes the values 1, 2, 3, …, n with equal probability, we write X ~ U(n) or describe X as following a discrete uniform distribution on those values.
最简单的离散分布是离散型均匀分布,其中 n 个可能取值每一个出现的概率都相等。若 X 以相等概率取 1、2、3、…、n,我们记作 X ~ U(n),或说 X 服从这些取值上的离散型均匀分布。
P(X = x) = 1/n for x = 1, 2, …, n
E(X) = (n + 1)/2, Var(X) = (n² − 1)/12
917, again identical to the value we obtained by summing. This consistency is a good reason to trust the formula, but you should still be able to derive the results from first principles.
可以用骰子检验这些结果。取 n = 6,则 E(X) = (6 + 1)/2 = 3.5,与前面算出的结果一致;Var(X) = (36 − 1)/12 = 35/12 ≈ 2.917,也与逐项求和得到的值完全相同。这种一致性说明公式可信,但你仍应能从基本原理推导出这些结果。
Frequently the uniform distribution is defined on a general set of equally spaced values, such as a, a + d, a + 2d, …, a + (n − 1)d. In that case a linear transformation converts the problem back to the standard form, which is exactly why the transformation rules in the previous section matter.
均匀分布也常定义在一般的等间隔取值集合上,例如 a、a + d、a + 2d、…、a + (n − 1)d。这时用线性变换可把问题化回标准形式,这正是上一节变换规则重要性的体现。
9. The Cumulative Distribution Function F(x) | 累积分布函数 F(x)
The cumulative distribution function gives the probability that X is at most a given value. For a discrete random variable it is defined as:
累积分布函数给出 X 不超过某个给定值的概率。对于离散随机变量,它定义为:
F(x) = P(X ≤ x) = Σ P(X = t) for all t ≤ x
Because it is built by adding probabilities, F(x) is a non-decreasing step function which starts at 0 and finishes at 1. It is constant between the possible values of X and jumps at each value. Consider a random variable with values 1, 2, 3, 4 and probabilities 0.1, 0.3, 0.4 and 0.2:
由于它是通过累加概率得到的,F(x) 是一个非递减的阶梯函数,从 0 开始,最终到 1。它在 X 的相邻可能取值之间保持常数,并在每个取值处向上跳跃。考虑取值为 1、2、3、4、概率分别为 0.1、0.3、0.4、0.2 的随机变量:
| x | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| P(X = x) | 0.1 | 0.3 | 0.4 | 0.2 |
广告 / Sponsored 培生爱德思计算机科学学生用书教材Pearson Edexcel International GCSE Computer… 计算机 备考教辅 · 正版现货 · 与本文内容相关 查看详情 / View on Taobao参考价 ¥349.0
更多咨询请联系16621398022(同微信) 备考资讯每日更新,关注不错过 考纲变化 · 科目分析 · 学习方法 ![]() 在微信里长按二维码识别关注 或截图后用「扫一扫 → 相册」选择本图 公众号:tutorhao |
