Chapter 90
How Many Turkey Trotters Can You Pass?
I have five kinds of fair Platonic dice: tetrahedra (whose faces are numbered ), cubes (numbered ), octahedra (numbered ), dodecahedra (numbered ) and icosahedra (numbered ). When I roll two of the cubes, there is a single most likely sum: seven. But when I roll one cube and two tetrahedra, there is no single most likely sum — eight and nine are both equally likely.
Which whole numbers are never the single most likely sum, no matter which combinations of dice I pick?
Solution
The whole numbers that can never be the single most likely sum are every other whole number is the unique most likely sum of some combination of these dice.
Why nothing below 5. A single die has a flat distribution, so it has no single most likely sum; in particular cannot come from one die. With dice the most likely sum sits at the centre of the distribution, which is at least the centre for tetrahedra, . So no combination at all has its peak below .
Why 6 and 8 fail. The same centring argument bounds how many dice could possibly peak at a small target: a sum peaking at or can use at most dice. Checking every combination of at most three dice (code below): the unique peaks available are (two tetrahedra), (two cubes), (two octahedra, or and friends), , , and various larger values, but never or . Two different dice (say and faces) always produce a plateau of tied sums rather than a single peak, and the three-dice combinations near these targets all tie two central values (three tetrahedra tie and ).
Why everything else works. A pair of identical dice is symmetric about a whole number: two tetrahedra peak at , two cubes at , two octahedra at , two dodecahedra at , two icosahedra at , each a unique peak. Dice distributions are log-concave, and sums of independent symmetric log-concave lattice variables stay symmetric and single-peaked about the sum of the centres. So stacking pairs adds the peaks: any sum (with , not all zero) is a unique most likely sum. Since and are coprime, every whole number from upward is (the Frobenius number of is ), and a direct search over combinations of at most eight dice exhibits unique peaks for every value from to except and . Together: every whole number except is achievable.
The computation
Convolve the face distributions for every combination of up to eight dice, record the sums that have a single mode, and report which small whole numbers never appear.
from itertools import combinations_with_replacement
DICE = [4, 6, 8, 12, 20]
def conv(d1, d2):
out = {}
for a, pa in d1.items():
for b, pb in d2.items():
out[a+b] = out.get(a+b, 0) + pa*pb
return out
unique_peaks = set()
for n in range(1, 9):
for combo in combinations_with_replacement(DICE, n):
d = {0: 1}
for faces in combo:
d = conv(d, {i: 1 for i in range(1, faces+1)})
top = max(d.values())
modes = [s for s, c in d.items() if c == top]
if len(modes) == 1:
unique_peaks.add(modes[0])
print(sorted(k for k in range(1, 40) if k not in unique_peaks))
# [1, 2, 3, 4, 6, 8]