This is often the first idea on how to generate random numbers. Unfortunately, we quickly see a bias:
Second throw | ||||||
---|---|---|---|---|---|---|
First throw | 1 | 2 | 3 | 4 | 5 | 6 |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
More accurately, we obtain the following distribution:
Sum | Relative Frequency |
---|---|
2 | 1 |
3 | 2 |
4 | 3 |
5 | 4 |
6 | 5 |
7 | 6 |
8 | 5 |
9 | 4 |
10 | 3 |
11 | 2 |
12 | 1 |
This means that the value 7 is six times more likely to appear than the value 2. That is not a uniform distribution.
That does seem a bit fairer. However, the die probably only has sides with at least 1 and at most 6 dots, which means the digits 0, 7, 8 and 9 will never occur.
It takes the juxtaposition/concatenation idea and modifies it to make sure that there are no “impossible digits”.
A juxtaposition/concatenation of a digit to the end a number is the same as:
Why the number 10? The reason is that we have ten different options that a digit can be (0, 1, 2, 3, 4, 5, 6, 7, 8, and 9), so to ensure that the new digit is independent of all the digits in the previous number, we must “make space” for the new digit by multiplying the previous number by the number of options that the new digit can have.
And that’s the whole trick, really. Since a six-sided die only has six options, we don’t multiply by ten before adding the next roll, but just by six. We also have to map the die dots (1 dot to 6 dots) to the digit range of 0 to 5, since 6 is technically already the next “rank”. (If this feels puzzling, consider a ten-sided die with 1 to 10 dots – 10 is obviously a special number of dots unlike the others because it has two digits.)
So all that happens is: