Simulation and modeling - Old Questions
Question Answer Details
11. Use the mixed congruential method to generate a sequence of three two-digit random numbers with X0=37, α=7, c=29 and m=100.
Answer
AI Generated Answer
AI is thinking...
Official Answer
Given,
X0 = 37,
α = 7,
c= 29 &
m=100
We have,
Xi+1 = (α Xi + c) mod m
Mixed Congruential Method: c ≠ 0
& Ri =Xi/m,
The sequence of random numbers are calculated as follows:
X0 = 37
R0 = 37/100 = 0.37
X1 = (α X0 + c) mod m = (7*37+29) mod 100 = 288 mod 100 = 88
R1 = 88/100 = 0.88
X2 = (α X1 + c) mod m = (7*88+29) mod 100 = 645 mod 100 = 45
R2 = 45/100 = 0.45
X3 = (α X2 + c) mod m = (7*45+29) mod 100 = 344 mod 100 = 44
R3 = 44/100 = 0.44
Therefore,
The sequence of random integers are 37, 88, 45, 44
The sequence of random numbers are 0.37, 0.88. 0.45, 0.44.