home *** CD-ROM | disk | FTP | other *** search
- Date: Tue, 28 Feb 89 10:29:08 PST
- From: MINUIT%FSU.MFENET@NMFECC.ARPA
- Subject: á random number generators
-
- When I posted the code for George Marsaglia's universal random number
- generator, I forgot to mention that the seed variables can only have
- certain values:
-
- i, j, and k must be between 1 and 178 (not all of them 1)
- l must be in the range 0 to 168
-
- I am posting a slightly modified version of the code that requires only two
- seed variables which basically have the range 0 to 30000. One nice feature
- of this version is that each subsequence of numbers specified by the two
- seeds has a length of approximately 10^30. If different parts of a large
- calculation is being worked on by several people, each person could be
- given his own IJ seed. That would leave 30000 more seeds for the individual
- to use -- without fear that any part of the overall calculation would
- experience correlations in the random numbers.
-
- Finally, it should also be noted that to save the state of the random number
- generator at any point in time, you have to save the entire contents of the
- common block
-
- - David LaSalle
- minuit%fsu@nmfecc.arpa
-
- SCRI
- Florida State University
- Tallahassee, FL 32306-4052
- (904)644-1010
- -------------------------------------------------------------------------
- C This random number generator originally appeared in "Toward a Universal
- C Random Number Generator" by George Marsaglia and Arif Zaman.
- C Florida State University Report: FSU-SCRI-87-50 (1987)
- C
- C It was later modified by F. James and published in "A Review of Pseudo-
- C random Number Generators"
- C
- C THIS IS THE BEST KNOWN RANDOM NUMBER GENERATOR AVAILABLE.
- C (However, a newly discovered technique can yield
- C a period of 10^600. But that is still in the development stage.)
- C
- C It passes ALL of the tests for random number generators and has a period
- C of 2^144, is completely portable (gives bit identical results on all
- C machines with at least 24-bit mantissas in the floating point
- C representation).
- C
- C The algorithm is a combination of a Fibonacci sequence (with lags of 97
- C and 33, and operation "subtraction plus one, modulo one") and an
- C "arithmetic sequence" (using subtraction).
- C
- C On a Vax 11/780, this random number generator can produce a number in
- C 13 microseconds.
- C========================================================================
-