Simulation and Modelling - Old Questions

2.  Use multiplicative congruential method to generate a sequence of three digits random numbers between (0, 1) with X0=27, a=3 and m=1000. Use any one of the uniformity test to find out whether the generated numbers are uniformly distributed or not? (Critical value for α=0.05 and N=5 is 0.565).

10 marks | Asked in 2075

Given,

    X27

    α = 3,

    m=1000

We have,

For multiplicative congruential method:

        Xi+1 = (α X) mod m

        & R=Xi/m,

The sequence of random numbers are calculated as follows:

X= 27

R0 = 27/1000 = 0.027

X1 = (α X0) mod m = (3*27) mod 1000 = 81 mod 1000 = 81

R1 = 81/1000 = 0.081

X2 = (α X1) mod m = (3*81) mod 1000 = 243 mod 1000 = 243

R2 = 243/1000 = 0.243

X3 = (α X2) mod m = (3*243) mod 1000 = 729 mod 1000 = 729

R3 = 729/1000 = 0.729

X4(α X3 ) mod m = (3*729) mod 1000 = 2187 mod 1000 = 187

R= 187/1000 = 0.187

Therefore,
The sequence of random numbers are 0.027, 0.081, 0.243, 0.729, 0.187

Now, to find out whether these random numbers are uniformly distributed or not using Kolmogorov--Smirnov test 

Arranging the above random numbers number in ascending order:

    0.027, 0.081, 0.187, 0.243,, 0.729

Here, N = 5

Calculation table for Kolmogorov-Smirnov test :

i



10.0270.20.1730.027
20.0810.40.319-
30.1870.60.413-
40.2430.80.557-
50.72910.271-

Now, calculating

\\begin{displaymath}D^+ = {\\rm max}_{1 \\le i \\le N} \\left\\{ \\frac{i}{N} - R_{(i)}
\\right\\} \\end{displaymath} = 0.557

\\begin{displaymath}D^- = {\\rm max}_{1 \\le i \\le N} \\left\\{ R_{(i)} -
\\frac{i-1}{N} \\right\\} \\end{displaymath} = 0.027

$D = {\\rm max} (D^+, D^-)$ = 0.557

Given, Critical value $D_\\alpha$ = 0.565

Since the computed value, D = 0.557, is less than the tabulated critical value, $D_\\alpha$ = 0.565, the hypothesis of no difference between the distribution of the generated numbers and the uniform distribution is not rejected.