📚 Data Coding: The Core Technique for Simplifying Statistical Calculations | 数据编码:简化统计计算的核心技巧
Data coding is one of the most powerful and frequently tested techniques in A-Level Mathematics. When raw data contain large or awkward numbers, direct calculation of the mean, variance, and standard deviation can be tedious and prone to arithmetic errors. Coding transforms the data into simpler values using a linear relationship, allows all the necessary statistics to be computed from the coded values, and then converts the results back to the original scale. This article explains the principles, demonstrates worked examples, and highlights the common pitfalls students must avoid.
数据编码是A-Level数学中最强大且最常被考查的技巧之一。当原始数据包含较大或较不规整的数字时,直接计算均值、方差和标准差会十分繁琐,且很容易产生算术错误。编码通过一个线性关系将数据变换为更简单的数值,利用编码值计算所有所需的统计量,再将结果还原到原始尺度。本文将解释其原理、演示典型例题,并指出学生必须避免的常见陷阱。
1. What Is Data Coding? | 什么是数据编码?
Coding (also called “transformation of data”) is the process of applying a linear transformation of the form y = (x − a) / b to every data value x, producing a coded value y. The constant a is chosen to shift the data, and the constant b is chosen to scale the data. The goal is to make the numbers smaller, rounder, and easier to work with before calculating statistical quantities such as the mean, variance, and standard deviation.
编码(也称为”数据变换”)是指对每一个数据值 x 施加形如 y = (x − a) / b 的线性变换,从而得到编码值 y 的过程。常数 a 用于平移数据,常数 b 用于缩放数据。其目标是使数字更小、更整齐、更容易计算,然后再去计算均值、方差和标准差等统计量。
For example, if the data are 402, 398, 405, 397, 403, and 395, choosing a = 400 and b = 1 gives coded values 2, −2, 5, −3, 3, and −5 — much smaller numbers to manipulate by hand.
例如,如果数据为 402、398、405、397、403 和 395,选择 a = 400、b = 1,则可得到编码值 2、−2、5、−3、3 和 −5——这些数字要小得多,手算起来非常方便。
2. The Coding Formula | 编码公式
The key formula connecting the original value x and the coded value y is:
y = (x − a) / b ⇔ x = a + by
The inverse relationship is essential. When we have computed statistics on y, we substitute back using x = a + by. Note that b must be positive for standard deviation to transform simply without sign complications; exam questions always use b > 0.
逆关系至关重要。当我们计算出关于 y 的统计量后,就用 x = a + by 代入还原。注意 b 必须为正数,否则标准差在还原时会产生符号上的麻烦;考试题目中 b 始终取正数。
Since the transformation is linear, every statistical measure in the coded data corresponds to a well-defined measure in the original data, and the relationship is determined solely by a and b.
由于该变换是线性的,编码数据中的每一个统计量都对应着原始数据中一个有明确定义的统计量,其关系仅由 a 和 b 决定。
3. Effect on the Mean | 对均值的影响
If y = (x − a) / b, then the coded mean is related to the original mean by:
ȳ = (x̄ − a) / b ⇒ x̄ = a + bȳ
In words: subtracting a reduces the mean by a, and dividing by b reduces the mean by a factor of b. Adding or subtracting a constant changes the location of the data but not its spread; multiplying or dividing by a constant changes both the location and the spread.
换言之:减去 a 会使均值减少 a;除以 b 会使均值缩小为原来的 1/b。加减常数只会改变数据的位置而不影响其离散程度;乘除常数则同时改变位置和离散程度。
This is why the coded mean is usually much easier to calculate: the coded values are small and often roughly symmetrical around zero, so the coded mean is frequently a very simple fraction or even zero.
这就是编码均值通常更容易计算的原因:编码值很小,而且常常围绕零大致对称,因此编码均值往往是一个很简单的分数,甚至就是零。
4. Effect on Variance and Standard Deviation | 对方差和标准差的影响
For variance, the key result is:
Var(y) = Var(x) / b² ⇒ Var(x) = b² × Var(y)
Because adding or subtracting a constant shifts every value equally, it does not change the variance at all. Dividing by b reduces the variance by a factor of b². For standard deviation, the relationship is:
因为加减常数对所有数据值的影响完全相同,所以完全不改变方差。除以 b 会使方差缩小为原来的 1/b²。对于标准差,其关系为:
σ_y = σ_x / b ⇒ σ_x = b × σ_y
The standard deviation is scaled by the factor b only; a has no effect on it. This is a favourite exam question: candidates are given coded summary statistics and asked to find the original variance or standard deviation.
标准差只按因子 b 缩放;a 对其没有任何影响。这是考试中非常喜欢考查的问题类型:题目给出编码后的汇总统计量,要求考生求出原始的方差或标准差。
5. Effect on Median, Quartiles, and Range | 对中位数、四分位数和极差的影响
The median and quartiles transform in exactly the same linear way as the mean:
中位数和四分位数与均值一样,按完全相同的线性方式变换:
Median_x = a + b × Median_y
Q₁_x = a + b × Q₁_y
Q₃_x = a + b × Q₃_y
Similarly, the range transforms according to Range_x = b × Range_y, because subtracting a cancels out when we take the difference between the largest and smallest values. The interquartile range follows the same rule: IQR_x = b × IQR_y.
类似地,极差的变换规律为 Range_x = b × Range_y,因为最大值与最小值相减时,a 会被抵消。四分位距同样遵循该规律:IQR_x = b × IQR_y。
These results allow a full set of original-data summaries to be recovered from coded summaries, which is precisely what many exam questions demand. Students should memorise both the forward and the inverse relationships for each measure.
利用这些结论,可以从编码汇总统计量还原出完整的原始数据汇总值,这正是许多考试题目的要求。学生应当熟记每一个统计量的正变换和逆变换关系。
6. Worked Example 1 — Full Data | 例题1——完整数据
The following sample data represent lengths in cm: 402, 398, 405, 397, 403, 395. Use the coding y = x − 400 to find the mean and standard deviation of the original data.
以下样本数据表示长度(单位:cm):402、398、405、397、403、395。利用编码 y = x − 400 求原始数据的均值和标准差。
| x | 402 | 398 | 405 | 397 | 403 | 395 |
| y = x − 400 | 2 |
Published by TutorHao | Mathematics Revision Series | aleveler.com 更多咨询请联系16621398022(同微信) CommentsMore posts |
屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导