next up previous

Exercise 3: Illustrate the generation of random numbers using LCG(13445, 0, 65536, 16811) and to partition the random real numbers into bins.

Obtain and edit the linear congruential program ranlc.f. Supply the additional code to compute the average and the variance. For sample sizes of 10, 100, 1,000, and 10,000, run the code and plot the errors in the average and variance versus sample size. Discuss how the error in these quantities varies with the sample size. Use the following parameters: a = 16807, c = 0, and .