How to check PRNG?

Recently, I have implemented MersenneTwister for a 64-bit integer (or long ). Is there a guide or examples of how to test PRNG so that I can know if my implementation is really a good enough solution. I am particularly interested in how to check if my implementation has a fairly uniform distribution.

The more accurately this is tied to the MersenneTwister, the better.

+4
source share
4 answers

You do not need to test the Mersenne Twister algorithm , which was repeatedly executed by people who really know what they are doing - you only need to check whether you implemented the algorithm correctly.

You can go to the Mersenne Twister website and get their test output . If you create the same output sequence as they, you probably implemented the algorithm correctly.

Please note that the MT site has a link specifically for 64-bit machines and various test outputs for 32-bit and 64-bit versions.

+11
source

The standard battery for PRNG tests is Diehard Tests .

+6
source

The simplest approach (if it is a truly generic MT) would be to compare it with the well-known good MT library with the same seed.

+2
source

Aloha!

As someone else said, use well-known test response vectors for algorithms. If you come across test vectors, you can be pretty sure that your generator is working.

If you really want to test the generator. Use the DIEHARD ++ tests implemented with the Dieharder tool:

http://www.phy.duke.edu/~rgb/General/dieharder.php

+1
source

All Articles