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.

0¡1111 0¡672;0¡449£5. <strong>Test</strong>s <strong>for</strong> Studying <strong>Random</strong> DataA correlation coefficient between always and¤lies 1 1. When it is zero or very small, itindicates that X i and X j are independent of each o<strong>the</strong>r. A “good” value of C will be betweenµ N and µ N which means 95%, whereN¤ Nµ N¥11σ1 N N¥ N 2 (5.6)2σGenerate a sequence of N random numbers X 0 X 1 ¢¡¢¡¢¡N £ 12σ1 13¨ N¤Calculate <strong>the</strong> “serial correlation coefficient” C with <strong>for</strong>mula (5.5)N§N NCalculate <strong>the</strong> mean and <strong>the</strong> standard deviation and check if C lies between <strong>the</strong> two σlimit (µ N¡ 2σ N ) which denotes <strong>the</strong> 95% limitXExample:Lets take <strong>the</strong> same sequence of ten random number as in section 3.2 {0.809, 0.465, 0.151,0.628, 0.318, 0.824, 0.394, 0.968, 0.179, 0.458}.We have to calculate C as shown in equation (5.5)10 0¡465¤§0¡809 0¡465 0¡151¡¢¡¢¡¨20¡465¤10 §0¡809 0¡465 2¤ 2¤ 2¡¢¡¢¡¨ §0¡809¤0¡465¤ 0¡5153760¡151¡¢¡¢¡¨2 §0¡809¤To check if <strong>the</strong> calculated C coefficient lies between <strong>the</strong> 2σ bounds. Use <strong>the</strong> <strong>for</strong>mulasgiven in (5.6) 0¡151¡¢¡£¡¨ C¥¥11 70µ 10¥ σ 10¥9 11¥ 0¡28039We see that <strong>the</strong> valid interval <strong>for</strong> this test is . The calculated coefficientC lies between <strong>the</strong>se bounds. (The interval is so large because we only tested tennumbers)¢ ¥Constructor in serial_correlation_test.hserial_correlation_test(uint64_t n)n number of random numbers to calculate correlation <strong>for</strong>5.11. Serial testThis test checks if not only particular numbers are uni<strong>for</strong>mly distributed but also two, three ord-dimensional points. To make this test, count <strong>the</strong> number of times <strong>the</strong> tuple§X di X di¡ 1 di¡ ¢ d£ 1£¨ ¢¡¢¡¢¡£X<strong>the</strong> test is <strong>the</strong> same as <strong>the</strong> “Equidis-occurs, <strong>for</strong> 0 i n and <strong>the</strong> dimension d 0. If 1tribution test”. The tuples should be χ 2 distributed.d¥ ¡Generate n d-tuples§X di X di¡ 1 X ¢¡¢¡¢¡di¡ ¢ d£ 1£¨, where d0 and 0 X j¡k34

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

Saved successfully!

Ooh no, something went wrong!