Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to test PRNG?

Lately I implemented a MersenneTwister for 64-bit integer (or long). Is there a guide or examples of how to test PRNG so that I may know whether or not my implementation is good-enough solution. I'm specially interested into how to verify if my implementation has good enough uniform distribution.

The more specifically this is tied to MersenneTwister the better.

like image 441
Daniel Fath Avatar asked Dec 03 '10 19:12

Daniel Fath


1 Answers

You do not need to test the Mersenne Twister algorithm -- that's been done over and over by people who really know what they're doing -- you only have to test whether you've correctly implemented the algorithm.

You can go to the Mersenne Twister web site and grab their test output. If you produce the same sequence of outputs that they do, you've probably implemented the algorithm correctly.

Note that the MT site has a link specifically for 64 bit machines and different test outputs for 32 and 64 bit versions.

like image 125
John D. Cook Avatar answered Sep 21 '22 08:09

John D. Cook