Skip to main content

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.230.300.070.390.430.470.660.190.490.370.53
0.800.560.100.281.000.230.040.930.250.900.24
0.880.750.540.840.420.680.120.680.160.720.93
0.140.710.230.760.960.890.820.990.420.220.77
0.360.950.350.140.890.260.990.780.230.750.67
0.340.040.950.410.890.640.880.920.620.840.36
0.880.320.860.240.420.540.350.600.880.840.15
0.860.990.630.560.160.530.860.690.740.700.38
0.480.670.540.970.500.090.200.720.270.720.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

ClassOiEiOi − Ei(Oi − Ei)²/Ei
0.00–0.1059.9-4.92.425
0.11–0.2089.9-1.90.365
0.21–0.30129.92.10.445
0.31–0.4099.9-0.90.082
0.41–0.5099.9-0.90.082
0.51–0.6089.9-1.90.365
0.61–0.70109.90.10.001
0.71–0.80119.91.10.122
0.81–0.90159.95.12.627
0.91–1.00129.92.10.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)

All Simulation and Modeling chapter 6 questions →