If x
contains a sequence of bits, then x
should be a matrix of \(B\)x\(N\), where \(N\) is the number of words (integers) generated by the RNG of interest. Otherwise, x
is an \(N\)x\(1\) vector of the words. Because bits will be converted to base-10 before application of the test, implementation time will be shorter with integer input.
Optimal value of \(N\), which also represents the length of sample that is composed of B-bit words, is obtained by the optimal length of sample composed of bits (\(n\)) that is given by Ryabko and Monarev (2005) as \(n=B(2^(B/2))\). For example, if \(B=16\), then \(n=4096\) and the legth of alphabet is 65536. In this case, we need to enter 4096 bits or \(N=4096/16=256\) integers. However, under the setting \(B=32\), the length of alphabet is 2^32 and we need to enter 65536. Note that it is hard to implement the test for \(B>32\) due to the memory overflows. Therefore, this test is applicable for smaller values of \(B\).
In this test, because there is no asymptotic theoretical distribution introduced, only chi-square test is applied as goodness-of-fit test.