---
title: "Chi-square test on 100 random numbers"
subject: "Simulation and Modeling"
chapter: 6
key: "semester_8/simulation_and_modeling:chi-square-uniformity-100-numbers"
source: https://www.bctengineer.com/q/semester_8/simulation_and_modeling/chi-square-uniformity-100-numbers
site: BCT Engineering
---

# Chi-square test on 100 random numbers

Simulation and Modeling · Chapter 6: Random Number

- Asked in: 2070 Magh, 6 marks
- Video: [Lecture video_15CS834_Module3_Test for Random Numbers_Swetha Hiremath](https://www.youtube.com/watch?v=7SJBhXNq4Ug) — Sairam CS Video
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/simulation_and_modeling/chi-square-uniformity-100-numbers
- Whole chapter: https://www.bctengineer.com/md/semester_8/simulation_and_modeling/chapter-6

## Question

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).

## 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.

## Answer

**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.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. The table has 9 rows x 11 values. What is the expected frequency per class used?
   A. 10
   B. 9.9
   C. 11
   D. 99
   Answer: B. There are 99 values, so Ei = 99/10 = 9.9. (Key point: Data count)

2. How are the classes formed?
   A. Five classes of width 0.2
   B. Ten classes of width 0.1
   C. Twenty classes of width 0.05
   D. One class per value
   Answer: B. [0,1] is divided into n = 10 equal classes of width 0.1. (Key point: Class setup)

3. With alpha = 0.05 and 10 classes, which critical value is used?
   A. 16.92 (df = 9)
   B. 18.31 (df = 10)
   C. 15.51 (df = 8)
   D. 3.84 (df = 1)
   Answer: A. df = n - 1 = 9, giving chi-square 0.05,9 = 16.92. (Key point: Critical value)

4. chi-square0 = 6.96 against 16.92 leads to:
   A. Rejecting H0
   B. Not rejecting H0; uniformity accepted
   C. Rejecting independence
   D. Rejecting because 6.96 is large
   Answer: B. 6.96 < 16.92, so the numbers pass the uniformity test. (Key point: Conclusion)

## Related in Simulation and Modeling

- [Chi-square uniformity test, 40 numbers](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Achi-square-uniformity-table-2074) — Simulation and Modeling, chapter 6
- [Poker test, 1000 four-digit numbers (2070 Magh)](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Apoker-test-numerical-2070-magh) — Simulation and Modeling, chapter 6, asked 3×
- [Pseudo-random; Kolmogorov-Smirnov numerical](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Aks-test-uniform-numerical) — Simulation and Modeling, chapter 6
- [Poker test, 10,000 five-digit numbers (2072)](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Apoker-test-numerical-2072-ashwin) — Simulation and Modeling, chapter 6, asked 4×
- [Poker test, 1000 four-digit numbers (2069)](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Apoker-test-numerical-2069-bhadra) — Simulation and Modeling, chapter 6, asked 3×
- [Poker test, 10,000 five-digit numbers (2074)](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Apoker-test-numerical-2074-magh) — Simulation and Modeling, chapter 6, asked 2×

## Related in other subjects

- [Merge sort on 47, 27, 56, 23, ...](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Amerge-sort-trace-47-27) — Data Structure and Algorithm, chapter 7
- [Chi-square test of independence: 2×2 procedure](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Achi-square-independence-2x2-procedure) — Probability and Statistics, chapter 7
- [Chi-square: opinion change before election](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Apolls-opinion-change-chi-square) — Probability and Statistics, chapter 7
- [Conductor selection, 100 MW 70 km 132 kV](https://www.bctengineer.com/question.md?key=semester_8%2Ftransmission_and_distribution_system_design%3Aconductor-selection-100mw-70km-132kv) — Transmission and Distribution System Design, chapter 4
