跳到主要内容

题型分析 — Chi-squared Tests

Question Type 1: GoF for Binomial Distribution

如何识别

题目给出频数分布表,要求检验数据是否服从 Binomial 分布。关键词:"test whether a Binomial distribution fits"、"Goodness of fit — Binomial"

标准解题方法
  1. 估计 Binomial 参数 pp(如果未知):p^=xfxnfx\hat{p} = \dfrac{\sum x f_x}{n \sum f_x}
  2. 计算 P(X=x)=(nx)px(1p)nxP(X = x) = \binom{n}{x} p^x (1-p)^{n-x} 对于 x=0,1,,nx = 0, 1, \dots, n
  3. 计算期望频数 E=total×P(X=x)E = \text{total} \times P(X = x)
  4. 合并尾部使 E5E \geq 5,通常 P(Xr)P(X \geq r) 合并为一项
  5. χ2=(OE)2E\chi^2 = \sum \dfrac{(O - E)^2}{E}
  6. df=k11\mathrm{df} = k - 1 - 1(估计了 pp
  7. 查表比较
评分标准(MS 模式)
  • 估计 p^\hat{p}M1 正确方法,A1 数值正确
  • 计算 P(X=x)P(X = x):每项各 M1 A1(通常前 3 项)
  • 合并尾部概率:B1
  • 计算期望频数:M1 方法,A1 数值(允许多步误差)
  • 计算 χ2\chi^2M1 方法,A1 数值
  • 自由度:B1
  • 临界值和结论:M1 比较,A1 正确结论

Example 1 — 9231/w20/qp/41 Q3 (9 marks):

The number of defective items, XX, in a random sample of 8 items is recorded for 200 samples. The results are:

xx012345
Frequency2279622872

Test, at the 5% significance level, whether a Binomial distribution with n=8n = 8 is a suitable model.

📝 展开查看完整解法 + MS

Step 1 — Estimate pp

Total items checked =200×8=1600= 200 \times 8 = 1600 Total defectives =0×22+1×79+2×62+3×28+4×7+5×2=0+79+124+84+28+10=325= 0 \times 22 + 1 \times 79 + 2 \times 62 + 3 \times 28 + 4 \times 7 + 5 \times 2 = 0 + 79 + 124 + 84 + 28 + 10 = 325

p^=3251600=0.203125\hat{p} = \dfrac{325}{1600} = 0.203125 M1 A1

Step 2 — Binomial probabilities

P(X=x)=(8x)(0.203125)x(0.796875)8xP(X = x) = \binom{8}{x} (0.203125)^x (0.796875)^{8-x}

P(0)=0.7968758=0.1536P(0) = 0.796875^8 = 0.1536 M1 P(1)=8×0.203125×0.7968757=0.3131P(1) = 8 \times 0.203125 \times 0.796875^7 = 0.3131 P(2)=(82)×0.2031252×0.7968756=0.2793P(2) = \binom{8}{2} \times 0.203125^2 \times 0.796875^6 = 0.2793 P(3)=(83)×0.2031253×0.7968755=0.1423P(3) = \binom{8}{3} \times 0.203125^3 \times 0.796875^5 = 0.1423 P(4)=(84)×0.2031254×0.7968754=0.0454P(4) = \binom{8}{4} \times 0.203125^4 \times 0.796875^4 = 0.0454 P(5)=(85)×0.2031255×0.7968753=0.0093P(5) = \binom{8}{5} \times 0.203125^5 \times 0.796875^3 = 0.0093 A1 (all probabilities correct)

P(6)=1sum(P(0) to P(5))=0.0013P(6) = 1 - \text{sum}(P(0)\text{ to }P(5)) = 0.0013 (or compute directly)

Step 3 — Expected frequencies

E=200×P(X=x)E = 200 \times P(X = x)

xxOOPPEE
0220.153630.72
1790.313162.62
2620.279355.86
3280.142328.46
470.04549.08
520.00931.86
6\geq 600.00130.26

B1 — Combine last three rows: 4+5+6+4+5+6+ have E=9.08+1.86+0.26=11.20E = 9.08 + 1.86 + 0.26 = 11.20, O=7+2+0=9O = 7 + 2 + 0 = 9

Step 4 — Chi-squared

xxOOEE(OE)2/E(O-E)^2/E
02230.722.476
17962.624.287
26255.860.675
32828.460.007
4\geq 4911.200.432

χ2=2.476+4.287+0.675+0.007+0.432=7.877\chi^2 = 2.476 + 4.287 + 0.675 + 0.007 + 0.432 = 7.877 M1 A1

Step 5 — Degrees of freedom

k=5k = 5 categories after merging, m=1m = 1 parameter (pp) estimated df=511=3\mathrm{df} = 5 - 1 - 1 = 3 B1

Step 6 — Conclusion

χ0.05,32=7.815\chi^2_{0.05, 3} = 7.815 M1 Since 7.877 > 7.815, we reject H0H_0.

There is sufficient evidence at the 5% significance level that the Binomial distribution is not a suitable model. A1

常见陷阱
  • 合并时注意总和:合并后 OOEE 都要相加
  • 自由度是 k11k - 1 - 1,不是 k1k - 1
  • p^\hat{p} 是用加权平均,不是简单平均

Example 2 — 9231/w21/qp/41 Q3 (9 marks):

The number of accidents per day, XX, at a factory over a period of 200 days is recorded:

xx012345
Frequency7874341121

Test, at the 5% significance level, whether a Binomial distribution with n=5n = 5 is suitable.

📝 展开查看完整解法 + MS

Step 1 — Estimate pp

Total accidents =0×78+1×74+2×34+3×11+4×2+5×1=0+74+68+33+8+5=188= 0 \times 78 + 1 \times 74 + 2 \times 34 + 3 \times 11 + 4 \times 2 + 5 \times 1 = 0 + 74 + 68 + 33 + 8 + 5 = 188 Total trials =200×5=1000= 200 \times 5 = 1000

p^=1881000=0.188\hat{p} = \dfrac{188}{1000} = 0.188 M1 A1

Step 2 — Binomial probabilities (n=5n = 5, p=0.188p = 0.188)

P(0)=(0.812)5=0.3527P(0) = (0.812)^5 = 0.3527 P(1)=5×0.188×(0.812)4=0.4086P(1) = 5 \times 0.188 \times (0.812)^4 = 0.4086 P(2)=(52)×0.1882×0.8123=0.1893P(2) = \binom{5}{2} \times 0.188^2 \times 0.812^3 = 0.1893 P(3)=(53)×0.1883×0.8122=0.0438P(3) = \binom{5}{3} \times 0.188^3 \times 0.812^2 = 0.0438 P(4)=(54)×0.1884×0.812=0.0051P(4) = \binom{5}{4} \times 0.188^4 \times 0.812 = 0.0051 P(5)=0.1885=0.0002P(5) = 0.188^5 = 0.0002 A1

Step 3 — Expected frequencies (E=200×PE = 200 \times P)

xxOOEE
07870.54
17481.72
23437.86
3118.76
421.02
510.04

B1 — Combine x3x \geq 3: E=8.76+1.02+0.04=9.82E = 8.76 + 1.02 + 0.04 = 9.82, O=11+2+1=14O = 11 + 2 + 1 = 14

Step 4 — Chi-squared

xxOOEE(OE)2/E(O-E)^2/E
07870.540.789
17481.720.729
23437.860.393
3\geq 3149.821.779

χ2=0.789+0.729+0.393+1.779=3.690\chi^2 = 0.789 + 0.729 + 0.393 + 1.779 = 3.690 M1 A1

Step 5 — df

k=4k = 4, m=1m = 1df=411=2\mathrm{df} = 4 - 1 - 1 = 2 B1

Step 6 — Conclusion

χ0.05,22=5.991\chi^2_{0.05, 2} = 5.991 M1 3.690 < 5.991 ⇒ do not reject H0H_0.

Insufficient evidence to suggest Binomial is not suitable. A1

常见陷阱
  • 合并后确保总频数匹配:4+5 合并后频数是 2+1=32 + 1 = 31.02+0.04=1.061.02 + 0.04 = 1.06

Example 3 — 9231/s25/qp/41 Q3 (9 marks):

A biologist records the number of seeds germinating, XX, in each of 100 trays containing 6 seeds each:

xx0123456
Frequency2822322493

Test, at the 5% significance level, whether a Binomial distribution with n=6n = 6 is a suitable model.

📝 展开查看完整解法 + MS

Step 1 — Estimate pp

Total seeds =100×6=600= 100 \times 6 = 600 Total germinated =0×2+1×8+2×22+3×32+4×24+5×9+6×3= 0 \times 2 + 1 \times 8 + 2 \times 22 + 3 \times 32 + 4 \times 24 + 5 \times 9 + 6 \times 3 =0+8+44+96+96+45+18=307= 0 + 8 + 44 + 96 + 96 + 45 + 18 = 307

p^=307600=0.5117\hat{p} = \dfrac{307}{600} = 0.5117 M1 A1

Step 2 — Binomial probabilities

P(X=x)=(6x)(0.5117)x(0.4883)6xP(X = x) = \binom{6}{x} (0.5117)^x (0.4883)^{6-x}

P(0)=0.48836=0.0136P(0) = 0.4883^6 = 0.0136 P(1)=6×0.5117×0.48835=0.0853P(1) = 6 \times 0.5117 \times 0.4883^5 = 0.0853 P(2)=15×0.51172×0.48834=0.2228P(2) = 15 \times 0.5117^2 \times 0.4883^4 = 0.2228 P(3)=20×0.51173×0.48833=0.3107P(3) = 20 \times 0.5117^3 \times 0.4883^3 = 0.3107 P(4)=15×0.51174×0.48832=0.2437P(4) = 15 \times 0.5117^4 \times 0.4883^2 = 0.2437 P(5)=6×0.51175×0.4883=0.1020P(5) = 6 \times 0.5117^5 \times 0.4883 = 0.1020 P(6)=0.51176=0.0219P(6) = 0.5117^6 = 0.0219 A1

Step 3 — Expected frequencies (E=100×PE = 100 \times P)

xxOOEE
021.36
188.53
22222.28
33231.07
42424.37
5910.20
632.19

B1 — Combine x=0x = 0 and x=1x = 1: E=1.36+8.53=9.89E = 1.36 + 8.53 = 9.89, O=2+8=10O = 2 + 8 = 10 Combine x=6x = 6 with x=5x = 5: E=10.20+2.19=12.39E = 10.20 + 2.19 = 12.39, O=9+3=12O = 9 + 3 = 12

Step 4 — Chi-squared

xxOOEE(OE)2/E(O-E)^2/E
0–1109.890.0012
22222.280.0035
33231.070.0278
42424.370.0056
5–61212.390.0123

χ2=0.0012+0.0035+0.0278+0.0056+0.0123=0.0504\chi^2 = 0.0012 + 0.0035 + 0.0278 + 0.0056 + 0.0123 = 0.0504 M1 A1

Step 5 — df

k=5k = 5, m=1m = 1df=511=3\mathrm{df} = 5 - 1 - 1 = 3 B1

Step 6 — Conclusion

χ0.05,32=7.815\chi^2_{0.05, 3} = 7.815 M1 0.0504 < 7.815 ⇒ do not reject H0H_0.

Insufficient evidence to reject Binomial as suitable model. A1

常见陷阱
  • E < 5 可能出现在两端,需分别合并
  • 对比本题(p0.5p \approx 0.5,对称)与 Example 1(pp 较小,右偏)观察合并方式的不同

Question Type 2: GoF for Poisson Distribution

如何识别

关键词:"Poisson distribution"、"test for randomness"、"Goodness of fit — Poisson"。数据通常是计数数据(事故数、缺陷数等)。

标准解题方法
  1. 估计 λ^=xˉ\hat{\lambda} = \bar{x}
  2. 计算 P(X=x)=eλλx/x!P(X = x) = e^{-\lambda} \lambda^x / x!
  3. 计算期望频数 E=total×P(X=x)E = \text{total} \times P(X = x)
  4. 合并尾部使 E5E \geq 5
  5. χ2=(OE)2/E\chi^2 = \sum (O-E)^2/E
  6. df=k11\mathrm{df} = k - 1 - 1(估计了 λ\lambda
  7. 查表比较
评分标准(MS 模式)
  • 估计 x\overline{x}M1 A1
  • 计算 Poisson 概率:每项 M1 A1
  • 尾部合并:B1
  • χ2\chi^2M1 A1
  • 自由度 B1,结论 M1 A1

Example 1 — 9231/s22/qp/41 Q4 (10 marks):

The number of particles emitted per minute by a radioactive source is recorded for 200 minutes:

xx01234567
Frequency10284952351772

Test, at the 5% significance level, whether a Poisson distribution is a suitable model.

📝 展开查看完整解法 + MS

Step 1 — Estimate λ\lambda

xˉ=0×10+1×28+2×49+3×52+4×35+5×17+6×7+7×2200\bar{x} = \dfrac{0 \times 10 + 1 \times 28 + 2 \times 49 + 3 \times 52 + 4 \times 35 + 5 \times 17 + 6 \times 7 + 7 \times 2}{200}

=0+28+98+156+140+85+42+14200=563200=2.815= \dfrac{0 + 28 + 98 + 156 + 140 + 85 + 42 + 14}{200} = \dfrac{563}{200} = 2.815 M1 A1

Step 2 — Poisson probabilities

P(X=x)=e2.815×2.815x/x!P(X = x) = e^{-2.815} \times 2.815^x / x!

P(0)=e2.815=0.0599P(0) = e^{-2.815} = 0.0599 P(1)=0.0599×2.815=0.1686P(1) = 0.0599 \times 2.815 = 0.1686 P(2)=0.1686×2.815/2=0.2373P(2) = 0.1686 \times 2.815/2 = 0.2373 P(3)=0.2373×2.815/3=0.2227P(3) = 0.2373 \times 2.815/3 = 0.2227 P(4)=0.2227×2.815/4=0.1567P(4) = 0.2227 \times 2.815/4 = 0.1567 P(5)=0.1567×2.815/5=0.0882P(5) = 0.1567 \times 2.815/5 = 0.0882 P(6)=0.0882×2.815/6=0.0414P(6) = 0.0882 \times 2.815/6 = 0.0414 P(7)=0.0414×2.815/7=0.0167P(7) = 0.0414 \times 2.815/7 = 0.0167 A1 P(8)=1sum=0.0085P(\geq 8) = 1 - \text{sum} = 0.0085

Step 3 — Expected frequencies (E=200×PE = 200 \times P)

xxOOEE
01011.98
12833.72
24947.46
35244.54
43531.34
51717.64
678.28
723.34
8\geq 801.70

B1 — Combine 7+7+: O=2+0=2O = 2 + 0 = 2, E=3.34+1.70=5.04E = 3.34 + 1.70 = 5.04

Step 4 — Chi-squared

xxOOEE(OE)2/E(O-E)^2/E
01011.980.327
12833.720.970
24947.460.050
35244.541.249
43531.340.427
51717.640.023
678.280.198
7\geq 725.041.834

χ2=0.327+0.970+0.050+1.249+0.427+0.023+0.198+1.834=5.078\chi^2 = 0.327 + 0.970 + 0.050 + 1.249 + 0.427 + 0.023 + 0.198 + 1.834 = 5.078 M1 A1

Step 5 — df

k=8k = 8, m=1m = 1df=811=6\mathrm{df} = 8 - 1 - 1 = 6 B1

Step 6 — Conclusion

χ0.05,62=12.592\chi^2_{0.05, 6} = 12.592 M1 5.078 < 12.592 ⇒ do not reject H0H_0.

Poisson distribution is a suitable model. A1

常见陷阱
  • Poisson 概率用递推公式 P(X=x)=P(X=x1)×λ/xP(X = x) = P(X = x-1) \times \lambda / x 可减少计算量
  • 合并尾部时注意是否还有 E < 5

Example 2 — 9231/w24/qp/41 Q3 (9 marks):

The number of goals scored per match in a tournament is recorded for 150 matches:

xx012345
Frequency4552301652

Test, at the 5% significance level, whether a Poisson distribution is a suitable model.

📝 展开查看完整解法 + MS

Step 1 — Estimate λ\lambda

xˉ=0×45+1×52+2×30+3×16+4×5+5×2150\bar{x} = \dfrac{0 \times 45 + 1 \times 52 + 2 \times 30 + 3 \times 16 + 4 \times 5 + 5 \times 2}{150} =0+52+60+48+20+10150=190150=1.267= \dfrac{0 + 52 + 60 + 48 + 20 + 10}{150} = \dfrac{190}{150} = 1.267 M1 A1

Step 2 — Poisson probabilities (λ=1.267\lambda = 1.267)

P(0)=e1.267=0.2816P(0) = e^{-1.267} = 0.2816 P(1)=0.2816×1.267=0.3568P(1) = 0.2816 \times 1.267 = 0.3568 P(2)=0.3568×1.267/2=0.2260P(2) = 0.3568 \times 1.267/2 = 0.2260 P(3)=0.2260×1.267/3=0.0955P(3) = 0.2260 \times 1.267/3 = 0.0955 P(4)=0.0955×1.267/4=0.0302P(4) = 0.0955 \times 1.267/4 = 0.0302 P(5)=0.0302×1.267/5=0.0077P(5) = 0.0302 \times 1.267/5 = 0.0077 A1 P(6)=1sum=0.0022P(\geq 6) = 1 - \text{sum} = 0.0022

Step 3 — Expected frequencies (E=150×PE = 150 \times P)

xxOOEE
04542.24
15253.52
23033.90
31614.33
454.53
5\geq 521.48

B1 — Combine 4+4+: O=5+2=7O = 5 + 2 = 7, E=4.53+1.48=6.01E = 4.53 + 1.48 = 6.01

Step 4 — Chi-squared

xxOOEE(OE)2/E(O-E)^2/E
04542.240.180
15253.520.043
23033.900.448
31614.330.195
4\geq 476.010.163

χ2=0.180+0.043+0.448+0.195+0.163=1.029\chi^2 = 0.180 + 0.043 + 0.448 + 0.195 + 0.163 = 1.029 M1 A1

Step 5 — df

k=5k = 5, m=1m = 1df=511=3\mathrm{df} = 5 - 1 - 1 = 3 B1

Step 6 — Conclusion

χ0.05,32=7.815\chi^2_{0.05, 3} = 7.815 M1 1.029 < 7.815 ⇒ do not reject H0H_0. A1

常见陷阱
  • λ\lambda 较小(如 1.267),Poisson 分布偏斜,尾部合并更关键

Example 3 — 9231/w25/qp/41 Q2 (9 marks):

The number of bacteria colonies per square on a slide is recorded for 120 squares:

xx0123456
Frequency183231221142

Test, at the 5% significance level, whether a Poisson distribution is a suitable model.

📝 展开查看完整解法 + MS

Step 1 — Estimate λ\lambda

xˉ=0×18+1×32+2×31+3×22+4×11+5×4+6×2120\bar{x} = \dfrac{0 \times 18 + 1 \times 32 + 2 \times 31 + 3 \times 22 + 4 \times 11 + 5 \times 4 + 6 \times 2}{120} =0+32+62+66+44+20+12120=236120=1.967= \dfrac{0 + 32 + 62 + 66 + 44 + 20 + 12}{120} = \dfrac{236}{120} = 1.967 M1 A1

Step 2 — Poisson probabilities (λ=1.967\lambda = 1.967)

P(0)=e1.967=0.1398P(0) = e^{-1.967} = 0.1398 P(1)=0.1398×1.967=0.2750P(1) = 0.1398 \times 1.967 = 0.2750 P(2)=0.2750×1.967/2=0.2704P(2) = 0.2750 \times 1.967/2 = 0.2704 P(3)=0.2704×1.967/3=0.1773P(3) = 0.2704 \times 1.967/3 = 0.1773 P(4)=0.1773×1.967/4=0.0872P(4) = 0.1773 \times 1.967/4 = 0.0872 P(5)=0.0872×1.967/5=0.0343P(5) = 0.0872 \times 1.967/5 = 0.0343 P(6)=0.0343×1.967/6=0.0112P(6) = 0.0343 \times 1.967/6 = 0.0112 A1 P(7)=1sum=0.0048P(\geq 7) = 1 - \text{sum} = 0.0048

Step 3 — Expected frequencies (E=120×PE = 120 \times P)

xxOOEE
01816.78
13233.00
23132.45
32221.28
41110.46
544.12
6\geq 621.91

B1 — Combine 5+5+: O=4+2=6O = 4 + 2 = 6, E=4.12+1.91=6.03E = 4.12 + 1.91 = 6.03

Step 4 — Chi-squared

xxOOEE(OE)2/E(O-E)^2/E
01816.780.089
13233.000.030
23132.450.065
32221.280.024
41110.460.028
5\geq 566.030.000

χ2=0.089+0.030+0.065+0.024+0.028+0.000=0.236\chi^2 = 0.089 + 0.030 + 0.065 + 0.024 + 0.028 + 0.000 = 0.236 M1 A1

Step 5 — df

k=6k = 6, m=1m = 1df=611=4\mathrm{df} = 6 - 1 - 1 = 4 B1

Step 6 — Conclusion

χ0.05,42=9.488\chi^2_{0.05, 4} = 9.488 M1 0.236 < 9.488 ⇒ do not reject H0H_0. A1

常见陷阱
  • χ2\chi^2 非常小时(如 0.236),模型拟合非常好,但仍需按步骤完整作答

Question Type 3: Test for Independence (Contingency Tables)

如何识别

题目给出行列分类的频数表,要求检验两个变量是否独立。关键词:"test for independence"、"test for association"、"contingency table"

标准解题方法
  1. 计算行和 RiR_i、列和 CjC_j、总和 TT
  2. 每格期望频数 Eij=Ri×CjTE_{ij} = \dfrac{R_i \times C_j}{T}
  3. 检查 Eij5E_{ij} \geq 5,否则合并行或列
  4. χ2=(OijEij)2Eij\chi^2 = \sum \dfrac{(O_{ij} - E_{ij})^2}{E_{ij}}
  5. df=(r1)(c1)\mathrm{df} = (r - 1)(c - 1)
  6. 查表比较
评分标准(MS 模式)
  • 行和、列和:B1
  • EijE_{ij} 计算:M1 方法,A1 全部正确
  • 合并(若需要):B1
  • χ2\chi^2 计算:M1 A1
  • 自由度 B1,结论 M1 A1

Example 1 — 9231/s20/qp/41 Q1 (7 marks):

A survey records favourite ice cream flavour by age group:

VanillaChocolateStrawberryTotal
Children25301570
Adults35202580
Total605040150

Test at the 5% significance level whether flavour preference is independent of age group.

📝 展开查看完整解法 + MS

Step 1 — Expected frequencies

E11=70×60150=28.0E_{11} = \dfrac{70 \times 60}{150} = 28.0 E12=70×50150=23.33E_{12} = \dfrac{70 \times 50}{150} = 23.33 E13=70×40150=18.67E_{13} = \dfrac{70 \times 40}{150} = 18.67 E21=80×60150=32.0E_{21} = \dfrac{80 \times 60}{150} = 32.0 E22=80×50150=26.67E_{22} = \dfrac{80 \times 50}{150} = 26.67 E23=80×40150=21.33E_{23} = \dfrac{80 \times 40}{150} = 21.33 M1 A1

All E5E \geq 5

Step 2 — Chi-squared

CellOOEE(OE)2/E(O-E)^2/E
C–V2528.00.321
C–Ch3023.331.907
C–S1518.670.721
A–V3532.00.281
A–Ch2026.671.668
A–S2521.330.631

χ2=0.321+1.907+0.721+0.281+1.668+0.631=5.529\chi^2 = 0.321 + 1.907 + 0.721 + 0.281 + 1.668 + 0.631 = 5.529 M1 A1

Step 3 — df

r=2r = 2, c=3c = 3df=(21)(31)=2\mathrm{df} = (2-1)(3-1) = 2 B1

Step 4 — Conclusion

χ0.05,22=5.991\chi^2_{0.05, 2} = 5.991 M1 5.529 < 5.991 ⇒ do not reject H0H_0.

No evidence of association between age and flavour preference. A1

常见陷阱
  • EE 用分数或小数,不要四舍五入到整数
  • (r1)(c1)(r-1)(c-1) 不是 r×cr \times c

Example 2 — 9231/s21/qp/41 Q2 (8 marks):

Students are classified by grade (A, B, C) and study method (Self-study, Tutored, Mixed):

ABCTotal
Self-study1220840
Tutored18151750
Mixed15251050
Total456035140

Test at the 5% significance level whether grade is independent of study method.

📝 展开查看完整解法 + MS

Step 1 — Expected frequencies

E11=40×45140=12.86E_{11} = \dfrac{40 \times 45}{140} = 12.86 E12=40×60140=17.14E_{12} = \dfrac{40 \times 60}{140} = 17.14 E13=40×35140=10.00E_{13} = \dfrac{40 \times 35}{140} = 10.00 E21=50×45140=16.07E_{21} = \dfrac{50 \times 45}{140} = 16.07 E22=50×60140=21.43E_{22} = \dfrac{50 \times 60}{140} = 21.43 E23=50×35140=12.50E_{23} = \dfrac{50 \times 35}{140} = 12.50 E31=50×45140=16.07E_{31} = \dfrac{50 \times 45}{140} = 16.07 E32=50×60140=21.43E_{32} = \dfrac{50 \times 60}{140} = 21.43 E33=50×35140=12.50E_{33} = \dfrac{50 \times 35}{140} = 12.50 M1 A1

All E5E \geq 5

Step 2 — Chi-squared

χ2=(1212.86)212.86+(2017.14)217.14+(810)210+(1816.07)216.07+(1521.43)221.43+(1712.50)212.50+(1516.07)216.07+(2521.43)221.43+(1012.50)212.50\chi^2 = \dfrac{(12-12.86)^2}{12.86} + \dfrac{(20-17.14)^2}{17.14} + \dfrac{(8-10)^2}{10} + \dfrac{(18-16.07)^2}{16.07} + \dfrac{(15-21.43)^2}{21.43} + \dfrac{(17-12.50)^2}{12.50} + \dfrac{(15-16.07)^2}{16.07} + \dfrac{(25-21.43)^2}{21.43} + \dfrac{(10-12.50)^2}{12.50}

=0.057+0.477+0.400+0.232+1.929+1.620+0.071+0.595+0.500=5.881= 0.057 + 0.477 + 0.400 + 0.232 + 1.929 + 1.620 + 0.071 + 0.595 + 0.500 = 5.881

χ2=5.881\chi^2 = 5.881 M1 A1

Step 3 — df

r=3r = 3, c=3c = 3df=(31)(31)=4\mathrm{df} = (3-1)(3-1) = 4 B1

Step 4 — Conclusion

χ0.05,42=9.488\chi^2_{0.05, 4} = 9.488 M1 5.881 < 9.488 ⇒ do not reject H0H_0. A1

常见陷阱
  • 3×33 \times 3 表自由度是 4,不是 9
  • 每个 EE 都要分别计算,不要以为对称就一定相等

Example 3 — 9231/w23/qp/41 Q2 (8 marks):

A survey records preferred mobile OS by gender:

iOSAndroidOtherTotal
Male2835770
Female32251370
Total606020140

Test at the 5% significance level whether OS preference is independent of gender.

📝 展开查看完整解法 + MS

Step 1 — Expected frequencies

E11=70×60140=30.0E_{11} = \dfrac{70 \times 60}{140} = 30.0 E12=70×60140=30.0E_{12} = \dfrac{70 \times 60}{140} = 30.0 E13=70×20140=10.0E_{13} = \dfrac{70 \times 20}{140} = 10.0 E21=70×60140=30.0E_{21} = \dfrac{70 \times 60}{140} = 30.0 E22=70×60140=30.0E_{22} = \dfrac{70 \times 60}{140} = 30.0 E23=70×20140=10.0E_{23} = \dfrac{70 \times 20}{140} = 10.0 M1 A1

All E5E \geq 5

Step 2 — Chi-squared

CellOOEE(OE)2/E(O-E)^2/E
M–iOS2830.00.133
M–And3530.00.833
M–Oth710.00.900
F–iOS3230.00.133
F–And2530.00.833
F–Oth1310.00.900

χ2=0.133+0.833+0.900+0.133+0.833+0.900=3.732\chi^2 = 0.133 + 0.833 + 0.900 + 0.133 + 0.833 + 0.900 = 3.732 M1 A1

Step 3 — df

r=2r = 2, c=3c = 3df=(21)(31)=2\mathrm{df} = (2-1)(3-1) = 2 B1

Step 4 — Conclusion

χ0.05,22=5.991\chi^2_{0.05, 2} = 5.991 M1 3.732 < 5.991 ⇒ do not reject H0H_0. A1

常见陷阱
  • 本题行列对称(行等和、列等和),可直接用公式:E=70×60/140=30E = 70 \times 60 / 140 = 30 等,注意 Others 列的期望是 10

Example 4 — 9231/s24/qp/41 Q5 (9 marks):

Data on smoking habits and exercise frequency:

Never smokeOccasionalRegularTotal
Exercises45201075
Does not exercise25252575
Total704535150

Test at the 5% significance level whether smoking habit is independent of exercise.

📝 展开查看完整解法 + MS

Step 1 — Expected frequencies

E11=75×70150=35.0E_{11} = \dfrac{75 \times 70}{150} = 35.0 E12=75×45150=22.5E_{12} = \dfrac{75 \times 45}{150} = 22.5 E13=75×35150=17.5E_{13} = \dfrac{75 \times 35}{150} = 17.5 E21=75×70150=35.0E_{21} = \dfrac{75 \times 70}{150} = 35.0 E22=75×45150=22.5E_{22} = \dfrac{75 \times 45}{150} = 22.5 E23=75×35150=17.5E_{23} = \dfrac{75 \times 35}{150} = 17.5 M1 A1

All E5E \geq 5

Step 2 — Chi-squared

CellOOEE(OE)2/E(O-E)^2/E
E–N4535.02.857
E–O2022.50.278
E–R1017.53.214
NE–N2535.02.857
NE–O2522.50.278
NE–R2517.53.214

χ2=2.857+0.278+3.214+2.857+0.278+3.214=12.698\chi^2 = 2.857 + 0.278 + 3.214 + 2.857 + 0.278 + 3.214 = 12.698 M1 A1

Step 3 — df

r=2r = 2, c=3c = 3df=(21)(31)=2\mathrm{df} = (2-1)(3-1) = 2 B1

Step 4 — Conclusion

χ0.05,22=5.991\chi^2_{0.05, 2} = 5.991 M1 12.698 > 5.991 ⇒ reject H0H_0.

Evidence of association between smoking and exercise. A1

常见陷阱
  • 本题 χ2\chi^2 很大(12.698),明显拒绝 H0H_0,仍需写出完整比较过程

Question Type 4: GoF for a Given Probability Function

如何识别

题目给出一个概率质量函数(PMF)或概率密度函数(PDF),要求检验数据是否服从该分布。

标准解题方法
  1. 使用给定分布公式计算 P(X=x)P(X = x)
  2. 计算期望频数 E=n×P(X=x)E = n \times P(X = x)
  3. 合并 E < 5 的类别
  4. χ2=(OE)2/E\chi^2 = \sum (O-E)^2/E
  5. 自由度注意:若分布参数固定(无需估计),则 m=0m = 0
评分标准(MS 模式)
  • 使用给定分布计算概率:M1 A1
  • 期望频数:M1 A1
  • 合并:B1
  • χ2\chi^2M1 A1
  • 自由度:B1
  • 结论:M1 A1

Example 1 — 9231/s23/qp/41 Q3 (10 marks):

A discrete random variable XX has probability function P(X=x)=kx+1P(X = x) = \dfrac{k}{x + 1} for x=0,1,2,3,4x = 0, 1, 2, 3, 4. The following observed frequencies are obtained from 200 trials:

xx01234
Frequency6856382414

Test at the 5% significance level whether the data fit the given distribution.

📝 展开查看完整解法 + MS

Step 1 — Find kk

x=04kx+1=k(1+12+13+14+15)=k(60+30+20+15+1260)=k×13760=1\sum_{x=0}^4 \dfrac{k}{x+1} = k\left(1 + \dfrac12 + \dfrac13 + \dfrac14 + \dfrac15\right) = k\left(\dfrac{60 + 30 + 20 + 15 + 12}{60}\right) = k \times \dfrac{137}{60} = 1

k=60137k = \dfrac{60}{137} M1 A1

Step 2 — Theoretical probabilities

P(0)=60137×1=0.4380P(0) = \dfrac{60}{137} \times 1 = 0.4380 P(1)=60137×12=0.2190P(1) = \dfrac{60}{137} \times \dfrac12 = 0.2190 P(2)=60137×13=0.1460P(2) = \dfrac{60}{137} \times \dfrac13 = 0.1460 P(3)=60137×14=0.1095P(3) = \dfrac{60}{137} \times \dfrac14 = 0.1095 P(4)=60137×15=0.0876P(4) = \dfrac{60}{137} \times \dfrac15 = 0.0876 A1

Step 3 — Expected frequencies (E=200×PE = 200 \times P)

xxOOEE
06887.60
15643.80
23829.20
32421.90
41417.52

All E5E \geq 5B1

Step 4 — Chi-squared

χ2=(6887.60)287.60+(5643.80)243.80+(3829.20)229.20+(2421.90)221.90+(1417.52)217.52\chi^2 = \dfrac{(68-87.60)^2}{87.60} + \dfrac{(56-43.80)^2}{43.80} + \dfrac{(38-29.20)^2}{29.20} + \dfrac{(24-21.90)^2}{21.90} + \dfrac{(14-17.52)^2}{17.52}

=4.388+3.397+2.652+0.201+0.707=11.345= 4.388 + 3.397 + 2.652 + 0.201 + 0.707 = 11.345 M1 A1

Step 5 — df

k=5k = 5 categories, m=0m = 0 (no parameters estimated — kk was derived from the distribution, not estimated from data) df=510=4\mathrm{df} = 5 - 1 - 0 = 4 B1

Step 6 — Conclusion

χ0.05,42=9.488\chi^2_{0.05, 4} = 9.488 M1 11.345 > 9.488 ⇒ reject H0H_0.

Data does not fit the given distribution. A1

常见陷阱
  • 注意 m=0m = 0 还是 m=1m = 1:本题中分布参数 kk 由概率总和为 1 确定,不是从数据估计的,所以 m=0m = 0
  • 如果分布有未知参数(如 Binomial 的 pp)且从数据估计,则 m=1m = 1

Example 2 — 9231/s20/qp/41 Q1 variation (6 marks):

Given P(X=x)=15P(X = x) = \dfrac{1}{5} for x=1,2,3,4,5x = 1, 2, 3, 4, 5 (uniform distribution), observed frequencies from 100 trials:

xx12345
Frequency1525221820

Test at the 5% level.

📝 展开查看完整解法 + MS

Step 1 — Expected frequencies

P(X=x)=0.2P(X = x) = 0.2 for all xx E=100×0.2=20E = 100 \times 0.2 = 20 for all xx B1

Step 2 — Chi-squared

χ2=(1520)220+(2520)220+(2220)220+(1820)220+(2020)220\chi^2 = \dfrac{(15-20)^2}{20} + \dfrac{(25-20)^2}{20} + \dfrac{(22-20)^2}{20} + \dfrac{(18-20)^2}{20} + \dfrac{(20-20)^2}{20}

=1.25+1.25+0.20+0.20+0.00=2.90= 1.25 + 1.25 + 0.20 + 0.20 + 0.00 = 2.90 M1 A1

Step 3 — df

k=5k = 5, m=0m = 0df=51=4\mathrm{df} = 5 - 1 = 4 B1

Step 4 — Conclusion

χ0.05,42=9.488\chi^2_{0.05, 4} = 9.488 M1 2.90 < 9.488 ⇒ do not reject H0H_0. A1

常见陷阱
  • 均匀分布没有估计参数,m=0m = 0