USA: +1-585-535-1023

UK: +44-208-133-5697

AUS: +61-280-07-5697

Random Numbers

3. RANDOM NUMBERS

 

The basic requirement of random numbers is that the order in which they occur should be

independent. In simulation models, the use of [0, 1] random numbers is most preferred. In computer simulation truly random numbers cannot be generated because all computer activities are guided by algorithms which are deterministic in nature. However sequences of numbers, called pseudo-random numbers, are used as random numbers. These numbers satisfy some of the properties of random numbers. So the generation of random numbers (i.e., the pseudo-random numbers) is a fundamental step in simulation. We describe two random numbers generation technique below :

 

(a) Mid-Square Technique

This is the oldest technique given by Neumann which is described below :

(i) Take a number of 2d digits (called seed).

(ii) Square it.

(iii) Take the middle 2 d digit (non-zero) and it will be the first pseudo-random number.

[This technique has a drawback. We may obtain zero digits in the middle resulting a stop of this technique.]

e.g., Let                       u0 = 0.0400 (seed)

 

Then                            u02 = 0.001 60000

 

=> the first pseudo-random number is u1 = 0.1 600.

Then                            u21 = 0. 02560000

 

=> the second pseudo-random number is u2   = 0.5600 and so on.

 

(b) Linear Congruential Technique

 

This is also known as power residual technique. This recursion formula is

X k =(a x k _ 1 + c) (mod m), k = 1 , 2, . .. .

 

where a, c and the seed x0 are all positive integers and less than m. c is relatively prime to m. If

c = 0 then this is called multiplicative congruential technique. Again m is chosen to be 2b or 10d

(b = binary, d = decimals). (mod m) gives the remainder on division.

e.g., Let                                   a= 31, c = 7, m = 1 00 and x0 = 21 .

Then,                                       x1 = (31 x 21 + 7) (mod 1 00)

(0,  = 658 (mod 1 00) = 58

 

=> the first (0,1 ) random number is u1 = xl /M =0.05 - = 0.58

 

x2 = (31 x 58 + 7) (mod 1 00)

= 1 805 (mod 1 00)

= 5

 

=> the second (0, 1 ) random number is u2 = x2 = 0. 05

 

Again                                      x3 = (3 1 x 5 + 7) (mod 1 00)

= 1 62 (mod 1 00)

= 62

 

=> the third (0, 1 ) random number is u3 = x3/m = 0.62 m

and so on.

 

If the seed is changed then