# Relabeling two 20-sided dice without changing their total

Usually, 20-sided dice are labeled with the numbers 1 to 20. When you roll two of these, their sum is a random number between 2 and 40. The total 21 is most likely to occur, while 2 and 40 are the least. The probabilities vary linearly in between, as shown below.

Is there different way to label two 20-sided dice with positive integers, so that their sum is still a random number between 2 and 40 with these same probabilities?

Without the positive integer constraint, there would be trivial solutions like [0, ... ,19] and [1, ... ,21], or [0.5, ... ,19.5] and [1.5, ... ,20.5].

This is a variant of a more famous puzzle, which asks the same question for six-sided dice.

• How about an equal probability for every sum, or a bell curve distribution? – Darcinon Jan 28 '16 at 23:35
• @Darcinon Equal probability between 2 and 40 is impossible, since the $20^2$ possible die roll pairs can't be split event among the 39 numbers 2...40. But you can do 1...40 with equal probability. – Mike Earnest Jan 29 '16 at 0:16

Is there a different way to label two 20-sided dice with positive integers, so that their sum is still a random number between 2 and 40 with these same probabilities?

Yes.

Details:

In fact, there are seven (if I counted correctly) different ways of achieving this.

More details:

Solution 1
Die 1: 1,2,2,3,3,3,4,4,4,4,5,5,5,5,6,6,6,7,7,8
Die 2: 1,5,6,9,10,11,13,14,15,16,17,18,19,20,22,23,24,27,28,32

Solution 2
Die 1: 1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11
Die 2: 1,3,5,7,9,11,11,13,13,15,15,17,17,19,19,21,23,25,27,29

Solution 3
Die 1: 1,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,12
Die 2: 1,2,5,6,9,10,11,12,13,14,15,16,17,18,19,20,23,24,27,28

Solution 4
Die 1: 1,2,3,4,5,6,6,7,7,8,8,9,9,10,10,11,12,13,14,15
Die 2: 1,2,3,4,5,11,11,12,12,13,13,14,14,15,15,21,22,23,24,25

Solution 5
Die 1: 1,2,2,3,3,4,4,5,5,6,11,12,12,13,13,14,14,15,15,16
Die 2: 1,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,24

Solution 6
Die 1: 1,2,3,3,4,4,5,5,6,7,11,12,13,13,14,14,15,15,16,17
Die 2: 1,2,5,6,6,7,9,10,10,11,13,14,14,15,17,18,18,19,22,23

Solution 7
Die 1: 1,2,2,3,5,6,6,7,9,10,10,11,13,14,14,15,17,18,18,19
Die 2: 1,3,3,5,5,7,7,9,9,11,11,13,13,15,15,17,17,19,19,21

That's it (I think)!

How I solved it, and how you can check that the solutions are correct:

Many years ago I read a very nice math textbook called Analytic Number Theory by D. J. Newman. Chapter 1 of that book has a section titled Crazy Dice in which the same riddle linked to by the OP that deals with the case of 6-sided dice is solved using generating functions. Essentially one converts the problem to a problem of polynomial algebra. For example, the solution "die1=(1,2,2,3,3,4), die2=(1,3,4,5,6,8)" to the original crazy dice problem reduces to checking the polynomial identity
$$(x+x^2+x^3+x^4+x^5+x^6)^2 = (x+2x^2+2x^3+x^4)(x+x^3+x^4+x^5+x^6+x^8),$$
since when expanding out these products, the coefficients of powers of $x$ on the left-hand side correspond precisely to the probabilities (after dividing by 36) to get the numbers $2,3,...,12$ when rolling normal dice, and on the right-hand side this would be the same thing with the crazy dice. So, to solve our new problem with the $20$-sided dice we need to find corresponding identities involving a "nonstandard" factorization of the polynomial
$$g(x)^2 = (1+x+x^2+...+x^{19})^2$$
into a product of two distinct polynomials whose coefficients are nonnegative and add up to $20$. I managed to do this by factorizing the polynomial $g(x)$ in Mathematica (it factors into 5 irreducible factors: $x+1$, $x^2+1$, $x^4-x^3+x^2-x+1$, $x^4+x^3+x^2+x+1$, $x^8-x^6+x^4-x^2+1$) and then writing a small program to systematically look at all possible products of these 5 factors with powers $0,1,2$. There are a total of $3^5=243$ possibilities, so my laptop did this easily in a few seconds.

