---
title: "Pseudo-random; Kolmogorov-Smirnov numerical"
subject: "Simulation and Modeling"
chapter: 6
key: "semester_8/simulation_and_modeling:ks-test-uniform-numerical"
source: https://www.bctengineer.com/q/semester_8/simulation_and_modeling/ks-test-uniform-numerical
site: BCT Engineering
---

# Pseudo-random; Kolmogorov-Smirnov numerical

Simulation and Modeling · Chapter 6: Random Number

- Asked in: 2071 Bhadra, 2+6 marks
- Video: [Simulation Modeling 30 The Kolmogorov-Smirnov Test](https://www.youtube.com/watch?v=NzE5anmP6JE) — İsmail Başoğlu
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/simulation_and_modeling/ks-test-uniform-numerical
- Whole chapter: https://www.bctengineer.com/md/semester_8/simulation_and_modeling/chapter-6

## Question

Define pseudo random numbers. The following numbers have been generated 0.44, 0.19, 0.88, 0.27, 0.55, 0.13, 0.63, 0.74, 0.11 and 0.33. Use the Kolmogorov-Smirnov test with α = 0.05 to determine, if the hypothesis that the numbers are uniformly distributed on the interval [0, 1] can be rejected. (Note that the critical value of D for α 0.05 and N = 10 is 0.410.)

## Short answer

Pseudo-random numbers are numbers generated by a deterministic algorithm that mimic true random numbers, reproducible from a seed, uniformly distributed on [0,1) and passing statistical tests. For the K-S test, D = 0.17, less than critical value 0.410 (α=0.05, N=10), so the uniformity hypothesis cannot be rejected.

## Answer

#### Pseudo-random numbers
Pseudo-random numbers are numbers generated by a deterministic algorithm (such as the linear congruential method Xn+1 = (aXn + c) mod m) that imitate true random numbers. They are designed to be uniformly distributed on [0, 1) and to pass statistical tests of uniformity and independence, but the sequence can be reproduced from the seed and eventually cycles.

#### K-S test
H0: the numbers are uniformly distributed on [0, 1]. H1: they are not. N = 10, α = 0.05.

Rank the numbers and compute the differences:

| i | R(i) | i/N | i/N − R(i) | R(i) − (i−1)/N |
|---|---|---|---|---|
| 1 | 0.11 | 0.1 | -0.01 | 0.11 |
| 2 | 0.13 | 0.2 | 0.07 | 0.03 |
| 3 | 0.19 | 0.3 | 0.11 | -0.01 |
| 4 | 0.27 | 0.4 | 0.13 | -0.03 |
| 5 | 0.33 | 0.5 | 0.17 | -0.07 |
| 6 | 0.44 | 0.6 | 0.16 | -0.06 |
| 7 | 0.55 | 0.7 | 0.15 | -0.05 |
| 8 | 0.63 | 0.8 | 0.17 | -0.07 |
| 9 | 0.74 | 0.9 | 0.16 | -0.06 |
| 10 | 0.88 | 1.0 | 0.12 | -0.02 |

D⁺ = max(i/N − R(i)) = **0.17** (at i = 5 and i = 8)
D⁻ = max(R(i) − (i−1)/N) = **0.11** (at i = 1)

D = max(D⁺, D⁻) = **0.17**

Critical value D0.05 = 0.410 (N = 10).

**Conclusion.** Since D = 0.17 < 0.410, the hypothesis of uniformity cannot be rejected. The numbers can be treated as uniformly distributed on [0, 1].

## Check yourself

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

1. Pseudo-random numbers are:
   A. Generated by a deterministic algorithm and repeatable from a seed
   B. Generated from physical noise
   C. Not repeatable
   D. Always independent
   Answer: A. They come from a deterministic algorithm such as an LCG and are repeatable and eventually cycle. (Key point: Pseudo-random numbers)

2. What must be done first in the K-S calculation?
   A. Group numbers into classes
   B. Rank the numbers from smallest to largest
   C. Square each number
   D. Compute the mean
   Answer: B. The numbers are ranked R(1) <= ... <= R(N) before computing D+ and D-. (Key point: First step of K-S)

3. For the given 10 numbers, D+ = 0.17 and D- = 0.11. What is D?
   A. 0.11
   B. 0.28
   C. 0.17
   D. 0.06
   Answer: C. D = max(D+, D-) = 0.17. (Key point: Value of D)

4. With critical value 0.410, what is the conclusion?
   A. Reject uniformity
   B. Uniformity cannot be rejected since 0.17 < 0.410
   C. Reject because D is positive
   D. Need more numbers to decide anything
   Answer: B. D < critical value means no evidence against uniformity. (Key point: Decision)

## Related in Simulation and Modeling

- [Chi-square test on 100 random numbers](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Achi-square-uniformity-100-numbers) — Simulation and Modeling, chapter 6
- [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
- [Random number properties; KS test algorithm](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Arn-properties-ks-algorithm) — Simulation and Modeling, chapter 6
- [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×
- [Random number; problems in generating pseudo-random](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Arn-problems-pseudo-random) — 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×

## Related in other subjects

- [B-tree from 78, 21, 14, 11, 97, 85, 74, 63](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Abtree-build-78-21-14) — Data Structure and Algorithm, chapter 6, asked 2×
- [Numerical: users supported and market penetration](https://www.bctengineer.com/question.md?key=semester_7%2Fwireless_communication%3Amarket-penetration-erlang) — Wireless Communication, chapter 2, asked 2×
- [Standard error; population 12,19,13,16](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Astandard-error-population-12-19-13) — Probability and Statistics, chapter 4
- [Gauss-Seidel: 10x+y-z=11.19](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Agauss-seidel-10x-y-z) — Numerical Method, chapter 3
