- 2070 Magh · 6 marks
Chi-square test on 100 random numbers
Short answer
Using 10 equal classes for the 99 numbers, the chi‑square statistic is 6.96. With 9 degrees of freedom and α=0.05, the critical value is 16.92. Since 6.96 < 16.92, the null hypothesis of uniformity is not rejected.
A set of 100 random numbers have been generated as below:
| 0.23 | 0.30 | 0.07 | 0.39 | 0.43 | 0.47 | 0.66 | 0.19 | 0.49 | 0.37 | 0.53 |
| 0.80 | 0.56 | 0.10 | 0.28 | 1.00 | 0.23 | 0.04 | 0.93 | 0.25 | 0.90 | 0.24 |
| 0.88 | 0.75 | 0.54 | 0.84 | 0.42 | 0.68 | 0.12 | 0.68 | 0.16 | 0.72 | 0.93 |
| 0.14 | 0.71 | 0.23 | 0.76 | 0.96 | 0.89 | 0.82 | 0.99 | 0.42 | 0.22 | 0.77 |
| 0.36 | 0.95 | 0.35 | 0.14 | 0.89 | 0.26 | 0.99 | 0.78 | 0.23 | 0.75 | 0.67 |
| 0.34 | 0.04 | 0.95 | 0.41 | 0.89 | 0.64 | 0.88 | 0.92 | 0.62 | 0.84 | 0.36 |
| 0.88 | 0.32 | 0.86 | 0.24 | 0.42 | 0.54 | 0.35 | 0.60 | 0.88 | 0.84 | 0.15 |
| 0.86 | 0.99 | 0.63 | 0.56 | 0.16 | 0.53 | 0.86 | 0.69 | 0.74 | 0.70 | 0.38 |
| 0.48 | 0.67 | 0.54 | 0.97 | 0.50 | 0.09 | 0.20 | 0.72 | 0.27 | 0.72 | 0.96 |
Test these values for uniform distribution using Chi Square-Test (Use α=0.05).
Note on data. The question says 100 numbers, but the table contains 9 rows × 11 = 99 values. The test is worked with the 99 numbers given, so Ei = 99/10 = 9.9. (With 100 numbers, Ei = 10, and the conclusion is the same.)
Setup. H0: the numbers are uniformly distributed on [0, 1]. H1: they are not. Divide [0, 1] into n = 10 equal classes of width 0.1. A value such as 0.10 or 0.20 is placed in the lower class, and 1.00 in the last class.
Observed and expected frequencies
| Class | Oi | Ei | Oi − Ei | (Oi − Ei)²/Ei |
|---|---|---|---|---|
| 0.00–0.10 | 5 | 9.9 | -4.9 | 2.425 |
| 0.11–0.20 | 8 | 9.9 | -1.9 | 0.365 |
| 0.21–0.30 | 12 | 9.9 | 2.1 | 0.445 |
| 0.31–0.40 | 9 | 9.9 | -0.9 | 0.082 |
| 0.41–0.50 | 9 | 9.9 | -0.9 | 0.082 |
| 0.51–0.60 | 8 | 9.9 | -1.9 | 0.365 |
| 0.61–0.70 | 10 | 9.9 | 0.1 | 0.001 |
| 0.71–0.80 | 11 | 9.9 | 1.1 | 0.122 |
| 0.81–0.90 | 15 | 9.9 | 5.1 | 2.627 |
| 0.91–1.00 | 12 | 9.9 | 2.1 | 0.445 |
Σ Oi = 99.
χ0² = Σ (Oi − Ei)²/Ei = 6.96
Critical value. α = 0.05, degrees of freedom = n − 1 = 9, so χ²0.05,9 = 16.92.
Conclusion. Since χ0² = 6.96 < 16.92, H0 is not rejected. The numbers pass the chi-square test for uniformity at the 5% level.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Chi-square uniformity test, 40 numbers · Simulation and Modeling, chapter 6
- Poker test, 1000 four-digit numbers (2070 Magh) · Simulation and Modeling, chapter 6 · asked 3×
- Pseudo-random; Kolmogorov-Smirnov numerical · Simulation and Modeling, chapter 6
- Poker test, 10,000 five-digit numbers (2072) · Simulation and Modeling, chapter 6 · asked 4×
- Poker test, 1000 four-digit numbers (2069) · Simulation and Modeling, chapter 6 · asked 3×
- Poker test, 10,000 five-digit numbers (2074) · Simulation and Modeling, chapter 6 · asked 2×
- Merge sort on 47, 27, 56, 23, ... · Data Structure and Algorithm, chapter 7
- Chi-square test of independence: 2×2 procedure · Probability and Statistics, chapter 7
- Chi-square: opinion change before election · Probability and Statistics, chapter 7
- Conductor selection, 100 MW 70 km 132 kV · Transmission and Distribution System Design, chapter 4