Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: [Phys-L] From a Math Prof (physics BS major) at my institution ( math challenge)




The MATLAB rand function supports a method of random number generation called the Mersenne Twister from version 7.1 on. The algorithm used by this method, developed by Nishimura and Matsumoto, generates double precision values in the closed interval [2^(-53), 1-2^(-53)], with a period of (2^19937-1)/2.

For a full description of the Mersenne twister algorithm, see
<http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html>.

A broad overview with sample metacode is available as a wiki at
<http://en.wikipedia.org/wiki/Mersenne_twister>
It begins in this way:
"The *Mersenne twister* is a pseudorandom number generator<http://en.wikipedia.org/wiki/Pseudorandom_number_generator> (PRNG). It is, by far, the most widely used PRNG.^<http://en.wikipedia.org/wiki/Mersenne_twister#cite_note-1> Its name derives from the fact that its period length is chosen to be a Mersenne prime. <http://en.wikipedia.org/wiki/Mersenne_prime>. "The Mersenne Twister was developed in 1997 by Makoto Matsumoto <http://en.wikipedia.org/w/index.php?title=Makoto_Matsumoto&action=edit&redlink=1> (?? ?^? <http://en.wikipedia.org/wiki/Help:Installing_Japanese_character_sets> ) and Takuji Nishimura <http://en.wikipedia.org/w/index.php?title=Takuji_Nishimura&action=edit&redlink=1> (?? ??^? <http://en.wikipedia.org/wiki/Help:Installing_Japanese_character_sets> ).^[2] <http://en.wikipedia.org/wiki/Mersenne_twister#cite_note-2> It was designed specifically to rectify most of the flaws found in older PRNGs. It was the first PRNG to provide fast generation of high-quality pseudo random integers. "The most commonly-used version of the Mersenne Twister algorithm is based on the Mersenne prime 2^19937 -1. The standard implementation of that, MT19937, uses a 32-bit word length. There is another implementation that uses a 64-bit word length, MT19937-64; it generates a different sequence."

Brian Whatcott Altus OK

On 2/27/2014 8:59 AM, Paul Nord wrote:
/snip/
We had this discussion on the TWIST experiment where it was believed that our pRNG had a period of 10^9. Each simulation run used about this number of random numbers. 10^5 events were simulated with each requiring about 10^4 random numbers (if I’m remembering correctly). /snip/ For TWIST, it turned out that we misunderstood the documentation on the pRNG. Someone had provided a list of “known good seeds” which were tested to 10^9 entries. I think that the pRNG was Mersenne Twister with its astronomical period. But it was a good point of discussion for this high statistics experiment.

Paul



On Feb 26, 2014, at 5:08 PM, Craig Wiegert <wiegert@physast.uga.edu> wrote:

This raises a question. In a simulation code, I might need to generate
random numbers for energies, particle displacements, and branch
conditions, all intermingled. Do I go to the same pRNG well for all of
my random number needs, or is it prudent to use different pRNGs (perhaps
the same algorithm but with different seeds) for each type of quantity?

- Craig