Simulation and modeling - Old Questions
2. Describe the linear congruential method for random number generation. Use the Multiplicative congruential method to generate a sequence of four-three digit random integers, with seed = 117, constant multiplier = 43 and modulus = 1000. [4+6]
Answer
AI is thinking...
The linear congruential method produces a sequence of integers X1, X2, X3,.......between zero and m-1 according to the following recursive relationship:
- The initial value X0 is called the seed;
- a is called the constant multiplier;
- c is the increment
- m is the modulus
The selection of a, c, m and X0 drastically affects the statistical properties such as mean and variance, and the cycle length.
Case 1:
When , the form is called the mixed congruential method.
Case 2:
When c = 0, the form is known as the multiplicative congruential method.
Case 3:
When a = 1, the form is known as additive congruential method.
The random numbers corresponding to each random integer can be obtained as:
Ri = Xi/m, for i = 0, 1, 2, 3, …………..
Now,
Given,
X0 = 117,
α = 43,
m=1000
We have,
For multiplicative congruential method:
Xi+1 = (α Xi ) mod m
The sequence of random integers are calculated as follows:
X0 = 117
X1 = (α X0) mod m = (43*117) mod 1000 = 5031 mod 1000 = 031
X2 = (α X1) mod m = (43*31) mod 1000 = 1333 mod 1000 = 333
X3 = (α X2) mod m = (43*333) mod 1000 = 14319 mod 1000 = 319
X4= (α X3 ) mod m = (43*319) mod 1000 = 13717 mod 1000 = 717