📚 Testing a Discrete Uniform Distribution as a Model | 检验离散均匀分布作为模型
In AS-level Statistics, you will often encounter situations where a claim is made that certain outcomes occur with equal probability. A chi-squared goodness-of-fit test allows you to examine whether observed data are consistent with a discrete uniform distribution. This article explains the whole procedure step by step, following the Edexcel specification. You will learn how to state hypotheses, calculate expected frequencies, compute the test statistic, determine the critical value, and reach a conclusion in context.
在 AS 阶段统计学中,你经常会遇到声称某些结果等可能发生的情形。卡方拟合优度检验能让你检验观测数据是否与离散均匀分布一致。本文按照 Edexcel 考纲逐步讲解整个过程。你将学会陈述假设、计算期望频数、计算检验统计量、确定临界值并在上下文背景下得出结论。
1. Understanding the Discrete Uniform Distribution | 理解离散均匀分布
inct values, then P(X = x) = 1/k for each possible x. Classic examples include rolling a fair six-sided die (k = 6) or spinning a fair spinner with equal sectors. The model assumes no bias towards any particular outcome.
离散均匀分布是一种概率模型,其中存在有限个等可能结果。若随机变量 X 可取 k 个不同的值,则每个可能 x 的概率为 P(X = x) = 1/k。经典例子包括掷一个公平的六面骰子(k = 6) 或旋转一个带有相等扇区的公平转盘。该模型假设不存在对任何特定结果的偏向。
2. When to Use a Goodness-of-Fit Test | 何时使用拟合优度检验
A chi-squared (χ²) goodness-of-fit test is designed to compare observed frequencies with frequencies expected under a stated distribution. For a discrete uniform model, the test checks whether the data deviate significantly from the 'equal likelihood' assumption. It is applied to categorical or discrete numerical data where the total number of trials is fixed, and each trial falls into exactly one category.
卡方(χ²)拟合优度检验旨在将观测频数与给定分布下的期望频数进行比较。对于离散均匀模型,该检验检查数据是否显著偏离“等可能性”假设。它适用于分类数据或离散数值数据,其中试验总数固定,且每次试验恰好落入一个类别。
3. Stating the Hypotheses | 陈述假设
For testing a discrete uniform distribution, the null hypothesis H₀ always states that the data follow the proposed uniform model, meaning all category probabilities are equal. The alternative hypothesis H₁ states that at least one probability differs from the uniform pattern. Formally:
H₀: p₁ = p₂ = ... = pₖ = 1/k
H₁: At least one of the probabilities differs from 1/k.
对于检验离散均匀分布,原假设 H₀ 总是表明数据服从所提出的均匀模型,即所有类别概率相等。备择假设 H₁ 表明至少有一个概率与均匀模式不同。形式上:
H₀:p₁ = p₂ = … = pₖ = 1/k
H₁:至少有一个概率不等于 1/k。
4. Observed and Expected Frequencies | 观测频数与期望频数
s is E = N / k. Both O and E must be recorded in a frequency table. It is essential to check that all expected frequencies are at least 5. If any E is less than 5, categories should be merged appropriately before conducting the test.
设 O 为每个类别的观测频数。观测总数 N = ΣO。在 H₀ 下,k 个类别中每个的期望频数为 E = N / k。O 和 E 都必须记录在频数表中。检查所有期望频数是否都至少为 5 至关重要。如果任何 E 小于 5,应在进行检验前适当地合并类别。
5. The Chi-Squared Test Statistic | 卡方检验统计量
The test statistic measures the discrepancy between observed and expected frequencies. It is calculated using the formula:
χ² = Σ ( (O − E)² / E )
where the sum runs over all categories. A larger value of χ² indicates a greater difference between the observed data and the uniform model. Remember to use exact observed values and unrounded expected frequencies to maintain accuracy.
检验统计量衡量观测频数与期望频数之间的差异。计算公式如下:
χ² = Σ ( (O − E)² / E )
其中求和涵盖所有类别。χ² 值越大,表示观测数据与均匀模型之间的差异越大。请记住使用精确的观测值和未经舍入的期望频数以保持精度。
6. Degrees of Freedom | 自由度
orm distribution, the only constraint is that the sum of expected frequencies must equal the total observed frequency N. Therefore, ν = k − 1, where k is the number of categories (after any merging). If you estimate additional parameters from the data, the degrees of freedom reduce further – rm model we do not estimate any parameter; the probability 1/k is fixed by the hypothesis.
自由度用 ν(希腊字母 nu)表示,由类别个数和约束条件个数决定。对于离散均匀分布,唯一的约束是期望频数之和必须等于总观测频数 N。因此,ν = k − 1,其中 k 为(合并后的)类别个数。如果从数据中估计额外的参数,自由度会进一步减少——但对于均匀模型我们无需估计任何参数;概率 1/k 由假设固定。
7. The Chi-Squared Distribution and Critical Values | 卡方分布与临界值
red distribution with ν degrees of freedom. To make a decision, we compare the calculated χ² to a critical value obtained from statistical tables at a given significance level (usually 5% or 1% est at the α significance level, the critical value χ²_ν(α) satisfies P(χ² ≥ χ²_ν(α)) = α.
若原假设为真且期望频数足够大,χ² 的抽样分布近似服从自由度为 ν 的卡方分布。为做出决策,我们将计算出的 χ² 与在给定显著性水平(通常为 5% 或 1%)下从统计表中查得的临界值进行比较。在 Edexcel 考试中,会提供 χ² 分布的临界值表。对于显著性水平为 α 的检验,临界值 χ²_ν(α) 满足 P(χ² ≥ χ²_ν(α)) = α。
8. Performing the Test Step by Step | 逐步执行检验
1. Define the number of categories k and state the hypotheses.
2. Record observed frequencies O.
3. Calculate total N and expected frequency E = N/k for each category.
4. Verify that all E ≥ 5; if not, combine categories.
5. Compute χ² = Σ ((O − E)² / E).
6. Determine degrees of freedom ν = k − 1.
7. Look up the critical value from tables at the chosen significance level.
8. Compare the test statistic with the critical value:
If χ² > critical value, reject H₀.
If χ² ≤ critical value, do not reject H₀.
9. Write a conclusion in the context of the original problem.
1. 确定类别个数 k 并陈述假设。
2. 记录观测频数 O。
3. 计算总数 N 和每个类别的期望频数 E = N/k。
4. 检查是否所有 E ≥ 5;若否,合并类别。
5. 计算 χ² = Σ ((O − E)² / E)。
6. 确定自由度 ν = k − 1。
7. 从表中查出所选显著性水平下的临界值。
8. 将检验统计量与临界值进行比较:
若 χ² > 临界值,拒绝 H₀。
若 χ² ≤ 临界值,不拒绝 H₀。
9. 在原问题背景下写出结论。
9. Worked Example 1: Testing a Fair Die | 例题 1:检验公平骰子
A die is rolled 120 times, and the results are recorded:
| Score | 1 | 2 | 3 | 4 | 5 | 6 |
| Frequency (O) | 16 | 22 | 18 | 24 | 20 | 20 |
Test at the 5% significance level whether the die is fair.
将一颗骰子掷 120 次,记录结果如下:
| 得分 | 1 | 2 | 3 | 4 | 5 | 6 |
| 频数 (O) | 16 | 22 | 18 | 24 | 20 | 20 |
在 5% 显著性水平下检验该骰子是否公平。
needed. Calculate χ² = (16−20)²/20 + (22−20)²/20 + (18−20)²/20 + (24−20)²/20 + (20−20)²/20 + (20−20)²/20 = (16/20) + (4/20) + (4/20) + (16/20) + 0 + 0 = 40/20 = 2.0. Degrees of freedom ν = 6 − 1 = 5. At 5% sufficient evidence to suggest the die is biased. The data are consistent with a fair die.
H₀:骰子公平 → p₁ = p₂ = … = p₆ = 1/6。H₁:骰子不公平。N = 120,k = 6,故每个面 E = 120/6 = 20。所有期望频数 ≥ 5,无需合并。计算 20 + (20−20)²/20 + (20−20)²/20 = (16/20) + (4/20) + (4/20) + (16/20) + 0 + 0 = 40/20 = 2.0。自由度 ν = 6 − 1 = 5。在 5% 显著性水平下,临界值 χ²_5(0.05) = 11.070(查表)。因为 2.0 < 11.070,我们不拒绝 H₀。没有足够证据表明骰子有偏倚。数据与公平骰子一致。
10. Worked Example 2: Lottery Machine Numbers | 例题 2:彩票机号码
A lottery machine selects numbers from 1 to 10 and is supposed to be equally likely to produce any number. In 200 trials, the frequencies were:
| Number | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| O | 14 | 28 | 22 | 19 | 15 | 25 | 17 | 24 | 20 | 16 |
Test at the 1% significance level whether the machine is working correctly.
一台彩票机从 1 到 10 中选择号码,并且应等可能地产生任何号码。在 200 次试验中,频数如下:
| 号码 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| O | 14 | 28 | 22 | 19 | 15 | 25 | 17 | 24 | 20 | 16 |
在 1% 显著性水平下检验该机器是否正常工作。
. Compute χ² contributions: for 1: (14−20)²/20 = 1.8; 2: (28−20)²/20 = 3.2; 3: 0.2; 4: 0.05; 5: 1.25; 6: 1.25; 7: 0.45; 8: 0.8; 9: 0; 10: 0.8. Sum = 1.8 + 3.2 + 0.2 + 0.05 + 1.25 + 1.25 + 0.45 + 0.8 + 0 + 0.8 = 9.8. ν = 10 − 1 = 9. At 1% ables). Since 9.8 < 21.666, we do not reject H₀. There is no significant evidence at the 1% level that the lottery machine is biased.
H₀:p₁ = p₂ = … = p₁₀ = 1/10(均匀)。H₁:至少有一个概率不同。总数 N = 200,故每个号码的期望频数 E = 200/10 = 20。所有 E ≥ 5。计算 χ² 贡献:1:(14−20)²/20 = 1.8;2:3.2;3:0.2;4:0.05;5:1.25;6:1.25;7:0.45;8:0.8;9:0;10:0.8。总和 = 1.8 + 3.2 + 0.2 + 0.05 + 1.25 + 1.25 + 0.45 + 0.8 + 0 + 0.8 = 9.8。ν = 10 − 1 = 9。在 1% 下,临界值 χ²_9(0.01) = 21.666(查表)。因为 9.8 < 21.666,我们不拒绝 H₀。在 1% 水平下没有显著证据表明彩票机有偏倚。
11. Important Conditions and Common Mistakes | 重要条件与常见错误
The chi-squared goodness-of-fit test for a uniform distribution is valid only when expected frequencies are at least 5. If after merging categories you still cannot satisfy this condition, the test should not be used. Another common mistake is forgetting to adjust degrees of freedom when combining categories: always use the new number of categories. Also, ensure frequencies are actual counts, not percentages. Finally, always state the conclusion in plain English that relates back to the original claim – 'reject H₀' alone is not sufficient.
对均匀分布进行卡方拟合优度检验仅在期望频数至少为 5 时有效。如果合并类别后仍无法满足这一条件,则不应使用该检验。另一个常见错误是在合并类别时忘记调整自由度:始终使用新的类别个数。另外,确保频数是实际计数而非百分比。最后,务必用通俗英语(中文)陈述结论并与原始主张相关联——仅说“拒绝 H₀”是不够的。
12. Summary and Exam Tips | 总结与考试技巧
Testing a discrete uniform distribution is a straightforward application of the χ² goodness-of-fit test. Remember that under H₀ all expected frequencies are equal to N/k. Always show your working clearly: state hypotheses, compute expected values, calculate χ² step by step, give degrees of freedom, quote the critical value from tables, and write a contextual conclusion. Practise using the formula sheet and statistical tables provided in Edexcel exams to speed up your work. With these skills, you can confidently tackle any question on this topic.
检验离散均匀分布是 χ² 拟合优度检验的直接应用。记住在原假设下所有期望频数等于 N/k。务必清晰地展示解题过程:陈述假设、计算期望值、逐步计算 χ²、给出自由度、引用表中的临界值,并写出带背景的结论。练习使用 Edexcel 考试提供的公式表和统计表以加快做题速度。有了这些技能,你就能自信地应对任何与此主题相关的问题。
Published by TutorHao | Mathematics Revision Series | aleveler.com
更多咨询请联系16621398022(同微信)

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