Books · The Fiddler: Solutions
Chapter 90
Can You Catch the Breakaway?
A lone cyclist is being chased by a group of four, who share the lead in equal turns while the other three draft. Leading takes twice the power of drafting, and every rider, lone or grouped, holds the same average power over time, with speed proportional to power. The four chasers have just passed a banner reading kilometres to the finish. How far behind the lone rider can they be and still catch them exactly at the line?
The Fiddler, Zach Wissner-Gross, July 19, 2024(original post)
Solution
Let drafting take power , so leading takes . In the group of four each rider leads a quarter of the time and drafts the rest, averaging . Every rider holds the same average, so the lone rider rides steadily at power , with speed proportional to it. The group, though, always has someone leading at power , and the whole line moves at that leader’s speed, proportional to . The group is therefore faster by the factor The group covers its km in the time the lone rider covers km, so to meet at the line the lone rider must have exactly km left when the banner is reached. The gap is :
The computation
Build it from the power model: form the group rider’s average power, which the lone rider must match, take each speed proportional to power, and find how far the lone rider has gone when the group finishes its km.
from fractions import Fraction as F
x = 1 # drafting power; leading costs 2x
lone = F(1, 4) * 2 * x + F(3, 4) * x # group rider's average = lone rider's power
ratio = (2 * x) / lone # group speed (leader) / lone speed = 8/5
print(ratio, 10 - 10 / ratio) # 8/5 15/4 = 3.75
Extra Credit
In a stage of riders, a breakaway of riders is km out and the peloton of riders is km out. What is the smallest breakaway that beats the peloton to the line?
Solution
A group of riders averages power per rider (one leads at , the other draft at ), so with average power fixed the leader, and hence the line, moves at a speed proportional to : bigger groups are faster, approaching twice a lone rider’s speed. The breakaway wins when its time beats the peloton’s, and the smallest integer that clears it is At the breakaway’s time is against the peloton’s ; at it is versus , just losing.
The computation
Encode each group’s speed from its size and compare finishing times, scanning upward for the smallest breakaway that arrives first.
def group_speed(n): return F(2 * n, n + 1) # speed of an n-rider group, average power fixed
def time(dist, n): return dist / group_speed(n)
print(next(b for b in range(1, 176)
if time(10, b) < time(11, 176 - b))) # 10