3D Spheres Test

Test Purpose

The test uses simulation to evaluate the randomness of the triplets of sequential random numbers of uniform distribution. The stable response is the volume of the sphere. The radius of the sphere is equal to the minimal distance between the generated 3D points.

First Level Test

The test generates the vector ui of 12,000 random numbers (i = 0, 1, ..., 11999), which are uniformly distributed in the (0, 1000) interval. The test forms 4,000 triplets of random numbers xk = (u3k, u3k+1, u3k+2)(k = 0, 1, ..., 3999) situated in the cube R = (0, 1000)х(0, 1000)х(0, 1000). Further, the test calculates dmin = d(xk, xl)(l ≠ k), where d(x, y) is the Euclidean distance between x and y. In this case, the volume of the sphere with the dmin radius should have the distribution close to the exponential one with a = 0, b = 40p parameters. Thus, the distribution of the p = 1 - exp(-(dmin)3/30) value should be close to the uniform distribution. The result of the first level test is the p-value.

Second Level Test

The second level test performs the first level test ten times. The p-value pj, j = 1, 2, ..., 10 is the result of each first level test. The test applies the Kolmogorov-Smirnov goodness-of-fit test with Anderson-Darling statistic to the obtained set of pj (j = 1, 2, ..., 10). If the resulting p-value is p < 0.05 or p > 0.95, the test fails.

Final Result Interpretation

The final result is the FAIL percentage for the failed first level tests. The test performs the second level test ten times. The acceptable result is the value of FAIL < 50%.

Tested Generators

Function Name

Application

vsRngUniform

applicable

vdRngUniform

applicable

viRngUniform

not applicable

viRngUniformBits

applicable

Function Name

Application

vsRngUniform

applicable

vdRngUniform

applicable

viRngUniform

not applicable

viRngUniformBits

applicable

Note

The test transforms the integer output into the real output within the interval (0, 1) for the function viRngUniformBits. For detailed information about the normalization of the integer output see the description of the given BRNG.

For more complete information about compiler optimizations, see our Optimization Notice.
Select sticky button color: 
Orange (only for download buttons)