Assignment 2
Assignment 2
Assignment 2
Assignment 2
Problem 1
Use the multiplicative congruential method to generate a sequence of four three-digit random
integers and corresponding random numbers. Let X0 = 117, a = 43, and m = 1000
Given,
X0 = 117
a = 43
m= 1000
Problem 2
The sequence of numbers 0.54, 0.73, 0.98, 0.11 and 0.68 has been generated. Use the
Kolmogorov-Smirnov test with α = 0.05 to learn whether the hypothesis that the numbers are
uniformly distributed on the interval [0, 1] can be rejected.
Problem 3
Figure out whether these linear congruential generators can achieve a maximum period; also,
state restrictions on X0 to obtain this period.
Problem 4
Consider the multiplicative congruential generator under the following circumstances:
(a) X0 = 7, a = 11, m = 16
(b) X0 = 8, a = 11, m = 16
The multiplicative congruential generator,
Xn = aXn-1 mod m, n = 1,2,…..
Given X0 = 8
X1 = 11 x 8 mod 16 = 88 mod 16 = 8
The cycle repeats and the length of the cycle is 1
The maximum period 16 is not achieve because X0 is even
(c) X0 = 7, a = 7, m = 16
The multiplicative congruential generator,
Xn = aXn-1 mod m, n = 1,2,…..
Given X0 = 7
X1 = 7 x 7 mod 16 = 49 mod 16 = 1
X2 = 1x7 mod 16 = 7 mod 16 = 7
The cycle repeats and the length of the cycle is 2
The maximum period 16 is not achieve because X0 do not have the form of 3 + 8k.
(d) X0 = 8, a = 7, m = 16
The multiplicative congruential generator,
Xn = aXn-1 mod m, n = 1,2,…..
Given X0 = 8
X1 = 8 x 7 mod 16 = 56 mod 16 = 8
The cycle repeats and the length of the cycle is 1
The maximum period 16 is not achieve because X0 is even.
David Acharya
Problem 5
CHI-SQUARE TEST
Value Df Asymptotic Significance (2-
Sided)
Pearson Chi- 306.00 289 0.235
square
Likelihood 104.053 289 1.000
ratio
Linear -by- 1.541 1 .215
Liner
Association
N of valid 18
cases