The Math - Part 2, Datasets

The Math - Part 2, Datasets

In our first post, I discussed the math behind the statistical analysis tests that I ran to verify the randomness of both the hardware, and the algorithm that I implemented in firmware. 

I collected data on 100,000 1d20 rolls and then analyzed the data. The quick summary of the tests are as follows:

1. Pearson’s Chi-Squared Test () - The "Fairness" Test

  • What it checks: If we roll a D20 50,000 times, we expect each number to appear roughly 2,500 times. If the number "20" appears 3,000 times, the math will flag it as a biased die.

2. The Wald-Wolfowitz Runs Test - The "Clumping" Test

  • What it checks: Do high numbers clump together? Does the die "get stuck"? This test looks at the sequence of the rolls. If you flip a coin and get H H H H H H T T T T T T, you have 50/50 odds, but it’s not random—it’s sorted. The Runs Test detects that.

3. Shannon Entropy - The "Information" Test

  • What it checks: This measures the information density of the stream. A completely predictable die (always rolls 20) has 0 bits of entropy. A perfect D20 should have bits.

4. The Serial Test (Bigrams) -The "Prediction" Test

  • What it checks: Does a specific number predict the next number? (e.g., "Does a 5 usually follow a 20?"). We analyze all 400 possible pairs of numbers (1-1, 1-2... 20-20) to ensure no patterns exist.

5. The Autocorrelation (lag-1) Test

An additional test I added is the Autocorrelation (lag-1) Test. This additional test checks whether consecutive random numbers in the sequence are statistically independent from each other. The value should be close to 0; ideally between -0.05 and +0.05. This means that knowing one die roll gives you zero predictive power about the next die roll. 

Datasets

I am sharing the data sets that I generate for full transparency. The tests below are from different hardware (Quantum Entropy Engine boxes), and are also from separate PCB batches. I run this test overnight as the entropy pool is cleared after every roll event, and collecting 100,000 1d20 rolls takes 8+ hours. 

Dec 20, 2025 data:

CSV File Link (Click Here)

Chi-Squared Test: χ²=17.24, p-value=0.5734

Runs Test: z=-0.91, p-value=0.3616

Autocorrelation (lag-1): -0.0003

Shannon Entropy: 4.3218 / 4.3219 bits (100.00%)

Serial Test (bigrams): χ²=383.26, p-value=0.7057

 

Dec 28, 2025 data:

CSV File Link (Click Here)

Chi-Squared Test: χ²=7.40, p-value=0.9917

Runs Test: z=0.52, p-value=0.6040

Autocorrelation (lag-1): 0.0019

Shannon Entropy: 4.3219 / 4.3219 bits (100.00%)

Serial Test (bigrams): χ²=384.10, p-value=0.6952