Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm in process of learning 'gap test' for random numbers in discrete event system simulation. I happened to have the fourth edition of this book by Jerry Banks. Unfortunately , this edition doesn't have any info about this test. I'm trying to learn more of it from the net but details are very scarce. So, can anyone please explain me this test in detail.

share|cite|improve this question
Do you have access to the book by Knuth - The Art of Computer Programming. Vol. 2: Seminumerical Algorithms that is referenced here TestU01? Regards – Amzoti Jan 4 '13 at 16:32
im sry .. I dont have access to this book. – Antony Ajay Jan 4 '13 at 16:43
Is the description in the TestU01 paper sufficient? – Amzoti Jan 4 '13 at 16:48
no... its very scarce... I need an example to understand better. – Antony Ajay Jan 4 '13 at 16:59
up vote 2 down vote accepted

Try section 5.3 Gap Test, which contains a worked example, and also Section 3. for an alternate description.

I would still recommend getting your hands on Knuth - The Art of Computer Programming. Vol. 2: Seminumerical Algorithms.

Also, I would recommend looking into DIEHARDERs and TestU01s implementations of these tests since both provide actual working code (and there are certainly other variants out there, but those two are heavily used).


share|cite|improve this answer
Thanks for your help... I'll get my hands on the book by Knuth. The example given in the first link isn't so clear. After going through explanation from the UMinessota's notes it's a bit clearer. Thanks for the links to the working codes. – Antony Ajay Jan 5 '13 at 3:03
Nice answer, nice feedback, ++ $\land \checkmark$ – amWhy May 9 '13 at 1:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.