Write a MATLAB script to implement the linear congruential algorithm to generate 5000 pseudo-random variates in the interval (0,1). Use the following parameters: seed=17; A=1103515245; M=2147483648; C=12345.
Obtain the sample mean of generated numbers using the MATLAB function mean.
Parameters
The parameters M, C, and A in the linear congruential generator are chosen to make the sequence as random as possible.
Choices for these values must meet the following necessary and sufficient conditions contained in the theorem proved by Hull Dobell (1962).
1. C must be relatively prime to M (that is, their greatest common divisor is 1)
2. B = A-1 is a multiple of p, for every prime p that divides M
3. B is a multiple of 4 if M is a multiple of 4.