Books · The Fiddler: Solutions
Chapter 34
Let’s Make a Tic-Tac-Deal!
Tic-Tac-Deal uses a grid holding the numbers through : You roll two standard dice and add them, then place an X on the square equal to the sum. A sum of or , or any sum you have rolled before, wastes the roll. With exactly three rolls, what are your chances of getting three Xs in a row (horizontally, vertically, or diagonally)?
The Fiddler, Zach Wissner-Gross, October 10, 2025(original post)
Solution
Three rolls can make a line only if all three are distinct, none is or , and the three sums are exactly the three entries of one winning line. For such a triple the order is free and no roll is wasted, so each line contributes orderings. With the number of dice outcomes summing to () the answer is
The computation
Roll the game out exhaustively: over all ordered outcomes of three dice-rolls, mark the squares (discarding , , and repeats) and count the fraction whose marked set contains a winning line.
from fractions import Fraction as F
from itertools import product
lines = [(3,4,5),(6,7,8),(9,10,11),(3,6,9),(4,7,10),(5,8,11),(3,7,11),(5,7,9)]
dice = [a + b for a in range(1, 7) for b in range(1, 7)] # 36 equally likely sums
win = 0
for s1, s2, s3 in product(dice, repeat=3):
marks = {s for s in (s1, s2, s3) if 3 <= s <= 11} # 2/12 and repeats drop out
if any(set(L) <= marks for L in lines): win += 1
print(F(win, 36**3)) # 113/1944
Extra Credit
In the real game you get five rolls, with the same wasted-roll rules. With five rolls, what are your chances of three in a row?
Solution
After five rolls the marked squares are exactly the distinct sums in that came up; repeats and only waste a turn. Tracking the set of marked squares through a five-step exact recursion and reading off the chance the final set contains a line, (The source’s five-roll figure is paywalled; this exact value is my own.)
The computation
Carry the exact distribution over marked-square sets (as bitmasks) through five rolls: each step either wastes the turn ( or ) or adds square with probability . Sum the probability of every final set that contains a line.
from collections import defaultdict
c = {3:2, 4:3, 5:4, 6:5, 7:6, 8:5, 9:4, 10:3, 11:2}; vals = list(c)
idx = {v: i for i, v in enumerate(vals)}
masks = [sum(1 << idx[x] for x in L) for L in lines]
dist = {0: F(1)}
for _ in range(5):
nd = defaultdict(F)
for s, pr in dist.items():
nd[s] += pr*F(2, 36) # rolled 2 or 12 -> wasted
for k in vals: nd[s | 1 << idx[k]] += pr*F(c[k], 36)
dist = nd
print(sum(pr for s, pr in dist.items() if any((s & m) == m for m in masks)))
# -> 910405/2519424 ~ 36.14%