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> DataTo per<strong>for</strong>m a χ 2 -test, with 1 degrees of freedom, we have to know <strong>the</strong>expected probabilities <strong>for</strong> each length. This are calculated by <strong>the</strong> following <strong>for</strong>mulas:d¤ t k¥p r ¥d!dr r1d r ¡ t (5.3)p t ¥d!d t £ 11d 1¡<strong>for</strong>1d ¡ t(5.4)Once more <strong>the</strong> termrd¡ denotes <strong>the</strong> Stirling number of second kind.Example: Throwing a dieWe use <strong>the</strong> same data as in 5.4. We have integers from 1 to 5 and we define 13We first split up <strong>the</strong> sequence into “complete sets” and count <strong>the</strong> lengtht¥5¡¢¡¢¡complete setlength5 2 4 4 5 1 2 4 2 3 103 4 2 3 5 5 4 4 1 94 1 2 1 5 1 3 71 1 5 2 3 5 4 72 4 3 3 5 2 4 3 4 3 5 2 2 5 5 1 165 3 1 1 4 5 2 71 1 3 1 2 5 5 5 2 3 2 4 123 4 3 1 3 5 5 4 2 94 4 2 4 1 3 5 75 2 2 5 2 4 5 3 4 5 3 5 2 5 4 16We can calculate <strong>the</strong> expected length of sequences with equation (5.3), (5.4) and compareto <strong>the</strong> measured length.r p r # expected # counted245625=0.0384 0.38 0486625=0.0768 0.77 031273125=0.0998 1.00 433683125=0.1075 1.08 0408249390625=0.1045 1.05 2=0.0955 0.95 1=0.0838 0.84 0=0.0716 0.72 1=0.3220 3.22 210372963906251116370419531251227984390625>136289011953125Constructor in coupon_collector_test.hcoupon_collector_test(uint64_t n,std::size_t different_coupons,std::size_t maxSeq)28

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

Saved successfully!

Ooh no, something went wrong!