Back to top

A dice computed from a fixed number of random bits cannot be fair

Suppose you want to make a digital dice. This is simply a program that returns one of the numbers {1},{2},{3},{4},{5},{6} in a completely random way. By the way you have implemented your program it satisfies the following properties:
  1. Your program always uses a finite amount of time (it does not get stuck)
  2. Your program uses {N} random bits from a random source
  3. Given the same {N} bits as input, your program returns the same number (so your program does not use other sources of randomness)
These requirements seem reasonable, right? However, I will prove that your dice is unfair: the six numbers do not all have an equal chance to be returned by your program.

To see this, consider that the program can only use a finite number of random bits (if it would use an infinite amount, it wouldn't satsify property (1)). Let the maximum number of random bits the program will need for any execution be {N} . Thanks to property (2) and (3) we can now consider the program to be a mathematical function {\mathcal{{{F}}}}:{\left\lbrace{0},{1}\right\rbrace}^{{n}}\rightarrow{\left\lbrace{1},{2},{3},{4},{5},{6}\right\rbrace} mapping {N} random bits to a number on the dice.

We can now be more exact about what it means for {\mathcal{{{F}}}} to be fair: all the numbers on the dice need to appear as a result of {\mathcal{{{F}}}} an equal number of times.

To be more specific, every number needs to be mapped by {\frac{{{2}^{{n}}}}{{{6}}}} different input bit strings. But {\frac{{{2}^{{n}}}}{{{6}}}}={\frac{{{2}^{{{n}-{1}}}}}{{{3}}}} is not an integer number, so cannot be the result of counting how many times a given number on the dice appears as a result of your program. So the digital dice cannot be fair.