Dice Dicey Dice Dice

Vi wants to create a board game which requires a way to pick an integer from 1 1 to N N 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:

  1. Use only the five Platonic solids with 4, 6, 8, 12, or 20 faces each to guarantee fairness.
  2. Number their faces with (not necessarily distinct) non-negative integers such that the total of the dice in each throw would have an equal probability of being an integer from 1 1 to N . N.

However, a brilliant mathematician Aisling informs Vi that, for some integer N N , it is impossible to number the dice to fit these requirements. So, for 1 N 10000 1\le N \le 10000 , how many such impossible cases are there?


For instance, rolling a 6-sided die and an 8-sided die together numbered D 6 = 1 , 2 , 17 , 18 , 33 , 34 D 8 = 0 , 2 , 4 , 6 , 8 , 10 , 12 , 14 \begin{aligned} D_6&={1,2, 17, 18, 33, 34} \\ D_8 &= 0, 2, 4, 6, 8, 10, 12, 14 \end{aligned} gives an equal probability of totaling an integer between 1 1 to N = 48 N=48 .

In contrast, it is impossible to number any number of dice for N = 7 N=7 .

Inspiration


The answer is 9825.

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.

1 solution

Julian Poon
Jun 4, 2017

I posit that it is possible if and only if N N only has prime factors 2 2 , 3 3 and 5 5 .


Firstly, let's prove that if N N has prime factors that are not 2 2 , 3 3 or 5 5 , then it is impossible. This is rather easy to prove. For an equal probability of totalling an integer j j between 1 1 to N N given a set of numbered dice, the number of rolls that result in j j is the same regardless of j j . Hence the number of possible rolls A A is divisible by N N .

A 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 = 48 A=48 . Since the allowed number of sides for the dice only has prime factors 2 , 3 , 5 2,3,5 , A A would similarly only have prime factors 2 , 3 , 5 2,3,5 .

Since N N is a divisor of A A , N N would also only have prime factors 2 , 3 , 5 2,3,5 . Hence proved.


Now we need to prove that for every N N with prime factors 2 , 3 , 5 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 N=5^A \cdot 3^B \cdot 2^C , the dice numbering can be:

  • A A 20-sided dice numbered { 0 , 5 n , 2 5 n , 3 5 n , 4 5 n } \left\{ 0, 5^n, 2 \cdot 5^n, 3 \cdot 5^n, 4 \cdot 5^n \right\} , each element repeated 4 times to fill up all 20 sides, for 0 n A 1 0 \le n \le A-1
  • B B 6-sided dice numbered { 0 , 3 n 5 A , 2 3 n 5 A } \left\{ 0, 3^n 5^A, 2 \cdot 3^n 5^A \right\} , each element repeated 2 times to fill up all 6 sides, 0 n B 1 0 \le n \le B-1
  • C 1 C-1 4-sided dice numbered { 0 , 2 n 3 B 5 A } \left\{ 0, 2^n 3^B 5^A \right\} , each element repeated 2 times to fill up all 4 sides, 1 n C 1 1 \le n \le C-1
  • One 4-sided die numbered { 1 , 3 B 5 A + 1 } \left\{ 1, 3^B 5^A + 1 \right\} , each element repeated 2 times to fill up all 4 sides

Note that this requires A + B + C 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 1 to N N with equal probability" to "pick an integer from 0 0 to N 1 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 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 = 25 N=5^2=25 . We want to find a dice numbering that would pick an integer from 0 0 to 24 24 with equal probability. We can do so by representing 24 24 in base 5: 2 4 10 = 4 4 5 24_{10} = 44_{5} . Now consider a number a b ˉ 5 \bar{ab}_5 . We can consider every possible combination of a a and b b to be any integer between 0 0 and 4 4 inclusive, and this would generate an integer from 0 0 to 4 4 5 44_5 exactly once. Converting that to a dice numbering we have

  • 2 2 20-sided dice numbered { 0 , 5 n , 2 5 n , 3 5 n , 4 5 n } \left\{ 0, 5^n, 2 \cdot 5^n, 3 \cdot 5^n, 4 \cdot 5^n \right\} , each element repeated 4 times to fill up all 20 sides, for 0 n 1 0 \le n \le 1

Now to generalise to 5 A 3 B 2 C 5^A \cdot 3^B \cdot 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 ] ] 5^A \cdot 3^B \cdot 2^C - 1 = 4 + 4 \cdot 5 + 4 \cdot 5^2 ... + 4 \cdot 5^{A-1} + 5^A\left[ 2 + 2 \cdot 3 + 2 \cdot 3^2 ... + 2 \cdot 3^{B-1} + 3^B\left[ 1 + 1 \cdot 2 + 1 \cdot 2^2 ... + 1 \cdot 2^{C-1} \right]\right]

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 ] ] x_0 + x_1 \cdot 5 + x_2 \cdot 5^2 ... + x_{A-1} \cdot 5^{A-1} + 5^A\left[ y_0 + y_1 \cdot 3 + y_2 \cdot 3^2 ... + y_{B-1} \cdot 3^{B-1} + 3^B\left[ z_0 + z_1 \cdot 2 + z_2 \cdot 2^2 ... + z_{C-1} \cdot 2^{C-1} \right]\right]

If we consider all combinations of x n , 0 n A 1 x_n, 0 \le n \le A-1 to be any integer between 0 0 and 4 4 inclusive, y n , 0 n B 1 y_n, 0 \le n \le B-1 to be any integer between 0 0 and 2 2 inclusive and z n , 0 n C 1 z_n, 0 \le n \le C-1 to be any integer between 0 0 and 1 1 inclusive, we will generate all integers between 0 0 and N 1 N-1 exactly once.

Now converting the above to a dice numbering we have

  • A A 20-sided dice numbered { 0 , 5 n , 2 5 n , 3 5 n , 4 5 n } \left\{ 0, 5^n, 2 \cdot 5^n, 3 \cdot 5^n, 4 \cdot 5^n \right\} , each element repeated 4 times to fill up all 20 sides, for 0 n A 1 0 \le n \le A-1
  • B B 6-sided dice numbered { 0 , 3 n 5 A , 2 3 n 5 A } \left\{ 0, 3^n 5^A, 2 \cdot 3^n 5^A \right\} , each element repeated 2 times to fill up all 6 sides, 0 n B 1 0 \le n \le B-1
  • C C 4-sided dice numbered { 0 , 2 n 3 B 5 A } \left\{ 0, 2^n 3^B 5^A \right\} , each element repeated 2 times to fill up all 4 sides, 0 n C 1 0 \le n \le C-1

However, the above dice numbering would pick an integer from 0 0 to N 1 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 1 to all the sides of one of the die and we now generate an integer between 1 1 and N N with equal probability. This leaves us with the construction shown above.


We have shown 2 things:

  1. If N N has prime factors that are not 2 2 , 3 3 or 5 5 , then it is impossible
  2. For every N N with prime factors 2 , 3 , 5 2, 3, 5 , there is a dice numbering that satisfies Vi's requirements

With these 2 proven, we can safely conclude that it is possible if and only if N N only has prime factors 2 2 , 3 3 and 5 5 .

From here, it is just a systematic count to get the answer 9825 9825 .


I'm aware that this solution is very badly phrased. If you have any questions feel free to ask.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...