Dice and Coins

Loaded Dice and How to Test a Die for Bias

How to test a die for bias using frequency counts and a simple chi-square calculation, with a worked example and notes on what a result can and cannot show.

On this page
  1. What bias would look like
  2. Step 1: roll and count
  3. Step 2: compare with what you expect
  4. Step 3: the chi-square statistic
  5. Step 4: decide whether 13.3 is large
  6. What the result does and does not say
  7. Other checks
  8. A note on use

What bias would look like

A loaded die is one whose faces do not come up with equal probability. Bias can come from weight placed unevenly inside the die, from uneven edges, or from wear. Most real dice used in games are meant to be fair, and many are checked against tolerances, but small imperfections happen. The question is how to tell a die that is genuinely uneven from one that has simply had a run of unlucky-looking rolls.

The key point: even a perfectly fair die produces uneven counts in a short run of rolls. Roll a fair die 60 times and you do not get exactly ten of each face. The aim of a test is to decide whether the unevenness is bigger than chance usually produces.

Step 1: roll and count

Roll the die a lot of times, recording how often each face appears. The more rolls, the better. A rough rule used in statistics is to aim for an expected count of at least 5 per face, which would mean at least 30 rolls for a six-sided die, but small effects need far more than that. Roll it the same way each time, on a flat surface, with a good spin, and record every roll, not just the ones that seem interesting.

Step 2: compare with what you expect

If the die is fair, each face is expected n/6 times in n rolls. For 120 rolls, that is 20 of each face. Then compare with what you observed.

Here is an illustration with made-up numbers for 120 rolls:

Face 1 2 3 4 5 6
Observed 12 15 18 20 22 33
Expected 20 20 20 20 20 20

The observed counts add to 120, as they should.

Step 3: the chi-square statistic

The chi-square idea turns the gaps into a single number. For each face, take (observed - expected) squared, divide by expected, and add them up.

  • Face 1: (12 - 20)^2 / 20 = 64/20 = 3.2
  • Face 2: (15 - 20)^2 / 20 = 25/20 = 1.25
  • Face 3: (18 - 20)^2 / 20 = 4/20 = 0.2
  • Face 4: 0
  • Face 5: (22 - 20)^2 / 20 = 4/20 = 0.2
  • Face 6: (33 - 20)^2 / 20 = 169/20 = 8.45

The total is 3.2 + 1.25 + 0.2 + 0 + 0.2 + 8.45 = 13.3.

Squaring means a big gap counts for much more than a small one, and dividing by the expected count keeps the scale sensible.

Step 4: decide whether 13.3 is large

With six faces, there are 5 degrees of freedom (once five counts are known, the sixth is fixed by the total). A standard statistics table gives a critical value for 5 degrees of freedom at the 5 percent level of about 11.07. That means that for a truly fair die, a chi-square value above 11.07 would occur in only about 5 percent of experiments.

Our value of 13.3 is above that threshold, so the data are unusual enough to cast doubt on fairness. A sample statistic below the critical value, for example a value around 1 or 2, would be quite ordinary for a fair die.

A contrast case: observed counts of 18, 22, 19, 21, 20, 20 give (4 + 4 + 1 + 1 + 0 + 0)/20 = 0.5. Counts that close to even are well within normal variation.

What the result does and does not say

A value over the threshold is evidence against fairness, not proof. If you test many dice at the 5 percent level, about one in twenty fair dice will be flagged by chance alone. A value under the threshold does not prove the die is fair either. It only says that your data did not show a clear departure. A die with a small bias could easily pass a 120-roll test. Detecting a slight tilt can take thousands of rolls, much like the problem with a slightly uneven coin.

The test also assumes the rolls are independent and made the same way. If the die is tossed gently onto a surface where it barely turns, the result can reflect the technique rather than the die.

Other checks

Some people also do simple physical checks, such as inspecting for sharp or rounded edges, or floating the die in water, which is a rough test for uneven density. These are not reliable for small effects. Computing the chi-square from a spreadsheet is easy: a column of observed counts, a column of expected counts and a formula. If you want to see how a fair die behaves, a Python dice simulation can generate thousands of fair rolls so you can see how large the gaps normally are.

A note on use

This is a way to understand randomness and fairness in games. Using loaded dice to cheat is dishonest and, in many places, illegal. In gambling, even fair dice are paired with payouts that favour the house, so fairness of the dice alone does not make a game profitable. Gambling can cause harm, and local support services can help anyone who is struggling.

The complete guide to dice and coins

Dice Probability Explained: Every Roll from One Die to Many
Read the guide

Keep exploring

Guides from other topics

All topics →