Gap Test | If alpha and beta are two real numbers with alpha 0 <= alpha <= beta <= 1 count the number of gaps of consecutive subsequences U[j], U[j+1], ...,U[j+r] in which U[j+r] lies between alpha and beta but the other U's do not (this subsequence of r + 1 numbers represents a gap of length r). Then the result conducts a Chi-square goodness-of-fit test. alpha is chosen as 0 and beta is 1/2n (n is chosen as the number of bits for the random number generator - 12 for the test). The function returns a uniform random no. in [0,1]. The test is failed if the value less than 0.001 or larger than 0.999. |