Random Number Generation
Please do the following.
- Write a Linear Congruential Generator of Random Numbers. Your choice:
mixed mode or multiplicative. Strive for full period (m for mixed mode,
m/4 for multiplicative). m should be no larger than 26
for mixed (28 for multiplicative). (See Ch 7 in Banks.)
- Show whether or not your RNG is "full period" or not.
- If it isn't full period, is there some particular seed that
has a pretty long period? If so, use it for testing
-
Empirically test your RNG for uniformity and independence.
For both, use 0.05 for level of significance.
- Use chi-square test for uniformity. Make n>=100. If n=100 then
at most n/k >=5 (so k=20 "bins").
- Use "runs" test for independence (autocorrelation).
-
- Plot a "scatter diagram" for (qualitative) independence.
- Perform the above empirical tests on a RNG provided by "some"
programming language or tool (C, C++, Java, Perl, spreadsheet, etc)
or published algorithm (Numerical Recipes, etc.) -
your choice. Everyone need to pick a different RNG!
- How "good" is the programming language RNG?
Write this up as a report and put a link to it on your course web page.
Your report should also be something that will impress a significant number
of people on the planet.
PS - It should also be alot of fun to do!
Email me the link when it's complete.