Books · The Fiddler: Solutions
Chapter 46
Can You Hack Bowling?
In ten-pin bowling, a strike (all ten on the first ball) scores plus your next two balls; a spare (all ten in two balls) scores plus your next ball; an open frame scores the pins it knocks down. What is the minimum total number of pins you must knock down to reach a score of at least ?
The Fiddler, Zach Wissner-Gross, July 11, 2025(original post)
Solution
Strikes are the efficient move: each knocks ten pins but, through bonuses, can be worth up to thirty. Four strikes followed by a single frame of and already reaches exactly : knocking down pins. Since a strike yields the most score per pin, no game does better.
The computation
Search the efficient family of games, some leading strikes plus one ordinary frame, scoring each with the bowling rules and keeping the fewest pins that still reach . The minimum is , from four strikes and a .
def score(r):
s = i = 0
for _ in range(10):
if i >= len(r): break
if r[i] == 10: s += 10 + r[i+1] + r[i+2]; i += 1
else:
s += (10 + r[i+2]) if r[i] + r[i+1] == 10 else r[i] + r[i+1]; i += 2
return s
best, arg = 10**9, None
for k in range(0, 11): # k leading strikes
for a in range(11):
for b in range(11 - a): # one ordinary frame (a, b)
if score([10]*k + [a, b] + [0]*30) >= 100 and 10*k + a + b < best:
best, arg = 10*k + a + b, (k, a, b)
print(best, arg) # 44 (4, 2, 2)
Extra Credit
Two bowlers knock down the same total number of pins but post wildly different scores, and that difference could not have been any larger. What is the maximum possible score difference?
Solution
For a fixed pin total , the score is lowest with no bonuses (open frames, so the score equals , possible up to ) and highest by turning those pins into strikes. With the extremes are nine strikes versus ten open frames: No other pin total gives a wider gap. (The source’s value is paywalled; this is my own.)
The computation
Construct the two extremes at pins, a game of nine strikes and a game of ten bonus-free open frames, and score each; the difference is .
print(score([10]*9 + [0]*4), score([9, 0]*10)) # 240 90 -> diff 150