
Due: Thursday, November 2, 2006 
Objective: 
Experiment with random number generators.
 Write a program that generates N random variates (N
is an input to your program) uniformly distributed in
the interval (0,1). Use the ChiSquare test to test if
the generated data fit the distribution. You can use the
following uniform random number generator.

Input: 
 Number of samples N.
 Number of intervals for the purposes of the ChiSquare
test.

Output: 
 Number of samples in each interval
 The value of the statistic (sum of errors).

Report: 
 Perform the test for the 5 initial seeds shown below
as well as for various values of N and present your results
in an appropriate way.
 Estimate the covariance between each random variate
with its previous variate.
 Estimate the covariance between each generated random
variate with the one before its previous.

Seeds: 
 1397, 2171, 5171, 7147, 9913

RNG: 
ISEED[5]={1397, 2171, 5171, 7147, 9913};
double UNI(int seed) /*Generate a random number uniformly
distributed in [0,1].*/
{
long a= ISEED[seed]/16384;
long b= ISEED[seed]%16384;
ISEED[seed]= (((13205*a+74505*b)%16384)*16384+13205*b)%268435456;
return ((double)(ISEED[seed]/268435456.0));
}/*UNI()*/
