To prove an operator is cheating, you need more than a hunch. The Kolmogorov-Smirnov (K-S) Test is the mathematical gold standard to audit casino random number generators for RNG audits, verifying if their float streams are distributed perfectly uniformly, checking against our expected volatility models between 0 and 1.
When you audit a crypto casino, you get a stream of decimal floats (such as 0.485293, 0.129481, etc.) generated by their HMAC-SHA256 seeds. A basic audit might average these numbers and find that they equal roughly 0.50, concluding that the game is fair. This is a severe statistical oversight. An RNG could output exclusively 0.10 and 0.90, averaging 0.50, while being completely broken.
To verify true fairness, you must check the **uniformity** of the entire distribution. The Kolmogorov-Smirnov test is a non-parametric, continuous test that compares the cumulative distribution of your sample against a theoretical uniform distribution. Because it requires no binning, it is highly sensitive to subtle, hidden biases that other tests miss.
The K-S test operates by plotting the Cumulative Distribution Function (CDF) of your sample against the uniform CDF and locating the maximum deviation:
First, the $N$ floats in your sample are sorted in ascending order. The empirical step function ($F_n(x)$) increases by $1/N$ at each data point:
F_n(x) = (Number of elements in sample ≤ x) / N
We calculate the absolute vertical distance between your sample’s step function and the theoretical uniform line ($F_0(x) = x$ on the interval $[0,1]$). The test statistic $D$ is the supremum (maximum) of these differences:
D = supremum | F_n(x) - x |
To evaluate if $D$ is statistically anomalous, the tool runs a Marsaglia-Tsang series calculation to compute the p-value:
Suppose you have extracted 1,000 round floats from your session history:
It means there is only a 1 in 10,000 chance that a perfectly fair random number generator would produce the distribution of floats you pasted. This is overwhelming statistical evidence that the casino’s RNG is biased, skewed, or actively manipulating outcomes.
The Chi-Square test is highly dependent on how you choose to bin your data. If you bin poorly, you can easily smooth over anomalies. The K-S test is continuous and coordinate-independent, providing an exact, objective measure of uniformity that cannot be manipulated by bin sizing.
While the test can run on small samples, we recommend a minimum of 100 floats to detect moderate bias. For high-precision audits of professional casino seeds, a sample size of 1,000 to 10,000 floats is ideal to ensure statistical confidence.