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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

n £ 1¨5. <strong>Test</strong>s <strong>for</strong> Studying <strong>Random</strong> Data5.7. Maximum of t testThe sequence of numbers is divided into n groups of t elements each, denoted as <strong>the</strong> vector§X it X it¡ ¢ t£ 1 it¡ <strong>for</strong> 0 i n. Then determine <strong>the</strong> maximum of each group. Thedistribution of <strong>the</strong> maxima should follow x t . This test is described in [16].¡ 1£¨ ¢¡¢¡¢¡£Divide <strong>the</strong> input sequence into n groups of t elements each, denoted by V<strong>for</strong> 0 i n.¡ i¥§X it X it¡ 1 X it¡ ¢ t£ 1£¨ ¢¡¢¡¢¡£XGenerate a new sequence max§V max§V 0¨max§V ¢¡¢¡¢¡ 1¨We apply <strong>the</strong> Kolmogorov-Smirnov test to <strong>the</strong> sequence of maxima with <strong>the</strong> distributionfunction t ,§0 x 1¨.F§x¨xWe make k equidistant bins between ¢ 0;1£ . To get <strong>the</strong> expected number of values ineach bin we have to subtract <strong>the</strong> probability <strong>for</strong> <strong>the</strong> lower bin from <strong>the</strong> probability <strong>for</strong><strong>the</strong> actual bin.¥We see that <strong>the</strong> percentage in bin 1¡¡k k¡i£ i 1is ¡tk . To get <strong>the</strong> expected valueswe multiply <strong>the</strong> value per bin with <strong>the</strong> number of groups n.t i¥Example:We have 50 random floating point numbers in 0;1¨. This numbers are alreadygrouped in sequences of elements, <strong>the</strong> maxima per group are printed bold.t¥ ¢ n¥5seq.random numbers1 0.911647 0.79844 0.783099 0.394383 0.8401882 0.55397 0.277775 0.76823 0.335223 0.1975513 0.95223 0.513401 0.364784 0.628871 0.4773974 0.606969 0.141603 0.717297 0.635712 0.9161955 0.156679 0.804177 0.137232 0.242887 0.01630066 0.218257 0.998925 0.108809 0.12979 0.4009447 0.637552 0.296032 0.61264 0.839112 0.5129328 0.771358 0.292517 0.972775 0.493583 0.5242879 0.283315 0.891529 0.400229 0.769914 0.52674510 0.949327 0.0697553 0.919026 0.807725 0.352458If we make a binning of <strong>the</strong> interval ¢ 0;1¨ into 10 subintervals we should know, howmany values we expect <strong>for</strong> each bin.30

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

Saved successfully!

Ooh no, something went wrong!