How to determine the quality of a pseudo random number generator?

This is based on this question . A series of answers were proposed that generate uneven distributions, and I began to wonder how to quantify the unevenness of the output. I am not looking for template problems, but only aspects with a single meaning.

What are the accepted procedures?


My real thinking is to calculate the average Shannon entropy per call, by calculating the entropy of each value and taking the weighted average. Then it can be increased to the expected value.

My problems -

  • Is it correct?
  • How to calculate these values ​​without loss of accuracy?

For # 1, I wonder if I understood correctly.

For No. 2, the problem is that I will handle numbers with values ​​such as 1/7 +/- 1e-18, and I fear that floating point errors will kill me for any but the smallest problems. The exact form of the calculation can lead to some significant differences here, and I seem to remember that there are some ASM parameters for some special log cases, but I cannot find documents about it.


In this case, use takes a “good” PRNG for the range [1,n]and generates SRNG for the range [1,m]. The question is, how worse are the results than input?

I have the expected occurrence rates for each output value.

+5
source share
3 answers
+4

, : , .

+1

TestU01 has an even more demanding test suite than Dieharder. The largest test suite is called BigCrush, but it takes a long time to complete, so there are also subsets called Crush and SmallCrush. The idea is to try SmallCrush first, and if the PRNG transmits it, try Crush, and if that passes, BigCrush. If this also passes, it should be good enough.

You can get TestU01 here .

0
source

All Articles