Various types of pseudo random number generators have been subjected to the Diehard battery of
randomness tests. These tests were devised by George Marsaglia. He created a program that performs
many tests on a file with bytes created by a generator and reports on the results. This program and
documentation can be downloaded at:
The results of these tests on files of 11 MB created by the generators are summarized below. Refer to the link for a description of each test. A generator is deemed to have passed the test if the resulting p-values are uniformly distributed between 0 and 1, with no p-values equal to either 0 or 1 (to 5 significant digits).
|Randomness Test||24-bit LCG||32-bit MWC||64-bit LCG||10^15 LCG||XLCG||Combo|
|Binary Rank for 6x8 Matrices||Fail||Pass||Fail||Fail||Pass||Pass|
|Bitstream (Monkey Test)||Fail||Pass||Pass||Pass||Pass||Pass|
|Count-the-1's on Stream of Bytes||Fail||Pass||Pass||Fail||Pass||Pass|
|Count-the-1's for Specific Bytes||Fail||Pass||Fail||Fail||Fail||Pass|
The 24-bit LCG is the generator used by the VBScript Rnd function. This generator does very poorly on
the tests. The 64-bit LCG generator did better than a 32-bit LCG, but still failed several of the tests.
The XLCG is an Extended Linear Congruential Generator with a period of about 2^96. The 10^15 LCG is a
Linear Congruential Generator with a modulus of 10^15. It did surprisingly poorly. All MWC (Multiply
With Carry) generators tested have passed all of the tests. The Combo generator combines 12 Multiply
With Carry generators and also passes all tests.
For each generator, a VBScript program was written to produce pseudo random integers from the generator. Each generator was maximal length. Then the program was modified to convert the integers to bytes and write them to a file. 11 MB of bytes were written to the file. Then the Diehard battery of tests were run on the file.