Chapter 243
Can You Win The Tour de FiveThirtyEight?
Riddler Express
A logo is two overlapping circles of radius , creating three regions: the lens shared by both circles and the two crescents belonging to one circle only. For all three regions to have equal area, how far apart must the centres be? Extra credit: for three symmetric unit circles (seven regions), what centre distance makes the largest and smallest of the seven regions as close in area as possible?
The Riddler, FiveThirtyEight, September 20, 2019(original post)
Solution
Each circle (area ) is split into the lens plus one crescent, so crescent minus lens. For the lens and each crescent to be equal we need the lens to be exactly half the circle: The lens area for two unit circles whose centres are apart is Setting has no closed form, but solving numerically gives The extra credit has a pretty punchline: arranging three unit circles to even out the seven regions gives the same distance, about . The reason is that balancing the three-circle regions reduces, by a short area argument, to the very same condition that the two-circle lens be half a circle.
The computation
Encode the lens-area formula and solve for ; confirm the lens then equals each crescent.
import numpy as np
from scipy.optimize import brentq
L = lambda d: 2 * np.arccos(d / 2) - (d / 2) * np.sqrt(4 - d * d)
d = brentq(lambda d: L(d) - np.pi / 2, 0.01, 1.99)
print(f"d = {d:.7f}")
print(f"lens = {L(d):.6f}, crescent = {np.pi - L(d):.6f}")
# d = 0.8079455
# lens = 1.570796, crescent = 1.570796 (both = pi/2)
Riddler Classic
In a team time trial with equally-matched teams, each team picks a pace; a faster pace means a higher chance of “cracking” (not finishing). Teams ride one at a time and see all previous results, and the fastest finisher wins. Team Riddler rides first. To maximise its chance of winning, what is its probability of finishing, and its probability of winning? Extra credit: what are its chances if it rides last instead?
The Riddler, FiveThirtyEight, September 20, 2019(original post)
Solution
Let Team Riddler finish with probability . Going first, it can only win if it finishes and every later team fails to beat it. But any team that follows will simply ride a hair faster than the current best pace, so each of the other teams also finishes (and thereby wins) with essentially probability , and fails with probability . Since the teams are independent, Maximising over (set the derivative to zero) gives , so
In general the first of teams should finish with probability . For the extra credit, ride last: by the same rule, whichever team is first-to-go among those still without a finisher aims for finish-probability with teams left, and a short calculation shows each of teams – is equally likely () to be the first to finish. Summing Team Riddler’s chance of then beating that leader gives about ten times better: going last, you know exactly what pace you must beat.
The computation
Encode the sequential game and its optimal strategy: with no finisher yet and teams left, the rider aims for finish-probability ; once someone has finished, later riders match that pace (finishing makes them the new leader). Simulate with Team Riddler first and last, and check against and .
import random
N = 20
def simulate(riddler_pos, trials, seed):
rng = random.Random(seed); wins = 0
for _ in range(trials):
leader_q = None; leader = None
for i in range(N):
q = (1.0 / (N - i)) if leader_q is None else leader_q
if rng.random() < q:
leader_q = q; leader = i # finishes, becomes the new leader
wins += (leader == riddler_pos)
return wins / trials
print(f"first: analytic {(1/N) * (1 - 1/N) ** (N - 1):.4f}, "
f"MC {simulate(0, 2_000_000, 1):.4f}")
H = sum(1 / k for k in range(1, N + 1))
print(f"last: analytic {H / N:.4f}, MC {simulate(N - 1, 2_000_000, 2):.4f}")
# first: analytic 0.0189, MC 0.0189
# last: analytic 0.1799, MC 0.1797
The simulation matches: first to ride, Team Riddler wins about of the time; last to ride, about .