Next: Random Walk Simulation
Up: Random Number Generators
Previous: Method: Linear Congruent Method
Write a simple program to generate random numbers using the linear
congruent method (1).
-
For pedagogical purposes take and
determine the period, that is, how many numbers are generated
before the sequence repeats.
-
Take the sequence of random numbers you have just computed and plot
successive pairs
on a graph and try to identify clustering (do not connect the
points with lines). For the ``pedagogical'' sequence you should see
correlations which means you should not use it for serious work.
-
Test the built-in random number generator on your computer
for correlations by plotting pairs as above. (This should be good for
serious work.)
Some source code available in:
C, FORTRAN
Two plots
showing the importance of which random number generator to use.
Next: Random Walk
Simulation
Up:
Random Number Generators
Previous: Method: Linear Congruent Method