# How do you interpret the p-values from the Dieharder testsuite to evaluate an RNG?

#=============================================================================#
#            dieharder version 3.31.1 Copyright 2003 Robert G. Brown          #
#=============================================================================#
rng_name    |rands/second|   Seed   |
stdin_input_raw|  3.91e+06  |3556676169|
#=============================================================================#
test_name   |ntup| tsamples |psamples|  p-value |Assessment
#=============================================================================#
diehard_birthdays|   0|       100|    1000|0.04228375|  PASSED
diehard_operm5|   0|   1000000|    1000|0.19715383|  PASSED
diehard_rank_32x32|   0|     40000|    1000|0.46351097|  PASSED
diehard_rank_6x8|   0|    100000|    1000|0.95836167|  PASSED
diehard_bitstream|   0|   2097152|    1000|0.48181370|  PASSED
diehard_opso|   0|   2097152|    1000|0.30244550|  PASSED
diehard_oqso|   0|   2097152|    1000|0.94656094|  PASSED
diehard_dna|   0|   2097152|    1000|0.02404047|  PASSED
diehard_count_1s_str|   0|    256000|    1000|0.45401565|  PASSED
diehard_count_1s_byt|   0|    256000|    1000|0.48456168|  PASSED


Feeding a stream of random numbers to the Dieharder testsuite invokes a list of tests. Each test returns a p-value. As I understand it, the p-value tells you the chance that the stream really is just random noise (or not noise). But I've read that a good RNG will have a range of p-values that follows a uniform distribution; values between 0 and 1 should happen with about equal probability. Why should that be so? Why is a uniform distribution desirable here, what does it mean, and how can you measure the "uniformity" of a distribution?

• The question is: Is this about cryptography? If it's just about the statistical test, this should be on a math board... For cryptography, these statistical tests are quite pointless.
– tylo
Sep 30, 2014 at 15:36
• I was more interested in learning how to interpret statistics in this specific context of RNGs than the statistics themselves Sep 30, 2014 at 16:24
• Although cryptography has a lot of statistics (the subfield of mathematics) in certain areas, you might get better suited answers over at math SE
– tylo
Oct 1, 2014 at 12:51
• Here's a pretty simple and good explanation about interpreting the results of DIEHARD(er): reddit.com/r/crypto/comments/2d4m1v/… Jun 21, 2016 at 15:10

So you expect a p-value $\le 0.05$ 5% of the time. You expect a p-value $\le 0.10$ 10% of the time. Thus, you expect a p-value in the interval $[0.05, 0.10]$ 5% of the time. Similarly for any other intervals between zero and one.