---
title: "Random number; problems in generating pseudo-random"
subject: "Simulation and Modeling"
chapter: 6
key: "semester_8/simulation_and_modeling:rn-problems-pseudo-random"
source: https://www.bctengineer.com/q/semester_8/simulation_and_modeling/rn-problems-pseudo-random
site: BCT Engineering
---

# Random number; problems in generating pseudo-random

Simulation and Modeling · Chapter 6: Random Number

- Asked in: 2070 Bhadra, 8 marks
- Video: [Pseudorandom Number Generator (PRNG)](https://www.youtube.com/watch?v=q2XVhTWJ-Oo) — Neso Academy
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/simulation_and_modeling/rn-problems-pseudo-random
- Whole chapter: https://www.bctengineer.com/md/semester_8/simulation_and_modeling/chapter-6

## Question

What is a random number? What are the problems associated with generating pseudo random numbers?

## Short answer

A random number is uniformly distributed on [0,1) and independent. Pseudo‑random numbers from linear congruential generators (Xn+1=(aXn+c) mod m) are deterministic. Problems: finite period (cycling), non‑uniformity, serial correlation (lattice structure), limited distinct values, poor seed or parameter choice, overflow, need for statistical testing. Solutions: large modulus (e.g., 2^31−1), combined generators, testing.

## Answer

#### Random number
A random number is a number drawn from a given distribution so that its value cannot be predicted. In simulation it usually means a number R uniformly distributed on [0, 1) and independent of the other numbers. These are the base from which random variates of any distribution (exponential, normal, etc.) are produced.

True random numbers (from radioactive decay, electronic noise) are slow and cannot be repeated. So computers use **pseudo-random numbers**, produced by a deterministic recurrence such as the linear congruential method Xn+1 = (aXn + c) mod m, Rn = Xn/m. They only imitate randomness.

#### Problems in generating pseudo-random numbers
1. **Not truly random.** The sequence is fully determined by the seed and the formula, so it only appears random.
2. **Finite period / cycling.** The sequence must repeat after at most m values. A poor choice of a, c, m gives a short cycle, so the same numbers are reused.
3. **Departure from uniformity.** The generated numbers may not be evenly spread over [0, 1), giving too many or too few numbers in some regions.
4. **Dependence (correlation).** Successive numbers may be correlated, or fall on a few lines or planes when plotted in 2 or 3 dimensions (lattice structure).
5. **Poor seed or parameter choice.** Some seeds lead to degeneration, e.g. the sequence sticks at zero, or a short loop. The choice of a, c, m must follow the full-period conditions.
6. **Discrete values only.** Only m distinct values are possible, so the density is not truly continuous. Small m gives large gaps.
7. **Computational issues.** Overflow in the product aX, slow speed, or different results on different machines (non-portability).
8. **Need for statistical testing.** Every generator must be tested for uniformity (chi-square, K-S) and independence (runs, autocorrelation, gap, poker) before use. Passing the tests is not a guarantee, because only finite tests are made.

Remedies: use a large modulus (e.g. 2³¹ − 1), proven multipliers, combined generators, and always test the output. Reproducibility is an advantage, since the same stream can be replayed for debugging.

## Check yourself

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

1. Why are computers' numbers called pseudo-random?
   A. They are produced by a deterministic formula and only imitate randomness
   B. They come from radioactive decay
   C. They are always integers
   D. They are not uniform
   Answer: A. The sequence is fully determined by the seed and formula, so it only appears random. (Key point: Pseudo-random meaning)

2. What problem arises from a poor choice of a, c and m in an LCG?
   A. Numbers become negative
   B. A short cycle, so the same numbers are reused
   C. The generator becomes truly random
   D. The seed becomes irrelevant
   Answer: B. Poor parameters give a short period; the sequence repeats after at most m values. (Key point: Finite period)

3. What does the 'dependence' problem mean for plotted successive numbers?
   A. Points fill the plane uniformly
   B. Points may lie on a few lines or planes (lattice structure)
   C. Points always form a circle
   D. Points have mean zero
   Answer: B. Successive numbers may be correlated and fall on a few lines or planes in 2D or 3D plots. (Key point: Lattice structure)

4. Which is a remedy listed for generator problems?
   A. Use a small modulus
   B. Avoid testing the output
   C. Use a large modulus, proven multipliers and test the output
   D. Use the mid-square method only
   Answer: C. A large modulus (e.g. 2^31 - 1), proven multipliers, combined generators and statistical testing are the remedies. (Key point: Remedies)

## Related in Simulation and Modeling

- [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
- [Properties of random numbers](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Arn-properties) — Simulation and Modeling, chapter 6
- [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
- [Random number properties and Gap test](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Arn-properties-gap-test) — Simulation and Modeling, chapter 6, asked 4×
- [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
- [Random number generation methods](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Arn-generation-methods) — Simulation and Modeling, chapter 6

## Related in other subjects

- [Design and construction problems of hill roads](https://www.bctengineer.com/question.md?key=semester_6%2Ftransportation_engineering_i%3Ahill-problems) — Transportation Engineering I, chapter 5, asked 11×
- [Hill climbing and its problems](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Ahill-climbing-problems-solutions) — Artificial Intelligence, chapter 3
- [4-bit ripple carry adder and its problems](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Aripple-carry-adder-problems) — Digital Logic, chapter 5
- [Problems in asynchronous sequential design](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Aasynchronous-sequential-problems) — Digital Logic, chapter 9
