Fair Dice September 14, 2016
My original post was concerned about six sided dice. I have found videos on YouTube showing people floating 20 sided dice in salt water. The light side floats to the top. The pips on dice will change the weight of each face. Casino dice are made so the pips are not a factor.
I have not tried to float any of my dice. My intention here is to show that ordinary dice are suitably random to play games. I think they are. The way the dice are rolled may have a larger bias in their outcomes.
Fair Dice January 9, 2013
I have been fascinated with randomness for a long time. Recently I have seen a lot of talk on the Internet about "Fair Dice" or maybe it should be "Unfair Dice". I will be talking about the standard cube 6 face dice. I don't have any of the other kind of dice but the tests here apply to those too. Dice come in many different geometric shapes today.
There are a lot of people suggesting that regular toy store dice are not fair. The reasons provided are:
The pips are the recessed colored dots. Some faces have more material removed for the pips and that should change the balance.
People complain about dice rolling high or low. They complain that "six" comes up more often. The same for "one". "Six" is opposite "one" on the dice. The "one" side should be heavier than the "six" side.
Some people recommend using "Casino Dice". These dice are made to exacting standards. They have flat faces with no pips. They are translucent so we can see any defects. They are serialized and come in matched sets.
Casino dice are used to play craps. The casinos have rules about how to throw the dice. These rules are designed to prevent cheating. The player must not palm the dice. The dice need to be thrown a good distance and bounce of a wall. The dice are changed often.
Casino dice are designed for a specific purpose. Should we be using casino dice at home?
Testing
Let's do some tests. Chi-Square is a good statistical test to see if our results differ significantly from what we might expect from random chance.
I will be using regular toy store dice, 16mm, 6 sided, square corners. They cost about 20 cents a piece, 5 for a dollar. Casino dice cost about 2 dollars a piece, 5 for 10 dollars.
I wrote a computer program to help me with data collection and testing. I love programming anyway.
I rolled my die 1,404 times.
1,404 100.00% Total Dice Throws
222 15.81% Ones
212 15.10% Twos
226 16.10% Threes
253 18.02% Fours
243 17.31% Fives
248 17.66% Sixes
See! Look at that! Some numbers did show up more often! But is this normal? Shouldn't each number come up 234 (1404/6) times?
Chi-square test results P value and statistical significance:
Chi squared equals 5.684 with 5 degrees of freedom.
The two-tailed P value equals 0.3382
By conventional criteria, this difference is considered to be not Statistically significant.
So this is what we would expect from random chance. In fact, if the Chi-square value is too low, the results become suspect for not being random! "123456123456" is definitely not random (and the Chi-square is 0) but it could occur randomly. So the key to testing for randomness is to do the test multiple times. Some of your tests may fail but that is normal - just as long as it is not too many.
There are Chi-square calculators on the Internet, spreadsheet programs and you can do the calculations by hand and look up the p-values in a table. You should do at least a few hundred rolls to get a good sample. Over a thousand is probably overkill. Multiple tests will give you a good idea about repeatability.
Conclusion
So here we have toy store dice passing the Chi-square test for randomness.
There is no need to use "Casino Dice". Casino Dice are more expensive, don't roll well on home game tables and are prone to chipping due to their sharp corners. Their pips are more likely to wear off because they are not recessed.
I would recommend using regular old inexpensive toy store dice for your games at home. They are perfectly good enough for randomness. Test yours to be sure!
What about round corner dice? This is a personal preference. I don't have any. But now you can test yours!
You can drop dice into a glass of water to see if one side is favored. Chi-square will show any biases. I will test this too later.
What about Dice Towers and other rolling methodologies? More testing!
A note about computer randomness.
I have been programming some different computer random number generators. As we know a computer is deterministic and has a hard time being random. Some random number generators are better than other.
My advice is to stay away from LCG (Linear Congruential Generator) algorithms which come with most programming languages. I recommend Mersenne Twister or ISAAC. Using AES in counter mode is another good algorithm. And watch out for the MOD operator!
The MOD operator computes a remainder for division. It is commonly used to reduce a computer generated random number down to a range, 1-6 for dice, for example. But computer numbers don't divide evenly by 6. 2,4,8,16,32 do divide evenly. The result is that some numbers are more likely than others when using MOD.
As I was testing the 64 bit version of Mersenne Twister, I inadvertently used MOD! My library routines use MOD and other methods and I selected MOD by accident. I generated some test data for my dice testing program. The Chi-square was huge! Way over the value allowed for randomness. I thought there might be a mistake in my implementation but it was just the MOD operator. I fixed it and the 64 bit version of Mersenne Twister worked flawlessly after that.
kb Text Converter is a program available on this site. It generates lots of different random data, dice rolls, coin flips, lottery picks, random text for passwords and lots more! See the Software page for kb Text Converter. kb Text Converter uses ISAAC and does not use the MOD operator!