- 2074 Bhadra · 2+6 marks
Properties and generation techniques of RN
Short answer
Random numbers require uniformity and independence; generators should be fast, reproducible, and have long periods. Techniques include mid-square, mid-product, linear congruential, multiplicative congruential, additive congruential, and physical sources, each illustrated with examples such as LCG a=5, c=3, m=16.
What are the properties of random number? Explain the techniques of generation of random number with appropriate example.
Properties of random numbers
- Uniformity: numbers are uniformly distributed over [0, 1); each of n equal sub-intervals gets about N/n of N numbers.
- Independence: each number is unrelated to the previous ones.
A good generator should also be fast, use little memory, have a long period (full cycle), be reproducible from a seed and pass statistical tests.
Generation techniques
Computer-generated (pseudo-random) numbers are produced by a formula. R = X/m maps integers to [0, 1).
1. Mid-square method. Square the seed, take the middle digits. Seed 1234: 1234^2 = 01522756, so next is 5227 (R = 0.5227); 5227^2 = 27321529 gives 3215 (0.3215); then 3362. It can quickly degenerate: seed 2100 gives 4100, 8100, 6100, 2100 and repeats.
2. Mid-product method. Multiply two consecutive numbers and take the middle digits: 5731 x 7182 = 41160042 gives 1600; 7182 x 1600 = 11491200 gives 4912.
3. Linear congruential method. X(n+1) = (a X(n) + c) mod m.
Example: a = 5, c = 3, m = 16, X0 = 7.
| n | X(n) | R = X/16 |
|---|---|---|
| 1 | 6 | 0.375 |
| 2 | 1 | 0.0625 |
| 3 | 8 | 0.5 |
| 4 | 11 | 0.6875 |
| 5 | 10 | 0.625 |
| 6 | 5 | 0.3125 |
| 7 | 12 | 0.75 |
| 8 | 15 | 0.9375 |
It repeats after 16 numbers (full period). Full period is obtained when c and m are relatively prime, a - 1 is divisible by every prime factor of m, and by 4 if m is divisible by 4. Usually m = 2^b.
4. Multiplicative congruential method. X(n+1) = a X(n) mod m (c = 0). Example: a = 13, m = 64, X0 = 1 gives 13, 41, 21, 17, 29, 57, 37, 33.
5. Additive congruential method. X(n) = (X(n-1) + X(n-k)) mod m. With k = 2, m = 100 and seeds 65, 89: 54, 43, 97, 40, 37.
6. Other: built-in library functions, random number tables and physical (hardware) generators.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Random number generation methods · Simulation and Modeling, chapter 6
- Random number properties and Gap test · Simulation and Modeling, chapter 6 · asked 4×
- Random number properties; KS test algorithm · Simulation and Modeling, chapter 6
- Random number; problems in generating pseudo-random · Simulation and Modeling, chapter 6
- Short note: Convolution in random number · Simulation and Modeling, chapter 6
- Properties of random numbers · Simulation and Modeling, chapter 6
- Continuous random variable; pdf properties · Probability and Statistics, chapter 3
- Stagnation properties and Mach number relations · Turbo Machines, chapter 4
- DSB-FC generation using square law modulator · Communication Systems, chapter 2