11.07.2015 Views

A Random Number Generator Test Suite for the C++ ... - ETH Zürich

A Random Number Generator Test Suite for the C++ ... - ETH Zürich

A Random Number Generator Test Suite for the C++ ... - ETH Zürich

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5. <strong>Test</strong>s <strong>for</strong> Studying <strong>Random</strong> DataIn this section we present different tests to study <strong>the</strong> behavior of random number generators.We can distinguish two different sorts of tests, statistical tests and physical test 1 .The only difference is <strong>the</strong> motivation to do <strong>the</strong> test. In <strong>the</strong> first case, we want to know <strong>the</strong>behavior of some statistical properties, in <strong>the</strong> second case, we simulate a physical system.(Strictly speaking <strong>the</strong>re are some more tests like “visual tests” or “<strong>the</strong>oretical test”. But wedo not look at <strong>the</strong>m because of lack of automatism). Each of <strong>the</strong>se tests checks a specialproperty of <strong>the</strong> generated numbers against <strong>the</strong> <strong>the</strong>oretically expected behavior. These testsare not my invention, I only collected <strong>the</strong>m and add examples of usage to it. A reference to<strong>the</strong> source (not source code) is mentioned with each test.Table 5.1 lists many known random number generator tests and its occurrence in oftencited test-benches. It is impossible to list all tests, <strong>the</strong>re are an infinite number of <strong>the</strong>m, sowe mention <strong>the</strong> most popular ones.A more interesting table <strong>for</strong> testers is table 5.2. It shows all available 2 tests in <strong>the</strong> test suiteand <strong>the</strong>ir class names. (The name of <strong>the</strong> header file is <strong>the</strong> concatenation of class name and.h).5.1. Equidistribution testIn this test we check if <strong>the</strong> generated numbers are equally distributed. See [16].The N measured random values in <strong>the</strong> interval ¢ α;β£ must be divided in k classesI 1 I 2 ¢¡¢¡¢¡£k . The classes contains N N 1¤N ¡¢¡¢¡¤ 2¤k¥values.For each class, <strong>the</strong> expected number is calculated with <strong>the</strong> assumption that all valuesappear with <strong>the</strong> same probability k Np¥INCheck <strong>the</strong> probability with <strong>the</strong> χ 2 test <strong>for</strong> <strong>the</strong> classes and use <strong>the</strong> KS test to check <strong>the</strong>whole data.α¨ §β1 A nice description of physical tests is given in [29]Passing several tests does not prove <strong>the</strong> randomness of any sequence, however. This is dueto <strong>the</strong> fact that proving randomness requires that <strong>the</strong> sequence fulfils an actual definition <strong>for</strong>randomness. An un<strong>for</strong>tunate fact is, however, that <strong>the</strong>re is no unique definition <strong>for</strong> randomness.[...] There<strong>for</strong>e, passing many tests is never a sufficient condition <strong>for</strong> <strong>the</strong> use of any pseudo randomnumber generator in all applications. In o<strong>the</strong>r words, in addition to standard tests, efficientapplication specific tests of randomness are also needed. This need is emphasized by recentsimulations, in which some physical models combined with special algorithms have been foundwhich are very sensitive to <strong>the</strong> quality of random numbers.2 I hope that by <strong>the</strong> time this paper is published <strong>the</strong> list will already be updated with fur<strong>the</strong>r implementations18

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!