Michael Garcia avatar

Is the Ultimate Dice Roller _Mathematically_ Fair?

thecrazygm

Published: 25 Jul 2025 › Updated: 25 Jul 2025Is the Ultimate Dice Roller _Mathematically_ Fair?

Is the Ultimate Dice Roller _Mathematically_ Fair?

Hey everyone,

The other day, ecoinstant@ecoinstant posed an excellent question about the Ultimate Dice Roller: we know it's provably fair, but is it mathematically fair? In other words, over a large number of rolls, does it produce a statistically even distribution?

I thought that was a great question to dig into. To test it, I added some scripts to the project's GitHub repository to simulate rolling 3d6 thousands of time. A 3d6 roll is common for generating character stats in old-school D&D, and it should produce a nice bell curve distribution of results from 3 to 18.

Test 1: 100 Rolls, As Fast as Possible

First, I had the script roll 100 times as quickly as possible. Because the rolls happen so fast, they all use the same seed data from the same Hive block. The result was, as expected, not very random at all.

fast_rolls_hist.png

Test 2: 100 Rolls, With a Delay

Next, I had the script wait a few seconds between each of the 100 rolls. This pause allows the blockchain to produce new blocks, ensuring that each roll gets a new, unique seed (server seed, client seed, and nonce). The result was a much better, more varied distribution.

slow_rolls_hist.png

Test 3: 5,000 Rolls

Finally, for the ultimate test, I had the script roll the dice 5,000 times. I did this as fast as possible because waiting a few seconds for each roll would have taken over four hours (5,000 rolls x 3 seconds/roll ≈ 4.16 hours). The script rapidly requested rolls, and the server's "salting" mechanism ensured each roll was still unique even if the block data was the same.

The final chart speaks for itself.

large_fast_rolls_hist.png

With a large enough sample size, the dice roller produces a beautiful, statistically fair bell curve, right on the money. So, the answer is yes, the Ultimate Dice Roller is not only provably fair but mathematically fair as well.

If this kind of statistical analysis interests you, feel free to take a look at the scripts directory in the GitHub repo to see how the tests were run and the plots were generated.

As always,
Michael Garcia a.k.a. TheCrazyGM

Leave Is the Ultimate Dice Roller _Mathematically_ Fair? to:

Written by

Solving IT puzzles and crafting Python solutions. When not coding, I'm rolling dice in RPGs, navigating Linux (MCMXCVI), and keeping a keen eye on the Crypto space.

Read more #dev posts


Best Posts From Michael Garcia

We have not curated any of thecrazygm's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Michael Garcia