• I have to say, this is an impressively clever solution which readily generalizes to any number and type of dice. – 2012rcampion Jan 28 '16 at 8:33
• The irreducible factors of $(1+x+\ldots+x^{19})$ are exactly the cyclotomic polynomials $\phi_n$ as $n$ ranges over the divisors of $20$ (except for $n=1$). – Julian Rosen Jan 28 '16 at 14:56
• And taking the sum of their coefficients is equivalent to evaluating them at $1$, which means you can use this result to further systematize things... – Micah Jan 29 '16 at 0:57
• This transformation -- from distinct events with values to polynomial, and turning addition into multiplication -- is great for certain kinds of modelling. It is analogous to the Fourier transform trick in more than one way. I have lots of fun with it, and computers love it. – Yakk Jan 29 '16 at 15:00

A solution that fits a generalized pattern:

[ 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 ]
x [ 1 3 5 7 9 11 11 13 13 15 15 17 17 19 19 21 23 25 27 29 ]

Began by looking at what would be equivalent puzzles for pairs of 2-sided, 4-sided, 6-sided and 8-sided dice, along with the assumption that the intervals between their sides' numbers would be symmetric because the resulting distribution is symmetric.

The intervals' symmetry could be either like ABBA and CDDC, as turned out to be the case, or like ABCD and DCBA, where the intervals of one die reverse the intervals of the other die.

2 sides (essentially a pair of coins with no alternative to the standard spot pattern): [1 2] x [1 2]

4 sides (easy): [1 2 2 3] x [1 3 3 5]

6 sides (the famous case): [1 2 2 3 3 4] x [1 3 4 5 6 8]

8 sides (not too tough, based on those above): [1 2 2 3 3 4 4 5] x [1 3 5 5 7 7 9 11]

20 sides was straightforward after 8 sides refined the pattern suggested by 2, 4 and 6 sides.

Addendum.   In the terms of another solution, this solution neatly breaks down to $$\begin{array}{ll} A = [1,2] & B=[1,11]\\ C=[0,1,2,3,4,5,6,7,8,9] & D=[0,2,4,6,8,10.12,14,16,18] \end{array}$$ which clearly shows what underlies the straightforward even-sided-dice pattern better than how I understood it.

Let A and B be 4-sided dice with the below labels, and similarly for the 5-sided dice C and D: $$\begin{array}{ll} A = [1,2,3,4] & B=[1,6,11,16]\\ C=[0,1,2,3,4] & D=[0,4,8,12,16] \end{array}$$ Notice that adding the rolls of A and D produces a random number between 1 and 20, so that A and D together simulate a d20, or A + D = d20. Similarly, B + C = d20, so $$\text{d20 }+\text{d20}=(A+D) + (B+C)$$ To get a different labeling, let's shuffle these factors around: $$\text{d20 }+\text{d20}=(A+C) + (B+D)$$ Rolling B and D together produces a random number in the list $$E=[1,6,11,16,5,10,15,20,9,14,19,24,13,18,23,28,17,22,27,32]$$ so B + D is equal to a 20-sided die E with these labels. Similarly, A + C is equal to the 20-sided die F featuring the labels $$F=[1,2,3,4,2,3,4,5,3,4,5,6,4,5,6,7,5,6,7,8]$$ This shows that d20 + d20 = E + F, so E and F are labelings that work.

This same method shows that there exist pairs of alternative $n$-sided dice which simulate regular $n$-sided dice, as long as $n$ is composite. The problem is impossible when $n$ is prime, which can be shown using abstract algebra by representing dice as polynomials.

• Looks like my [1 ... 11] x [1 ... 29] solution neatly breaks down in your system to A = [1 2], B = [1 11], C = [0 1 2 3 4 5 6 7 8 9] and D = [0 2 4 6 8 10 12 14 16 18], which clearly shows what underlies the straightforward even-sided-dice pattern better than how I understood it. No wonder you wanted to share this puzzle and your solution. – humn Jan 30 '16 at 9:42