Chapter 251
Can You Solve A Particularly Prismatic Puzzle?
Riddler Express
In the 1984 World Championship (first to six wins), Karpov led Kasparov five wins to three when the match was halted. Taking each game independently with Karpov winning , Kasparov , and a draw , what was Kasparov’s chance of eventually winning the match had it continued?
The Riddler, FiveThirtyEight, December 13, 2019(original post)
Solution
Draws are a red herring: they lengthen the match but never change who wins. Strip them out and condition on games that have a winner. Among decisive games, Karpov takes a share and Kasparov .
Kasparov trailed five wins to three, and the match goes to the first to six wins. So Kasparov needed three more decisive games to fall his way before even one fell to Karpov, since a single Karpov win would bring Karpov to six and end it. He had to win the next three decisive games outright: Long odds, which is part of why the abandonment was so controversial.
The computation
Encode the match as a race over decisive games (and, separately, simulate the full game-by-game match including draws) to confirm Kasparov reaches six wins first only about of the time.
import random
# direct: Kasparov must win the next 3 decisive games (each 3/8)
print("direct:", (3 / 8) ** 3) # 0.052734...
# simulate the full match with draws (Karpov 5, Kasparov 3 wins already)
rng = random.Random(0); T = 2_000_000; kasp = 0
for _ in range(T):
a, b = 5, 3 # Karpov, Kasparov wins so far
while a < 6 and b < 6:
r = rng.random()
if r < 5 / 48: a += 1
elif r < 8 / 48: b += 1 # else draw, no change
kasp += (b == 6)
print("simulated:", kasp / T)
# direct: 0.052734375
# simulated: 0.0526
Riddler Classic
For how many rectangular prisms (cuboids) with whole-number side lengths does the volume (in cubic units) equal the surface area (in square units)? One is . How many are there in total?
The Riddler, FiveThirtyEight, December 13, 2019(original post)
Solution
We need whole numbers with Divide by : , so . Since is the smallest, , giving ; and forces . So , and for each the equation in has only finitely many whole-number solutions. Enumerating them yields exactly cuboids: The largest side that ever appears is , and despite searching far beyond it, there are no others.
The computation
Encode the equation and search. The bound caps and then , so a finite scan finds them all.
sols = []
for c in range(3, 7):
for b in range(c, 2 * c * 6 + 1):
for a in range(b, 4 * b * c + 1):
if a * b * c == 2 * (a * b + b * c + c * a):
sols.append((c, b, a))
print(len(sols), "cuboids:", sols)
# 10 cuboids: [(3, 7, 42), (3, 8, 24), (3, 9, 18), (3, 10, 15), (3, 12, 12),
# (4, 5, 20), (4, 6, 12), (4, 8, 8), (5, 5, 10), (6, 6, 6)]
The scan returns exactly ten cuboids, the complete list.