Skip to content
Vamshi Jandhyala

Books · The Riddler

Chapter 56

Can You Stick It To The Genie?

You roll three dice in order: a d4d4 (faces 1144), a d6d6 (faces 1166), then a d8d8 (faces 1188), each face equally likely. You win when the three rolls strictly increase, like 22-44-77. What is your probability of winning? Extra credit: rolling d4,d6,d8,d10,d12,d20d4, d6, d8, d10, d12, d20 in order, what is the chance the six rolls strictly increase?

Solution

Win when a<b<ca < b < c with aa on the d4d4, bb on the d6d6, cc on the d8d8. The rolls are independent and uniform, so the probability is the count of strictly increasing triples divided by 468=1924 \cdot 6 \cdot 8 = 192. Count them by fixing the first two and letting the last run free: for each a4a \le 4 and each bb with a<b6a < b \le 6, the top die can be any of the 8b8-b values above bb. Summing, a=14b=a+16(8b)=48,Pr(win)=48192=14.\sum_{a=1}^{4} \sum_{b=a+1}^{6} (8-b) = 48, \qquad \Pr(\text{win}) = \frac{48}{192} = \boxed{\tfrac14}. The clean answer is a small coincidence of these particular face counts, not a general law. With six dice the same idea (count increasing sextuples, divide by 4681012204\cdot6\cdot8\cdot10\cdot12\cdot20) has no tidy closed form; the exact value is Pr(six increase)=27172304000.0118.\Pr(\text{six increase}) = \frac{2717}{230400} \approx \boxed{0.0118}.

The computation

Enumerate every outcome of the dice in order and count the fraction that strictly increase.

from fractions import Fraction as F
from itertools import product
def prob(faces):
    rolls = product(*[range(1, f + 1) for f in faces])
    wins = sum(all(x < y for x, y in zip(r, r[1:])) for r in rolls)
    total = 1
    for f in faces: total *= f
    return F(wins, total)
print(prob([4, 6, 8]))                       # 1/4
print(prob([4, 6, 8, 10, 12, 20]), float(prob([4, 6, 8, 10, 12, 20])))
# 2717/230400, 0.0118