📚 Hypothesis Testing for a Mean with Known Variance | 已知方差的均值假设检验
Hypothesis testing is a fundamental technique in inferential statistics that allows us to make decisions about a population parameter based on sample data. When we are interested in a population mean μ and the population variance σ² is known (or can be assumed known), the appropriate procedure is the one-sample Z-test for a mean. This method relies on the normality of the sampling distribution of the sample mean, given by the Central Limit Theorem, and uses the standard normal distribution to determine how extreme the observed sample result is under the assumed null hypothesis. In this article, we will explore the logical framework, the necessary steps, the two main approaches (critical value and p‑value), and the interpretation of results, all within the context of IB Mathematics and the Cambridge curriculum.
假设检验是推论统计中的一项基本技术,它使我们能够根据样本资料对总体参数做出决策。当我们关注总体均值 μ 且总体方差 σ² 已知(或可以假定已知)时,合适的方法是单样本均值的 Z 检验。该方法依赖于由中心极限定理给出的样本均值的抽样分布的正态性,并利用标准正态分布来判断在假定零假设成立的条件下,观察到的样本结果有多么极端。在本文中,我们将在 IB 数学和剑桥课程的背景下,探讨其逻辑框架、必要步骤、两种主要方法(临界值法和 p 值法)以及对结果的解释。
1. The Logic of Hypothesis Testing | 假设检验的逻辑
pothesis, H₁, represents what we suspect or hope to prove; it can be one-sided (μ > μ₀ or μ < μ₀) or two-sided (μ ≠ μ₀). We assume H₀ to be true and then ask whether the sample data provide sufficient evidence to reject it in favour of H₁. The reasoning is similar to a courtroom trial: the defendant is presumed innocent (H₀) until the evidence is strong enough to prove guilt (H₁).
一项假设检验从关于总体均值 μ 的两个对立陈述开始。零假设,记作 H₀,是“无效应”或“无差异”的陈述,通常指定一个具体的数值 μ₀。例如,H₀: μ = 100。备择假设 H₁ 代表我们所怀疑或希望证明的内容;它可以是单侧的(μ > μ₀ 或 μ < μ₀),也可以是双侧的(μ ≠ μ₀)。我们假定 H₀ 为真,然后询问样本资料是否提供了足够的证据来拒绝 H₀ 而支持 H₁。其推理类似于法庭审判:被告在被证明有罪之前被假定为无辜(H₀),直到证据足够强有力才能认定有罪(H₁)。
Because we base our decision on a random sample, we cannot be 100% certain. There is always a risk of making an incorrect decision. The probability of rejecting H₀ when it is actually true is called the significance level, denoted by α. Commonly used values for α are 0.05, 0.01 and 0.10. The choice of α reflects how willing we are to accept the risk of a false positive. Once α is chosen, a decision rule is established which divides the possible values of the test statistic into two regions: the rejection region (critical region) and the non‑rejection region.
由于我们基于随机样本做出决策,因此无法做到百分之百确定。总是存在做出错误决策的风险。当 H₀ 实际为真时将其拒绝的概率称为显著性水平,记作 α。常用的 α 值有 0.05、0.01 和 0.10。α 的选择反映了我们愿意承担多少“假阳性”风险。一旦选定了 α,就建立起一个决策规则,它将检验统计量的可能取值划分为两个区域:拒绝域(临界域)和不拒绝域。
2. The Test Statistic When σ is Known | 当 σ 已知时的检验统计量
population is normally distributed or the sample size is large (n ≥ 30), the sample mean x̄ follows a normal distribution with mean μ and standard error σ / √n. Consequently, the standardised test statistic is the Z‑statistic:
当总体方差 σ² 已知,且总体服从正态分布或样本量足够大(n ≥ 30)时,样本均值 x̄ 服从均值为 μ、标准误差为 σ / √n 的正态分布。因此,标准化后的检验统计量就是 Z 统计量:
Z = (x̄ − μ₀) / (σ / √n)
Here, x̄ is the observed sample mean, μ₀ is the hypothesised mean under H₀, σ is the known population standard deviation, and n is the sample size. Under the null hypothesis, this Z‑statistic follows a standard normal distribution, N(0, 1). The larger the absolute value of Z, the stronger the evidence against H₀.
这里,x̄ 是观测到的样本均值,μ₀ 是 H₀ 下假设的均值,σ 是已知的总体标准差,n 是样本大小。在零假设下,这个 Z 统计量服从标准正态分布 N(0, 1)。Z 的绝对值越大,表明反对 H₀ 的证据越强。
Calculating Z is straightforward once we have the sample data and the known σ. This standardisation converts any normal distribution of sample means into the standard normal scale, allowing us to use Z‑tables or technology to find probabilities and critical values.
一旦我们有了样本数据和已知的 σ,计算 Z 就很简单。这种标准化将样本均值的任意正态分布转换为标准正态尺度,使我们能够使用 Z 值表或技术工具来查找概率和临界值。
3. One‑tailed and Two‑tailed Tests | 单尾与双尾检验
The form of the alternative hypothesis determines whether a test is one‑tailed or two‑tailed. A one‑tailed test is used when the research question specifies a direction of interest. For example, if we claim that a new teaching method increases the average test score, our H₁ would be μ > μ₀ (right‑tailed test). Conversely, if we expect a decrease, H₁: μ < μ₀ (left‑tailed test). In these cases, the entire rejection region of size α is placed in one tail of the standard normal distribution.
备择假设的形式决定了检验是单尾还是双尾。当研究问题指明了感兴趣的方向时,使用单尾检验。例如,如果我们声称一种新的教学方法能提高平均考试成绩,那么 H₁ 应为 μ > μ₀(右尾检验)。相反,如果我们预期会降低,则 H₁: μ < μ₀(左尾检验)。在这些情况下,大小为 α 的全部拒绝域被放置在标准正态分布的一个尾部。
A two‑tailed test is appropriate when we are simply interested in whether the mean differs from a specified value, without predicting the direction. Here H₁: μ ≠ μ₀. The significance level α is then split equally between the two tails, so each tail has an area of α/2. The two‑tailed test is more conservative because it requires a larger absolute Z to reject H₀ compared to a one‑tailed test at the same α.
当我们只关心均值是否不等于某一特定值而不预测方向时,适用双尾检验。此时 H₁: μ ≠ μ₀。显著性水平 α 被均分到两个尾部,因此每个尾部的面积为 α/2。双尾检验更加保守,因为在相同的 α 下,它需要更大的 |Z| 才能拒绝 H₀。
The choice between one‑tailed and two‑tailed should be made before collecting data, based on the research question. Switching after seeing the data inflates the Type I error rate and is considered poor statistical practice.
单尾与双尾的选择应在收集数据之前根据研究问题做出。在查看数据后再切换会增大第一类错误率,并被视为不良的统计实践。
4. Significance Level and Critical Values | 显著性水平与临界值
cal value (or values) is the cutoff point that separates the rejection region from the non‑rejection region. For a two‑tailed test at α = 0.05, the critical values are Z = −1.96 and Z = +1.96, because 95% of the area under the standard normal curve lies between −1.96 and 1.96. For a right‑tailed test at α = 0.05, the critical value is Z = 1.645; for a left‑tailed test, it is Z = −1.645.
临界值是将拒绝域与不拒绝域分隔开的分界点。对于 α = 0.05 的双尾检验,临界值为 Z = −1.96 和 Z = +1.96,因为标准正态曲线下95%的面积落在 −1.96 与 1.96 之间。对于 α = 0.05 的右尾检验,临界值为 Z = 1.645;左尾检验则为 Z = −1.645。
If the calculated test statistic Z falls into the rejection region (i.e., beyond the critical value in the direction of H₁), we reject H₀. Otherwise, we fail to reject H₀. It is crucial to note that “failing to reject H₀” is not the same as “accepting H₀”. The test has merely not found enough evidence against H₀; the truth could still be consistent with H₁.
如果计算出的检验统计量 Z 落入拒绝域(即在 H₁ 方向上超过临界值),我们就拒绝 H₀。否则,我们就未能拒绝 H₀。必须注意的是,“未能拒绝 H₀” 并不等同于 “接受 H₀”。该检验只是没有找到足够反对 H₀ 的证据;真实情况仍然可能与 H₁ 一致。
The critical value method follows a clear sequence. First, state the null and alternative hypotheses. Second, select the significance level α. Third, calculate the test statistic Z using the sample mean, μ₀, known σ and n. Fourth, determine the critical value(s) from the standard normal distribution according to α and the type of test. Fifth, compare Z to the critical value(s) and make a decision: if Z lies in the rejection region, reject H₀; otherwise, do not reject H₀. Finally, write a conclusion in the context of the problem.
临界值法遵循一个清晰的顺序。第一,陈述零假设和备择假设。第二,选择显著性水平 α。第三,使用样本均值、μ₀、已知的 σ 和 n 计算检验统计量 Z。第四,根据 α 和检验类型从标准正态分布确定临界值。第五,将 Z 与临界值进行比较并做出决策:若 Z 落在拒绝域内,则拒绝 H₀;否则,不拒绝 H₀。最后,在问题的背景下写出结论。
This approach is intuitive because it focuses on whether the observed Z is an “unlikely” value under H₀. However, it does not directly quantify the strength of the evidence beyond a simple yes/no decision. Many exam questions in both IB and Cambridge require students to conduct a full critical value test, showing all steps clearly.
这种方法十分直观,因为它关注的是观测到的 Z 是否是在 H₀ 下 “不太可能” 出现的值。然而,除了简单的“是/否”决策外,它并未直接量化证据的强度。许多 IB 和剑桥的考题都要求学生完成一次完整的临界值检验,并清晰展示所有步骤。
atistical tables, remember that the critical values for common α can be memorised: for two‑tailed α = 0.05, ±1.96; for one‑ed α = 0.05, ±1.645. But you must always select the sign according to the direction of H₁.
在使用技术工具或统计表时,请记住常见 α 的临界值可以背诵:双尾 α = 0.05,±1.96;单尾 α = 0.05,±1.645。但必须始终根据 H₁ 的方向选择符号。
6. The p‑value Approach | p 值法
The p‑value is the probability, computed assuming H₀ is true, of obtaining a test statistic at least as extreme as the one that was actually observed, in the direction of H₁. For a two‑tailed test, the p‑value is the probability of getting a Z value with absolute value as large as or larger than the observed |Z|. For a one‑tailed test, the p‑value is the tail area beyond the observed Z in the direction specified by H₁.
p 值是在假定 H₀ 为真的前提下,计算得到至少与实际观察到的检验统计量一样极端(在 H₁ 方向上)的检验统计量的概率。对于双尾检验,p 值是指得到绝对值至少等于观测到的 |Z| 的 Z 值的概率。对于单尾检验,p 值是在 H₁ 指定的方向上观测到的 Z 值之外的尾部面积。
The decision rule using p‑values is simple: if p‑value ≤ α, reject H₀; if p‑value > α, do not reject H₀. The p‑ ides a more informative measure than a simple reject/do not reject outcome. A very small p‑value (e.g., 0.001) indicates strong evidence against H₀, while a p‑value just slightly above α (e.g., 0.051) suggests marginal evidence.
使用 p 值的决策规则很简单:若 p 值 ≤ α,则拒绝 H₀;若 p 值 > α,则不拒绝 H₀。p 值提供的信息比简单的“拒绝/不拒绝”结果更丰富。非常小的 p 值(如 0.001)意味着反对 H₀ 的证据非常强,而略高于 α 的 p 值(如 0.051)则表明证据处于边缘。
To find a p‑alue, we can use cumulative standard normal tables or technology. For example, for a right‑tailed test with observed Z = 2.1, p‑value = P(Z > 2.1) = 1 − Φ(2.1). For a two‑tailed test with Z = 2.1, p‑ue = 2 × P(Z > 2.1). The symmetry of the normal distribution is key to these calculations.
要计算 p 值,我们可以使用累积标准正态分布表或技术工具。例如,对于观测 Z = 2.1 的右尾检验,p 值 = P(Z > 2.1) = 1 − Φ(2.1)。对于观测 Z = 2.1 的双尾检验,p 值 = 2 × P(Z > 2.1)。正态分布的对称性是这些计算的关键。
7. Making a Conclusion in Context | 在上下文中得出结论
A statistical conclusion must be linked back to the original real‑world problem. Saying “reject H₀” ge. For instance, if H₀: μ = 50 and H₁: μ > 50, and we reject H₀ at α = 0.05, we conclude: “There is sufficient evidence at the 5% significance level to support the claim that the population mean is greater than 50.” Always mention the significance level to give context to the reliability of the decision.
统计结论必须还原到原初的现实问题中。仅仅说“拒绝 H₀”是不够的;我们需要用通俗的语言陈述这意味着什么。例如,若 H₀: μ = 50,H₁: μ > 50,并且我们在 α = 0.05 下拒绝了 H₀,则可得出结论:“在 5% 的显著性水平下,有足够的证据支持总体均值大于 50 的说法。” 应始终提及显著性水平,以赋予决策的可靠性以语境。
When we fail to reject H₀, the conclusion is more cautious: “There is insufficient evidence at the α level to reject the claim that the population mean is 50.” We do not say “the mean is 50”, because absence of evidence is not evidence of absence. The sample data simply did not provide enough contradiction to the null hypothesis.
当我们未能拒绝 H₀ 时,结论要更谨慎:“在 α 水平下,没有足够的证据来拒绝总体均值为 50 的说法。” 我们不说“均值就是 50”,因为没有证据不等于证据不存在。样本数据仅仅是没有提供足够与零假设相矛盾的信息。
8. Relationship Between Hypothesis Tests and Confidence Intervals | 假设检验与置信区间的关系
There is a strong dual relationship between a two‑tailed hypothesis test at level α and a (1−α)×100% confidence interval for μ. A two‑ ts H₀: μ = μ₀ at level α if and only if the value μ₀ is not contained within the (1−α)×100% confidence interval for μ. For example, if a 95% confidence interval for μ is (48.2, 51.8), then a two‑ not reject H₀: μ = 50 because 50 lies inside the interval, but it would reject H₀: μ = 52.
在水平为 α 的双尾假设检验与均值的 (1−α)×100% 置信区间之间存在紧密的对偶关系。一个水平为 α 的双尾检验拒绝 H₀: μ = μ₀,当且仅当数值 μ₀ 不包含在 μ 的 (1−α)×100% 置信区间内。例如,如果 μ 的 95% 置信区间为 (48.2, 51.8),那么 α = 0.05 下的双尾检验将不会拒绝 H₀: μ = 50,因为 50 位于区间内,但它会拒绝 H₀: μ = 52。
This connection is extremely useful for checking the consistency of results or for performing a hypothesis test without explicitly calculating Z, provided the confidence interval is known. However, it only applies strictly to two‑tailed tests with an alternative of “not equal to”. For one‑tailed tests, the linkage is not as direct.
这一联系对于检验结果的一致性,或在已知置信区间的情况下无需显式计算 Z 来进行假设检验而言非常有用。不过,它严格只适用于备择假设为“不等于”的双尾检验。对于单尾检验,这种联系不如前者直接。
9. Type I and Type II Errors | 第一类错误与第二类错误
Whenever we make a decision based on a sample, two types of errors are possible. A Type I error occurs when we reject a true null hypothesis. The probability of a Type I error is exactly α, the significance level of the test. This error is controlled by the researcher and can be made smaller by choosing a smaller α, though this increases the risk of a Type II error.
每当我们基于一个样本做出决策时,都可能犯两类错误。第一类错误发生在拒绝了一个真的零假设时。第一类错误的概率恰好是 α,即检验的显著性水平。这类错误由研究者控制,可以通过选择更小的 α 来使其变小,但这会增加第二类错误的风险。
A Type II error occurs when we fail to reject a false null hypothesis. The probability of a Type II error is denoted by β. The power of the test is 1 − β, which is the probability of correctly rejecting a false H₀. Power depends on the true value of μ, the sample size n, the known σ, and α. In practice, increasing n is the most effective way to increase power without changing α.
第二类错误发生在未能拒绝一个错误的零假设时。第二类错误的概率记作 β。检验的功效为 1 − β,即正确拒绝一个错误的 H₀ 的概率。功效取决于 μ 的真实值、样本量 n、已知的 σ 以及 α。在实践中,增加 n 是提高功效而不改变 α 的最有效方法。
Both errors are inversely related: decreasing α (making it harder to reject H₀) tends to increase β. This trade‑off is an important concept in study design. In IB and Cambridge exams, you may be asked to identify the type of error in a given scenario or explain the consequences of each.
这两类错误是反向相关的:减小 α(使得拒绝 H₀ 变得更困难)往往会增大 β。这种权衡是研究设计中的重要概念。在 IB 和剑桥的考试中,你可能会被要求识别给定情境中的错误类型,或解释每种错误的后果。
10. Assumptions and Conditions for the Z‑Test | Z 检验的假设与条件
To validly apply the Z‑ n of interest. The population standard deviation σ must be known. If σ is not known, the t‑test should be used instead. Most critically, the sampling distribution of x̄ is large enough (n ≥ 30) by the Central Limit Theorem, regardless of the population shape.
要有效地应用均值的 Z 检验,必须满足几个假设。数据必须是来自目标总体的简单随机样本。总体标准差 σ 必须已知。如果 σ 未知,则应使用 t 检验。最关键的是,x̄ 的抽样分布必须近似正态。如果总体本身服从正态分布,或者样本量足够大(n ≥ 30)时根据中心极限定理,无论总体形状如何,这一条件均可满足。
Outliers in the data can distort the sample mean and inflate the standard error, especially with small samples. Therefore, it is good practice to inspect the data graphically (e.g., boxplot) before conducting the test. If the normality assumption is seriously violated and n is small, a non‑parametric alternative or transformation may be more appropriate. In exam problems, you are typically told that the population is normal or that n is large, so these conditions are satisfied.
数据中的异常值会扭曲样本均值并增大标准误差,尤其是在小样本的情况下。因此,在进行检验之前,最好先通过图形(如箱线图)检查数据。如果正态性假设严重不满足且 n 很小,则使用非参数替代方法或进行数据变换可能更为妥当。在考试题目中,通常会告知总体服从正态分布或 n 很大,因此这些条件已经满足。
11. A Worked Example | 一个完整实例
st at α = 0.05 whether there is evidence that the true mean diameter differs from 5.00 mm.
某制造商声称滚珠轴承的平均直径为 5.00 mm。一位质量检验员随机抽取了 36 个轴承,测得平均直径为 5.07 mm。已知生产流程的标准差为 σ = 0.12 mm。在 α = 0.05 下检验是否有证据表明真实平均直径不等于 5.00 mm。
Solution:
H₀: μ = 5.00, H₁: μ ≠ 5.00 (two‑tailed test). α = 0.05. The test statistic: Z = (5.07 − 5.00) / (0.12/√36) = 0.07 / 0.02 = 3.50. The critical values for a two‑tailed test at α = 0.05 are ±1.96. Since |3.50| > 1.96, Z falls in the rejection region. We reject H₀. Alternatively, the p‑ = 0.00046. Since p < 0.05, we reject H₀. Conclusion: There is sufficient evidence at the 5% t the true mean diameter differs from 5.00 mm. The manufacturing process appears to be off‑target.
解答:
H₀: μ = 5.00, H₁: μ ≠ 5.00(双尾检验)。α = 0.05。检验统计量:Z = (5.07 − 5.00) / (0.12/√36) = 0.07 / 0.02 = 3.50。α = 0.05 的双尾检验临界值为 ±1.96。由于 |3.50| > 1.96,Z 落入了拒绝域,我们拒绝 H₀。另一种方法,Z = 3.50 的 p 值为 2 × P(Z > 3.50) ≈ 2 × 0.00023 = 0.00046。因为 p < 0.05,我们拒绝 H₀。结论:在 5% 的显著性水平下,有足够的证据表明真实平均直径不等于 5.00 mm。该制造过程似乎偏离了目标。
12. Common Pitfalls and Exam Tips | 常见错误与考试提示
the population standard deviation σ with the sample standard deviation s. Remember, the Z‑test is only valid when σ is known; if s must be used, the test becomes a t‑test. Another frequent mistake is using the wrong critical value: a one‑iled test at α = 0.05 uses 1.645, not 1.96. Always check whether the problem implies a one‑sided or two‑sided alternative. Double‑check the direction of the inequality in H₁ when writing it out.
许多学生容易混淆总体标准差 σ 与样本标准差 s。请记住,Z 检验仅在 σ 已知时有效;若必须使用 s,则检验变为 t 检验。另一个常见错误是使用错误的临界值:α = 0.05 的单尾检验用 1.645,而不是 1.96。务必检查题目暗示的是单侧还是双侧备择假设。在写出 H₁ 时,要再次确认不等式的方向。
When using statistical tables to find p‑values, be careful with two‑tailed tests: the table often gives the one‑tail probability, so multiply by 2. If you use a calculator, ensure you understand the output. Finally, always express the conclusion in context and mention the significance level. A conclusion like “reject H₀ because Z > 1.96” is incomplete without an interpretation. Practising full written solutions under timed conditions will build confidence for the exam.
在使用统计表查找 p 值时,要注意双尾检验:统计表通常给出的是单尾概率,因此需要乘以 2。如果使用计算器,请确保你理解输出的含义。最后,一定要在上下文中表述结论,并提及显著性水平。像“因为 Z > 1.96 所以拒绝 H₀”这样的结论如果没有解释就是不完整的。在限时条件下练习完整的书面解答将为考试建立信心。
Published by TutorHao | Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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