Books · The Fiddler: Solutions
Chapter 58
Can You Throw the Hammer?
Two players race to points. Each hole is worth point and is a coin flip, but before any hole a player may “throw the hammer.” The opponent then either accepts (the hole is now worth points) or rejects (conceding point to the thrower). You have won the first hole and lead –. With optimal play, what is your probability of winning the match?
The Fiddler, Zach Wissner-Gross, April 18, 2025(original post)
Solution
Solve the game backward over scores . At each hole you may throw (the opponent then picks the worse of a two-point hole or conceding you a point) or pass (after which the opponent may throw against you); both sides optimise. Leading –, throwing the hammer is correct: it turns the hole into a two-point swing that you can ride to (A one-point hole from – would give only , which is why you throw.)
The computation
Encode the game tree and fold it back from the finish: at every score, value both throwing (opponent accepts or concedes, whichever hurts you more) and passing (opponent may then throw), and take the side’s best choice.
from functools import lru_cache
def solve(T):
@lru_cache(None)
def V(a, b):
if a >= T: return 1.0
if b >= T: return 0.0
p1 = 0.5*V(a+1, b) + 0.5*V(a, b+1)
p2 = 0.5*V(min(a+2, T), b) + 0.5*V(a, min(b+2, T))
you = min(p2, V(a+1, b)) # you throw; opp accepts(p2) or rejects(you+1)
opp = max(p2, V(a, b+1)) # opp throws; you accept(p2) or reject(opp+1)
return max(you, min(p1, opp))
return V
print(round(solve(3)(1, 0), 4)) # 0.75
Extra Credit
With the same rules but a race to points, what is your probability of winning from –?
Solution
The same backward solve over a longer race gives a smaller edge: an early one-point lead matters less when more holes remain. (The source’s value is paywalled; this is my own.)
The computation
The same solver from the main section, run to points.
print(round(solve(5)(1, 0), 4)) # 0.6875 = 11/16