Vi wants to create a board game which requires a way to pick an integer from to with equal probability. She wants it to be a fun and intuitive for the players as well, so she decided that dice would be the way to go. The following is how to choose and number the dice:
However, a brilliant mathematician Aisling informs Vi that, for some integer , it is impossible to number the dice to fit these requirements. So, for , how many such impossible cases are there?
For instance, rolling a 6-sided die and an 8-sided die together numbered gives an equal probability of totaling an integer between to .
In contrast, it is impossible to number any number of dice for .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
I posit that it is possible if and only if N only has prime factors 2 , 3 and 5 .
Firstly, let's prove that if N has prime factors that are not 2 , 3 or 5 , then it is impossible. This is rather easy to prove. For an equal probability of totalling an integer j between 1 to N given a set of numbered dice, the number of rolls that result in j is the same regardless of j . Hence the number of possible rolls A is divisible by N .
A is also equivalent to the product of the number of sides of the dice used. For instance, if an 8-die and a 6-die is used, A = 4 8 . Since the allowed number of sides for the dice only has prime factors 2 , 3 , 5 , A would similarly only have prime factors 2 , 3 , 5 .
Since N is a divisor of A , N would also only have prime factors 2 , 3 , 5 . Hence proved.
Now we need to prove that for every N with prime factors 2 , 3 , 5 , there is a dice numbering that satisfies Vi's requirements. For this we simply construct a solution:
For N = 5 A ⋅ 3 B ⋅ 2 C , the dice numbering can be:
Note that this requires A + B + C dice, which isn't the most optimal construction. But it works.
To show why this works, we can connect this problem to Number Bases .
Firstly, it would be prudent to modify the problem from "pick an integer from 1 to N with equal probability" to "pick an integer from 0 to N − 1 with equal probability". This would simplify the problem as would be seen in the later steps. The approach would be to use N 's representation in certain number bases to find a dice numbering.
It would be simpler to understand the approach (and easier for me to express with clarity) if we considered a simple case of N = 5 2 = 2 5 . We want to find a dice numbering that would pick an integer from 0 to 2 4 with equal probability. We can do so by representing 2 4 in base 5: 2 4 1 0 = 4 4 5 . Now consider a number a b ˉ 5 . We can consider every possible combination of a and b to be any integer between 0 and 4 inclusive, and this would generate an integer from 0 to 4 4 5 exactly once. Converting that to a dice numbering we have
Now to generalise to 5 A ⋅ 3 B ⋅ 2 C , we can modify the argument to consider the expansion as sort of a pseudo-number-base-representation-thing:
5 A ⋅ 3 B ⋅ 2 C − 1 = 4 + 4 ⋅ 5 + 4 ⋅ 5 2 . . . + 4 ⋅ 5 A − 1 + 5 A [ 2 + 2 ⋅ 3 + 2 ⋅ 3 2 . . . + 2 ⋅ 3 B − 1 + 3 B [ 1 + 1 ⋅ 2 + 1 ⋅ 2 2 . . . + 1 ⋅ 2 C − 1 ] ]
Consider the expression:
x 0 + x 1 ⋅ 5 + x 2 ⋅ 5 2 . . . + x A − 1 ⋅ 5 A − 1 + 5 A [ y 0 + y 1 ⋅ 3 + y 2 ⋅ 3 2 . . . + y B − 1 ⋅ 3 B − 1 + 3 B [ z 0 + z 1 ⋅ 2 + z 2 ⋅ 2 2 . . . + z C − 1 ⋅ 2 C − 1 ] ]
If we consider all combinations of x n , 0 ≤ n ≤ A − 1 to be any integer between 0 and 4 inclusive, y n , 0 ≤ n ≤ B − 1 to be any integer between 0 and 2 inclusive and z n , 0 ≤ n ≤ C − 1 to be any integer between 0 and 1 inclusive, we will generate all integers between 0 and N − 1 exactly once.
Now converting the above to a dice numbering we have
However, the above dice numbering would pick an integer from 0 to N − 1 with equal probability, which still doesn't fit Vi's requirements. Luckily, there is a simple fix for that. We just have to add 1 to all the sides of one of the die and we now generate an integer between 1 and N with equal probability. This leaves us with the construction shown above.
We have shown 2 things:
With these 2 proven, we can safely conclude that it is possible if and only if N only has prime factors 2 , 3 and 5 .
From here, it is just a systematic count to get the answer 9 8 2 5 .
I'm aware that this solution is very badly phrased. If you have any questions feel free to ask.