Skip to content
LAB
← All tools

Kolmogorov-Smirnov Test

A hunch proves nothing. If you suspect an operator of rigging outcomes, you need a statistical argument that holds up under scrutiny. The Kolmogorov-Smirnov (K-S) Test is the standard instrument for this job: it audits casino random number generators for RNG audits by testing whether a float stream is genuinely uniform across [0,1], in line with our expected volatility models.

Kolmogorov-Smirnov Test (vs uniform [0,1])

Paste floats in [0,1] — e.g. dice rolls divided by 100. Tool tests whether the empirical distribution matches uniform.

Sample size
D statistic
p-value
Critical value

Why K-S handles continuous data better than binned tests

Mathematical Audit Benchmark

How Does This Compare to 0% House Edge Protocols?

Audited 100% RTP

Instead of standard 1.00% to 4.00% casino house margins, compare with mathematically verified 100% RTP Originals (0.00% House Edge) on Duel Casino:

Duel 100% RTP Dice
100% RTP Dice: Exact 1:1 mathematical return (0.00% edge).
Duel VIP Rakeback
Instant VIP Rakeback: 0x wagering requirements with code Vip.

Kolmogorov-Smirnov Continuous Uniformity Test
KS Statistic D: Quantifying maximum distance between empirical CDF and theoretical uniform [0, 1) distribution.

Pull floats from a crypto casino and you’ll see values like 0.485293 and 0.129481 — decimals produced by HMAC-SHA256 seed chains. A lazy audit stops at the mean: if the average lands near 0.50, the game gets a pass. That reasoning has a hole in it. A generator that emits only 0.10 and 0.90 also averages 0.50, and it is catastrophically broken.

The fix is to test the shape of the whole distribution, not one summary number. The Kolmogorov-Smirnov test is non-parametric and works on continuous data directly: it compares the cumulative distribution of your sample against a theoretical uniform CDF. No bins, no grouping decisions — and therefore nowhere for a subtle bias to hide.

Non-Parametric Sensitivity: Chi-square tests force you to group continuous floats into discrete bins (like 0.0-0.1, 0.1-0.2, etc.). The K-S test does not bin data; it analyzes every single float at its exact coordinate, making it impossible for developers to hide clusters of favorable or unfavorable numbers.

The math: Calculating the D statistic and p-value

The test overlays two cumulative curves — your sample’s and the theoretical uniform’s — then finds the widest gap between them:

1. The Empirical CDF (F_n(x))

Sort the $N$ floats in your sample from smallest to largest. The empirical step function ($F_n(x)$) then climbs by $1/N$ at every data point:

F_n(x) = (Number of elements in sample ≤ x) / N

2. The Kolmogorov D Statistic

Next, measure the absolute vertical distance between that step function and the theoretical uniform line ($F_0(x) = x$ on the interval $[0,1]$). The largest such distance anywhere along the axis is the test statistic $D$:

D = supremum | F_n(x) - x |

3. Calculating the p-value

A large $D$ alone doesn’t tell you how unlikely it is. The tool converts it using a Marsaglia-Tsang series calculation, which yields the p-value:

  • p-value < 0.05: Highly anomalous. The probability of a fair RNG generating this distribution by chance is under 5%. The casino’s RNG is statistically proven to be biased.
  • p-value > 0.95: Too perfect to be true. This suggests the data has been artificially smoothed or manipulated to look fair, which is a common indicator of fraud in manufactured audits.

Step-by-step audit: Auditing 1,000 floats

Say your session history gives you 1,000 round floats. Here is the working procedure:

  1. Copy the raw list of continuous decimal floats (one per line).
  2. Paste the values into the auditor input box.
  3. Click “Verify.” The tool will sort the floats, calculate the step function, and compute the $D$ statistic.
  4. Read the p-value verdict: a fair, unmanipulated RNG will output a uniform p-value that typically falls between 0.10 and 0.90.

Frequently asked questions

What does a p-value of 0.0001 mean?

Only 1 in 10,000 fair random number generators would emit a float distribution shaped like the one you pasted. That is decisive evidence the casino’s RNG is biased, skewed, or actively manipulating outcomes.

Why is K-S superior to the Chi-Square test?

Chi-square results hinge on binning choices. Pick careless bins and anomalies get averaged away. The K-S test is continuous and coordinate-independent, giving you an exact, objective measure of uniformity that bin sizing cannot influence.

How many floats are required for an accurate K-S audit?

The test runs on small samples, but plan on at least 100 floats to catch moderate bias. For high-precision audits of professional casino seeds, 1,000 to 10,000 floats is the target range for statistical confidence.