Quality Control PRNG

I play with PRNG (like Mersenne Twister and the rand()stdlib function) and I would like to get a good test that will help me determine the quality of the random data generated by PRNG. I calculated the Pi value using the random numbers generated by PRNG, and I believe that rand()Mersenne Twister is very close to suggesting a difference (do I need to check after ten decimal points?).

I don't have a big idea about Monte Carlo simulations; let me know about any algorithm / application (maybe something simple, but that can give good conclusions), which will help me distinguish them in quality.


EDIT 1: I haven’t noticed this before, but there is a similar thread: How to check random numbers?

EDIT 2: I cannot interpret the NIST results as indicated in one of the comments. I got this idea of ​​visual interpretation of the template (if any) from random.org and follow this because of its simplicity. I would be very happy if anyone could comment on my testing process:

  • Generate N random ones from [0,1] using rand () and MT1997
  • if (round(genrand_real1() / rand_0_1())), then red pixel, still black

As I understand it, this is not a very accurate solution, but if it gives a reasonable estimate, then I could live with it at the moment.

+5
source share
3 answers

There are two standard test suites for testing random numbers.

R Dieharder, RDieHarder. NIST Diehard.

+5

. , 120 PRNG , 4 PRNG :

PRNG, ?

  • PractRand (, 1 ) 22 .
  • RaBiGeTe (, 512 , x1) 5 , LCG LCG.
  • TestU01 BigCrush 2 , PRNG.
    - .

, PractRand, TestU01 , , RaBiGeTe.

: PractRand, PRNG, .

:

  • PractRand TestU01 , .
  • PractRand Dieharder, , , .
  • PractRand RaBiGeTe , .

:

  • PractRand , , - , RNG .
  • RaBiGeTe NIST STS .
  • Dieharder NIST STS .
  • NIST STS , .
  • Dieharder Windows. TestU01 , .
  • RaBiGeTe .

PRNG: PRNG 1 GFSR, 1 LFSR, 4 PRSG xorshift, 2 PRNG xorwow, 3 --LFSR PRNG. 10 LCG 2- ( ), 10 LC- 2, 9 , LCG -LCG, 19 CSPRNG, CSPRNG. 14 / s- (, RC4, ISAAC), ChaCha/Salsa, 2 Trivium. 11 PRNG, LFib- , LFSRs/GFSR. ( 35) PRNG, 10 , .

: gjrand, , .

, PRNG PRNG PractRand.

+6

It’s best to watch in volume 2 of the Knuth series .

For a shorter reading, find the appropriate chapter, "Numerical Recipes."

If you are interested in some kind of baseline for MC modeling, it is best to avoid linear congruent generators, Mersenne Twister is good enough in the vast majority of cases.

+1
source

All Articles