I have the book "Handbook of applied cryptography". In there we have example for random tests.
I have bits sequence [11100 01100 01000 10100 11101 11100 10010 01001]*4
length on this sequence n = 160. And I need test this sequence in order to understand this sequence is random or not. And problem with understanding this example.
Runs test I understand how they got
$ e_i=\frac{n-i+3}{2^i+2}$
For $k=1 \ \ e_1=\frac{160-1+3}{2^3} \ \ B_1 = 25 \ \ G_1 = 8$
$k=2 \ \ e_1=\frac{160-2+3}{2^4} \ \ B_2 = 4 \ \ G_2 = 20$
$k=3 \ \ e_1=\frac{160-3+3}{2^5} \ \ B_3 = 5 \ \ G_3 = 12$
$k=4 \ \ e_1=\frac{160-4+3}{2^6} \ \ \varnothing $
And the question is how they got B and G?
Autocorrelation test.
In the book they write just (autocorrelation test) If d = 8, then A(8) = 100. The value of the statistic X5 is 3.8933. How they calculate this?