Great, this is an interesting statistical quality control problem based on the minimum of uniform random variables.
Problem summary:
- You do batches of n = 10,000 independent RNG rolls.
- Each roll is uniform in [0,1].
- For each batch, you look at the minimum roll value.
- You want to check that the minimums in the batches are consistent with uniform randomness.
- If the minimums are consistently too high (e.g., minimums ≥ 0.01 repeatedly), that suggests the RNG may be biased or "cheating" (rolling unrealistically high minimums).
- You want a well-defined statistical test (p-value) to quantify this.
Step 1: Distribution of minimum of n i.i.d. Uniform(0,1) RVs
Let ( X_1, X_2, ..., X_n \sim U(0,1) ), i.i.d.
Define the minimum: ( M_n = \min{X_1, ..., X_n} ).
The cumulative distribution function (CDF) of the minimum is:
[
F_{M_n}(x) = P(M_n \leq x) = 1 - P(M_n > x) = 1 - P(X_1 > x, ..., X_n > x)
]
Since samples are independent:
[
P(M_n > x) = P(X_1 > x) \cdots P(X_n > x) = (1 - x)^n
]
So:
[
F_{M_n}(x) = 1 - (1 - x)^n
]
For ( x \in [0,1] ).
Step 2: Expected minimum value
The expected minimum is:
[
E[M_n] = \int_0^1 P(M_n > x) dx = \int_0^1 (1 - x)^n dx = \frac{1}{n+1}
]
So for (n=10,000):
[
E[M_{10,!000}] = \frac{1}{10,001} \approx 0.00009999
]
So the typical minimum is around 0.0001, which is much smaller than 0.01.
Step 3: Interpreting the CDF: p-values for a minimum
Say you observe a minimum roll (m).
- The probability that the minimum (M_n) is less than or equal to (m) is:
[
P(M_n \leq m) = 1 - (1 - m)^n
]
- The probability that the minimum is greater than or equal to (m) is:
[
P(M_n \geq m) = (1 - m)^n
]
If you observe an unusually high minimum, that means you observed:
[
M_n = m \quad\text{large}
]
So the tail probability (right tail for minimum) corresponds to:
[
p\text{-value} = P(M_n \geq m) = (1 - m)^n
]
This p-value tells you how unusual it is to observe minimums at least as high as (m).
Step 4: Applying this to your threshold (m=0.01)
Compute:
[
p = (1 - 0.01)^{10,000} = (0.99)^{10,000}
]
Calculate using logs:
[
\log p = 10,000 \cdot \log(0.99) \approx 10,000 \cdot (-0.01005) = -100.5
]
Therefore:
[
p = e^{-100.5} \approx 3.8 \times 10^{-44}
]
So the probability of observing a minimum at least as high as 0.01 in one batch of 10,000 rolls is astronomically low — basically zero for all practical purposes.
Step 5: Multiple batches and interpreting multiple minimums
Suppose you run (k) batches independently and observe minimums all at or above 0.01.
Each batch has probability (p) of being "≥ 0.01".
The number of batches with minimum ≥ 0.01 is a Binomial((k, p)) random variable.
Because (p) is so small (~(10^{-44})), even getting 1 batch that high is suspicious.
If you want a more reasonable threshold, pick a higher (m) with, say, p-value = 0.05 (5%).
Solve for (m):
[
p = (1 - m)^n = 0.05
]
[
\Rightarrow \log (1 - m) = \frac{\log 0.05}{n}
]
[
\Rightarrow 1 - m = e^{\log 0.05 / n}
]
[
m = 1 - e^{\log 0.05 / n}
]
For (n=10,000),
[
\log 0.05 \approx -2.9957
]
[
\Rightarrow 1 - m = e^{-2.9957/10,000} = e^{-0.00029957} \approx 1 - 0.00029957
]
[
m \approx 0.00029957
]
So the 5% quantile of the minimum is about 0.0003.
Interpretation: In 5% of your batches, you'd see minimums greater than ~0.0003. So if you see minimums regularly above 0.01, that is far more extreme than expected.
Step 6: Setting a p-value threshold
- Choose a significance level (\alpha) (e.g., 0.05 or 0.01) for one batch.
- Find the critical minimum value (m_c) satisfying:
[
P(M_n \geq m_c) = (1 - m_c)^n = \alpha
]
- If minimum observed (m \geq m_c), you would flag this batch as suspicious at level (\alpha).
Step 7: Assessing many batches
If you test many batches, say (k) batches:
- Probability of seeing (r) or more suspicious batches (minimum ≥ (m_c)) is:
[
P(X \geq r) \quad \text{where } X \sim \text{Binomial}(k, \alpha)
]
You can use this to control false detection rates.
Summary / How to implement your test:
- For each batch of (n=10,000) rolls, compute minimum (m).
- Compute the one-tailed p-value:
[
p = (1 - m)^n
]
-
Choose a significance level, e.g., (\alpha = 0.05) or (0.01).
-
Flag batch if (p < \alpha), i.e., if
[
m \geq 1 - \alpha^{1/n}
]
Because (\alpha^{1/n} \approx 1 - \frac{\log\alpha}{n}) for small (\log \alpha / n).
- Track how many batches are suspicious over time and calculate the binomial p-value for observing that many or more.
Example calculation:
- (n=10,000)
- (\alpha=0.01)
- Critical minimum (m_c):
[
m_c = 1 - (0.01)^{1/10,000}
]
Use expansion:
[
(0.01)^{1/10000} = e^{\frac{\log 0.01}{10000}} = e^{-4.6052/10000} = e^{-0.0004605} \approx 1 - 0.0004605
]
So
[
m_c \approx 1 - (1 - 0.0004605) = 0.0004605
]
So if your minimum in a batch of 10,000 rolls is above about 0.00046, then you would get (p < 0.01) for the minimum being that large.
Similarly, a threshold of 0.01 is way too high to ever expect from an honest RNG minimum in a batch of 10,000 rolls.
Final notes
- In practice, minimum rolls should be very very small, close to (1/(n+1)).
- Seeing minimums ≥ 0.01 in multiple batches should be a red flag.
- If you want to be less confident (higher (\alpha)), calculate (m_c) accordingly.
- Keep in mind false positives increase with many tests; use multiple hypothesis correction if needed.
If you want me to provide code or formula snippets for implementing this testing, just ask!