## randomizeBE - randomness control [R for BE/BA]

Dear Helmut, dear All,

meanwhile I have tried to implement the exact runs distribution.
If I had not made a a big mistake the results are as following for the above presented 'alternating' lists:
(Also a little bug corrected if value==median)
                         asymptotic asymptotic    exact     list                   normal    normal cc.  runs distri.  1 2 3 1 2 3 1 2 3 1 2 3   0.2502     0.4209      0.4242  1 3 2 1 3 2 1 3 2 1 3 2   0.2502     0.4209      0.4242  2 1 3 2 1 3 2 1 3 2 1 3   0.0658     0.1350      0.1414  2 3 1 2 3 1 2 3 1 2 3 1   0.2502     0.4209      0.4242  3 1 2 3 1 2 3 1 2 3 1 2   0.0658     0.1350      0.1414  3 2 1 3 2 1 3 2 1 3 2 1   0.2502     0.4209      0.4242
cc. denotes a continuity correction to the asymptotic normal distributed statistic like SPSS uses.

For these lists it had to be concluded that the use of the exact distribution worsens the situation. It is more unlikely that the Null "list is a random sequence" is rejected. The use of cc. approximates the exact distribution well but also leads to a conservative test.

The fact that the randomness control doesn't work in all cases seems known.
Just to cite from:
Ying Wang
ECE 461 PROJECT REPORT, MAY 2003
"Nonparametric Tests for Randomness"
online resource

"... From the above analysis, most of the tests are vulnerable to a certain set of sequences, which are deterministic but accepted as random processes."

Regards,

Detlew