📚 A-Level Further Maths: Degrees of Freedom — Intuitive Understanding & Calculation | A-Level进阶数学:自由度的直观理解与计算
Degrees of freedom (df) is one of the most frequently misunderstood concepts in A-Level Further Mathematics, especially when it appears in chi-squared tests, t-distributions, and hypothesis testing. Yet the idea is surprisingly simple once you strip away the formulas. This article will give you a clear, intuitive picture of what degrees of freedom really mean, followed by a practical guide to calculating them correctly in the contexts Edexcel expects you to master.
自由度(df)是A-Level进阶数学中最容易被误解的概念之一,尤其是在卡方检验、t分布和假设检验中频繁出现的时候。然而,一旦你抛开公式,这个想法其实惊人地简单。本文将为你提供一个清晰、直观的理解框架,然后给出在Edexcel考纲要求的情境中正确计算自由度的实用指南。
1. What Are Degrees of Freedom, Really? | 自由度到底是什么?
Imagine you are asked to pick three numbers that add up to 10. You can freely choose the first number — say 4. You can freely choose the second number — say 5. But now, the third number is forced: it must be 1. You had 3 numbers but only 2 free choices. The degrees of freedom here is 2.
想象一下,你需要选三个数字,使它们加起来等于10。第一个数字你可以自由选择——比如说4;第二个数字你仍然可以自由选择——比如说5;但此时第三个数字就被迫确定了:它必须是1。你有3个数字,却只有2个自由选择。这里的自由度就是2。
Formally, the degrees of freedom of a statistic is the number of independent pieces of information that are free to vary after all constraints have been applied. Every time you estimate a parameter from your data, you "spend" one degree of freedom, because the estimated parameter imposes a constraint on the data.
正式地说,一个统计量的自由度,是在所有约束条件施加之后,仍然可以自由变动的独立信息数量。每当你从数据中估计一个参数,你就“消耗”了一个自由度,因为被估计的参数给数据施加了一个约束。
This is the single most important sentence in this article: df = number of independent observations − number of estimated parameters.
这就是本文中最重要的一句话:自由度 = 独立观测值数量 − 估计参数数量。
2. The Classical Example: Sample Variance | 经典例子:样本方差
You have n independent observations x₁, x₂, …, xₙ. You want to compute the sample variance:
你有n个独立观测值 x₁, x₂, …, xₙ。你想计算样本方差:
s² = Σ(xᵢ − x̄)² / (n − 1)
Why divide by n − 1 and not n? Because you first had to estimate the sample mean x̄. The moment x̄ is known, the n deviations (xᵢ − x̄) are no longer all free. If you know any n − 1 of the deviations, the last one is automatically determined by the requirement that the deviations sum to zero. Thus only n − 1 pieces of independent information remain.
为什么要除以 n − 1 而不是 n?因为你首先必须估计样本均值 x̄。一旦 x̄ 已知,n 个偏差 (xᵢ − x̄) 就不再全部自由。如果你知道任意 n − 1 个偏差,最后一个偏差就会被“偏差之和为零”这一条件自动确定。因此只剩下 n − 1 个独立信息。
In short: one parameter (the mean) was estimated, so one degree of freedom is lost. This is exactly the "n − 1" you see in the denominator of the sample variance formula.
简言之:估计了一个参数(均值),所以损失了一个自由度。这正是样本方差公式分母中 n − 1 的来历。
3. Degrees of Freedom in the Chi-Squared Goodness-of-Fit Test | 卡方拟合优度检验中的自由度
In the Edexcel syllabus, the chi-squared goodness-of-fit test is a staple. The test statistic is:
在Edexcel考纲中,卡方拟合优度检验是重点内容。检验统计量为:
χ² = Σ (Oᵢ − Eᵢ)² / Eᵢ
where Oᵢ are observed frequencies and Eᵢ are expected frequencies. The degrees of freedom for this test are not simply (number of categories − 1). You must also subtract the number of parameters estimated from the data in order to obtain the expected frequencies. The general rule is:
其中 Oᵢ 是观测频数,Eᵢ 是期望频数。该检验的自由度并非简单地等于(类别数 − 1)。你还必须减去为得到期望频数而从数据中估计的参数个数。一般规则是:
df = (number of categories) − 1 − (number of parameters estimated from the data)
For example, if you test whether data follows a Poisson distribution, you must estimate the mean λ from the sample. That costs one degree of freedom. If you test for a Normal distribution, you usually estimate both μ and σ², costing two degrees of freedom.
例如,如果你检验数据是否符合泊松分布,你必须从样本中估计均值 λ,这消耗一个自由度。如果你检验正态分布,你通常需要估计 μ 和 σ² 两个参数,消耗两个自由度。
Let us count the degrees of freedom in a uniform distribution test. Suppose you have 6 categories and the null hypothesis fixes each probability at 1/6. No parameters are estimated, so:
让我们数一数均匀分布检验中的自由度。假设有6个类别,零假设将每个概率固定为1/6。没有估计任何参数,因此:
df = 6 − 1 − 0 = 5
The −1 comes from the fact that the total observed frequency equals the total expected frequency. This constraint always exists in a chi-squared test, regardless of what distribution you are testing.
这个 −1 来自观测总频数等于期望总频数这一事实。无论你检验什么分布,这个约束在卡方检验中始终存在。
4. Contingency Tables: The (r − 1)(c − 1) Rule | 列联表:(r − 1)(c − 1) 规则
wo categorical variables in an r × c contingency table, the degrees of freedom formula is:
当在 r × c 列联表中检验两个分类变量的独立性时,自由度公式为:
df = (r − 1)(c − 1)
Why? In a contingency table with r rows and c columns, the expected frequencies are calculated using the row totals and column totals. Once the row totals are fixed, each row has only c − 1 free cells. Once the column totals are also fixed, the number of free cells reduces further. The total number of free cells across the table becomes (r − 1)(c − 1).
为什么?在具有r行c列的列联表中,期望频数是利用行合计和列合计计算出来的。行合计固定后,每一行只有 c − 1 个自由单元格;列合计也固定后,自由单元格的数量进一步减少。整张表中自由单元格的总数就变成 (r − 1)(c − 1)。
Example: a 3 × 4 contingency table. Here r = 3 and c = 4, so:
例子:一个 3 × 4 的列联表。这里 r = 3,c = 4,因此:
df = (3 − 1)(4 − 1) = 2 × 3 = 6
rc − (r − 1) − (c − 1) − 1 = (r − 1)(c − 1). The extra −1 ensures the grand total matches.
另一种理解方式是:估计 r − 1 个独立行概率和 c − 1 个独立列概率。单元格数减去自由估计参数数为 rc − (r − 1) − (c − 1) − 1 = (r − 1)(c − 1)。额外的 −1 确保总计数匹配。
5. Degrees of Freedom in the t-Distribution | t分布中的自由度
The t-distribution is used in hypothesis tests about a population mean when the population variance is unknown. Suppose you have a sample of size n. You use the sample standard deviation s to estimate the unknown population standard deviation σ. The test statistic follows a t-distribution with:
t分布用于总体方差未知时对总体均值进行假设检验。假设你有一个容量为 n 的样本。你用样本标准差 s 来估计未知的总体标准差 σ。检验统计量服从自由度为以下数值的t分布:
df = n − 1
The n − 1 appears because while you have n independent observations, you lost one degree of freedom when you estimated the sample mean x̄ from the data. Interestingly, you might expect to lose another degree of freedom for estimating σ, but the t-statistic is constructed such that only the mean estimation matters. This is a subtle point that Edexcel examiners love to test conceptually.
出现 n − 1 是因为虽然你有 n 个独立观测值,但在从数据中估计样本均值 x̄ 时损失了一个自由度。有趣的是,你可能会以为还要再减去一个用于估计 σ 的自由度,但t统计量的构造方式使得只有均值估计才影响自由度。这是一个微妙的点,Edexcel考官特别喜欢在概念上考查它。
If you are performing a paired t-test, you first compute the differences dᵢ between paired observations. The degrees of freedom is then n − 1, where n is the number of pairs, not the total number of individual observations.
如果你在进行配对t检验,你首先要计算配对观测值之间的差 dᵢ。此时的自由度是 n − 1,其中n是配对数,而不是个体观测值的总数。
6. A Step-by-Step Worked Example | 分步计算实例
Let us work through a full Edexcel-style example. A biologist claims that the number of beetles trapped in a field follows a Poisson distribution with an unknown mean λ. She records the following frequencies over 100 sampling days:
让我们完成一个完整的Edexcel风格例题。一位生物学家声称田里捕获的甲虫数量服从均值未知的泊松分布。她在100个采样日中记录到以下频数:
| Number of beetles | 0 | 1 | 2 | 3 | 4+ |
| Observed frequency | 40 | 35 | 18 | 5 | 2 |
Step 1: Estimate λ from the data.
第一步:根据数据估计 λ。
λ̂ = (0×40 + 1×35 + 2×18 + 3×5 + 4×2) / 100 = 84 / 100 = 0.84
Step 2: Determine the degrees of freedom. There are 5 categories, and we estimated 1 parameter (λ). Thus:
第二步:确定自由度。共有5个类别,我们估计了1个参数(λ)。因此:
df = 5 − 1 − 1 = 3
n the original table, the 4+ category has expected frequency 100 × P(X ≥ 4). For λ = 0.84:
第三步:如果某个期望频数低于5,则需要合并类别。在原始表格中,4+类别的期望频数为 100 × P(X ≥ 4)。对于 λ = 0.84:
P(X ≥ 4) = 1 − P(X ≤ 3) ≈ 0.028, so E = 100 × 0.028 = 2.8
This is below 5, so we merge 3 and 4+ into a single category labelled "3 or more". The merged table now has 4 categories, and the degrees of freedom becomes:
这个值低于5,所以我们将3和4+合并为一个类别,标记为“3或更多”。合并后的表格有4个类别,自由度变为:
df = 4 − 1 − 1 = 2
This is the value you would look up in the chi-squared distribution table. If your calculated χ² exceeds the critical value at the chosen significance level, you reject the null hypothesis that the data follows a Poisson distribution.
这就是你要在卡方分布表中查找的值。如果你计算出的 χ² 在所选显著性水平下超过临界值,你就拒绝零假设,即数据不服从泊松分布。
7. Common Mistakes and How to Avoid Them | 常见错误及避免方法
(number of categories − 1) regardless of the context. Remember: every parameter estimated from the data costs one additional degree of freedom.
错误一:忘记减去估计参数的数量。许多学生无论什么情境都自动写 df =(类别数 − 1)。记住:每从数据中估计一个参数,就额外消耗一个自由度。
Mistake 2: Using the wrong sample size in a paired t-test. If you have 20 pairs of observations, the degrees of freedom is 19, not 39. The data you are actually analysing are the differences dᵢ, of which there are only 20.
错误二:在配对t检验中使用错误的样本量。如果你有20对观测值,自由度是19,而不是39。你实际分析的数据是差 dᵢ,而差只有20个。
Mistake 3: Misunderstanding the −1 in chi-squared tests. The −1 is not arbitrary. It exists because the total observed frequency must equal the total expected frequency. This single constraint is always present.
错误三:误解卡方检验中的 −1。这个 −1 不是随便来的。它之所以存在,是因为观测总频数必须等于期望总频数。这一个约束始终存在。
Mistake 4: Forgetting to combine categories when expected frequencies are too small. This changes the number of categories, and therefore directly changes the degrees of freedom.
错误四:当期望频数过小时忘记合并类别。这会改变类别数量,因此直接改变自由度。
8. Degrees of Freedom in Regression Contexts | 回归情境中的自由度
In Edexcel Further Statistics, you may also encounter degrees of freedom in the context of correlation and regression. When you calculate the sample correlation coefficient r, the degrees of freedom used in the corresponding t-test for significance of correlation is:
在Edexcel进阶统计中,你可能会在相关和回归的情境中遇到自由度。当你计算样本相关系数 r 时,用于相关系数显著性t检验的自由度为:
df = n − 2
Why n − 2? Because you estimated two parameters: the slope and the intercept of the regression line. Both estimates impose constraints on the data. This is a conceptually important extension: in simple linear regression, every estimated coefficient reduces the available degrees of freedom.
为什么是 n − 2?因为你估计了两个参数:回归直线的斜率和截距。这两个估计都对数据施加了约束。这是概念上的重要延伸:在一元线性回归中,每估计一个系数,可用自由度就减少一个。
If you extend this to multiple regression with k explanatory variables, the degrees of freedom for the residuals becomes n − k − 1. You estimate k slopes plus 1 intercept, so k + 1 parameters are lost.
如果将其扩展到包含k个解释变量的多元回归,残差的自由度变为 n − k − 1。你估计了k个斜率和1个截距,所以损失了 k + 1 个参数。
9. A Unified Mental Model | 统一的思维模型
Here is a reliable way to think about degrees of freedom in any examination context. Start with the number of independent observations n. Then ask yourself: how many parameters have I estimated from the data? Subtract that number. Then ask: how many independent linear constraints exist beyond parameter estimation? Subtract those too.
这里有一个在任何考试情境中都可靠的思考方式。从独立观测值的数量n开始。然后问问自己:我从数据中估计了多少个参数?减去这个数量。然后再问:除了参数估计之外,还存在多少个独立的线性约束?再减去这些约束。
| Context | df formula | Intuitive reason |
| Sample variance | n − 1 | mean estimated from data |
| Goodness-of-fit test | k − 1 − m | k categories, m parameters estimated |
| Contingency table | (r − 1)(c − 1) | row and column totals fixed |
| One-sample t-test | n − 1 | mean estimated from data |
| Paired t-test | n − 1 (n = pairs) | differences constitute the sample |
| Correlation test | n − 2 | slope and intercept estimated |
This table is not meant to be memorised blindly. Instead, test yourself: can you derive each row using the general principle? If you can, you will never confuse degrees of freedom in an exam again.
这张表不是让你盲目记忆的。相反,测试一下自己:你能用一般原则推导出每一行吗?如果你能,你在考试中就再也不会混淆自由度了。
10. Exam Strategy: What to Write in Your Answer | 考试策略:答案中应该写什么
When an Edexcel mark scheme asks you to "state the degrees of freedom", you should show your reasoning in one clear line. For example:
当Edexcel评分方案要求你“写出自由度”时,你应该用一行清晰的推理展示你的思路。例如:
"Number of categories = 6, one parameter estimated, so df = 6 − 1 − 1 = 4."
This single sentence demonstrates that you understand not just the formula but the logic behind it. Examiners award marks for the correct final value, but the reasoning line protects you from making a careless error.
这一句话表明你不仅理解公式,而且理解公式背后的逻辑。考官会给正确的最终值打分,但推理过程能保护你不犯粗心错误。
Also remember that degrees of freedom must always be a positive integer. If your calculation ever yields zero or a negative number, you have almost certainly forgotten to combine categories or have counted your parameters incorrectly. This is a quick sanity check worth performing in every exam.
还要记住,自由度必须始终是一个正整数。如果你的计算得出零或负数,你几乎肯定忘记合并类别或数错了参数数量。这是一个值得在每次考试中进行的快速合理性检查。
Published by TutorHao | A-Level Further Maths Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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