Skip to main content

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

  1. Uniformity: numbers are uniformly distributed over [0, 1); each of n equal sub-intervals gets about N/n of N numbers.
  2. 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.

nX(n)R = X/16
160.375
210.0625
380.5
4110.6875
5100.625
650.3125
7120.75
8150.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)

All Simulation and Modeling chapter 6 questions →