- Three Indistinguishable Dice
- 19 Apr 2016 05:09:04 pm
- Last edited by lirtosiast on 20 Apr 2016 11:59:51 am; edited 3 times in total

There's a puzzle going around, started by this standupmaths video: Given the result of rolling three indistinguishable dice, simulate rolling two distinguishable dice with the correct probabilities; (a uniform 1/36).

By playing with probability tables, here's my messy solution:

0. Sort the dice in ascending order.

1. Count how many distinct rolls there are. If two, step 2a. If three, step 2b. If they're all the same, just output (6,6).

2a. The output is either doubles or has one 6. Remove the duplicate roll and call the remaining rolls x and y.

If x+1=y (the rolls are consecutive), output (x,x). For example, {1,1,2} becomes (1,1).

If not, calculate r=2x+y mod 5 (where 0=5) and output (r,6) if there is a 2 or a 5 present and (6,r) otherwise. For example, {3,5,5} becomes (1,6).

2b. The output is two distinct numbers, neither of which are 6.

If the sum of the dice is odd, SWITCH THE ORDER of the output calculated below; that is, output the larger number first.

* If there is a 1 or a 6 present, output the largest two numbers that are not 6. For example, {2,3,6} becomes (3,2).

* Otherwise, output the smallest two numbers that were NOT rolled. For example, {2,3,5} becomes (1,4).

I haven't looked at other solutions, so there is probably something more elegant.

EDIT: Fixed Step 2a.

-----

If the two simulated dice can be indistinguishable, we can remove the order calculation:

0. Sort the dice in ascending order.

1. Count how many distinct rolls there are. If two, step 2a. If three, step 2b. If they're all the same, just output (6,6).

2a. The output is either doubles or has one 6. Remove the duplicate roll and call the remaining rolls x and y.

If x+1=y (the rolls are consecutive), output (x,x). For example, {1,1,2} becomes (1,1).

If not, calculate r=2x+y mod 5 (where 0=5) and output (r,6). For example, {3,5,5} becomes (1,6).

2b. The output is two distinct numbers, neither of which are 6.

* If there is a 1 or a 6 present, output the largest two numbers that are not 6. For example, {2,3,6} becomes (3,2).

* Otherwise, output the smallest two numbers that were NOT rolled. For example, {2,3,5} becomes (1,4).

By playing with probability tables, here's my messy solution:

0. Sort the dice in ascending order.

1. Count how many distinct rolls there are. If two, step 2a. If three, step 2b. If they're all the same, just output (6,6).

2a. The output is either doubles or has one 6. Remove the duplicate roll and call the remaining rolls x and y.

If x+1=y (the rolls are consecutive), output (x,x). For example, {1,1,2} becomes (1,1).

If not, calculate r=2x+y mod 5 (where 0=5) and output (r,6) if there is a 2 or a 5 present and (6,r) otherwise. For example, {3,5,5} becomes (1,6).

2b. The output is two distinct numbers, neither of which are 6.

If the sum of the dice is odd, SWITCH THE ORDER of the output calculated below; that is, output the larger number first.

* If there is a 1 or a 6 present, output the largest two numbers that are not 6. For example, {2,3,6} becomes (3,2).

* Otherwise, output the smallest two numbers that were NOT rolled. For example, {2,3,5} becomes (1,4).

I haven't looked at other solutions, so there is probably something more elegant.

EDIT: Fixed Step 2a.

-----

If the two simulated dice can be indistinguishable, we can remove the order calculation:

0. Sort the dice in ascending order.

1. Count how many distinct rolls there are. If two, step 2a. If three, step 2b. If they're all the same, just output (6,6).

2a. The output is either doubles or has one 6. Remove the duplicate roll and call the remaining rolls x and y.

If x+1=y (the rolls are consecutive), output (x,x). For example, {1,1,2} becomes (1,1).

If not, calculate r=2x+y mod 5 (where 0=5) and output (r,6). For example, {3,5,5} becomes (1,6).

2b. The output is two distinct numbers, neither of which are 6.

* If there is a 1 or a 6 present, output the largest two numbers that are not 6. For example, {2,3,6} becomes (3,2).

* Otherwise, output the smallest two numbers that were NOT rolled. For example, {2,3,5} becomes (1,4).