# measuring randomness using runs test [closed]

I try to measure the randomness of data using the runs test (beside the chi square test). I get following values for a file produced by /dev/urandom:

79881944 Bits (total)
39933862 zeroes
39948082 ones
0.546894 variance
39940971 expected
39941409 runs
===================
Runs value: 591.281


I read the value must be between -1,96 and +1,96 to talk about randomness. Can anyone tell me why this is impossible to reach!?

-
 What software are you using to do these calculations? What does it say "variance" means? (I cannot match the value of "variance" to any meaningful part of the runs test calculations.) What does it say "Runs value" means? Incidentally, I compute a Z-statistic of $0.0978$ and a p-value of $0.922$ for these results. – whuber♦ Sep 21 '12 at 15:12 for variance and expected i use these formulas: en.wikipedia.org/wiki/Wald%E2%80%93Wolfowitz_runs_test the "runs value" i define by (runs - expected) / sqrt(variance) your values look good, how did u calculate it? thanks in advance! – tom Sep 21 '12 at 15:18 So did I, Tom. Check your calculations: you should obtain $19970484$ for the variance. – whuber♦ Sep 21 '12 at 15:19 what formular did u user to calculate the variance? my one seems to be wrong – tom Sep 21 '12 at 15:30 The formula you referenced is correct and it's the same as the one I referenced on the (authoritative) NIST page. In R it can be implemented as n1<-39933862; n2<-39948082; n<-n1+n2; mu<-2*n1*n2/n+1; s2<-(mu-1)*(mu-2)/(n-1), giving 19970484.4843298. All you have to do is check your arithmetic, it seems. – whuber♦ Sep 21 '12 at 15:36

## closed as too localized by whuber♦Sep 21 '12 at 17:27

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.