Books · The Fiddler: Solutions
Chapter 2
Can You Power up the Hill?
This year’s Tour de Fiddler sets two riders against a hill. A cyclist’s speed along the ground is modelled by where is pedalling power, is mass, and is the angle of the incline. Riders mark a road by its gradient , the slope written as a percentage, so a wall has gradient ; that is, . A climber has power and mass ; a sprinter has power and mass . At what gradient do the two ride at the same speed?
For extra credit, the pair race up a perfectly sinusoidal hill, from a base where the gradient is to a peak where it is again . What must the hill’s maximum gradient be for them to reach the top at the same time? The speed above is measured along the ground, so on a slope the same speed covers less horizontal ground per unit time.
The Fiddler, Zach Wissner-Gross, July 10, 2026(original post)
Solution
Both riders obey the same law, , so matching their speeds on a slope of angle means The one thing to notice is that this is gentler than it looks. Each speed is a ratio, so clearing the two denominators turns the equation into a plain linear one in , with the awkward squared and trigonometric pieces never appearing. Cross-multiplying, and expanding both sides gives , so and At this incline both riders travel at , the same speed. The gradient is the slope , and with the cosine is , so The two riders trade advantages with the slope (Figure, left). On the flat the sprinter’s greater power wins outright, against the climber’s ; on a steep wall the climber’s lighter frame tells; and the crossover, where the sprinter’s power exactly offsets the climber’s lightness, sits at a gentle .
Extra credit
The hill looks forbidding, with the speed changing continuously all the way up, but one observation flattens it. The time to cover a short stretch of road of length at local angle is , so the total climbing time is Now is exactly the vertical rise per unit of road travelled, since a step along ground tilted at lifts the rider by . So the first integral is just the total height climbed, and the second is the total length of road, Every twist of the hill has cancelled out. Only the height gained and the length of tarmac survive, and both riders face the same and the same . Equal times therefore ask only that which reduces, exactly as the main puzzle did, to , so . The road must be eighteen times as long as the hill is tall.
The word “sinusoidal” turns that length into a gradient. Take the profile across a horizontal span : it climbs from base to peak with zero slope at each end, and its steepest point, the middle, has gradient . The road length is the arc length of this curve, with the complete elliptic integral of the second kind. Imposing leaves a single equation for the maximum gradient, whose root is A hill this shallow is barely longer than its horizontal run, so to a first approximation and ; the small extra length the curve carries nudges the true maximum up to (Figure, right).
The computation
The identity is a shortcut, so the honest check throws it away and rides the actual hill. Cut the sinusoidal road into short ground segments; on each one read the local slope, turn it into an angle, and take the speed straight from the puzzle’s formula; then sum for the total time. For the main puzzle, find the gradient where the two speed curves cross. For the extra credit, find the maximum gradient at which the two total times agree, with no appeal to the cancellation.
import numpy as np
from scipy.optimize import brentq
from scipy.special import ellipe
def speed(P, m, theta): # ground-speed model from the puzzle
return P / (m*np.sin(theta) + 10.0)
# MAIN: gradient g = tan(theta) where climber and sprinter match speed.
th = brentq(lambda t: speed(300,60,t) - speed(325,80,t), 1e-9, np.pi/2-1e-9)
print(f"MAIN: sin(theta) = {np.sin(th):.6f} (1/18 = {1/18:.6f})")
print(f" speeds {speed(300,60,th):.4f} = {speed(325,80,th):.4f}")
print(f" gradient g = tan(theta) = {np.tan(th):.6f} = {100*np.tan(th):.3f}%")
# EC: integrate the REAL climb up a sinusoidal hill, dt = ds / v along the
# ground, and find the max gradient G making the two total times equal.
def climb_time(P, m, G, H=1.0, N=400_000):
W = H*np.pi/(2*G) # max gradient G = H*pi/(2W)
x = np.linspace(0.0, W, N+1)
y = (H/2)*(1 - np.cos(np.pi*x/W)) # sinusoidal profile, rise H
ds = np.hypot(np.diff(x), np.diff(y)) # ground-path segments
theta = np.arctan2(np.diff(y), np.diff(x)) # local incline angle
return np.sum(ds / speed(P, m, theta)) # sum of ds / v
G = brentq(lambda g: climb_time(300,60,g) - climb_time(325,80,g), 0.05, 0.15)
print(f"EC: max gradient G = {G:.6f} = {100*G:.3f}%")
print(f" equal times: {climb_time(300,60,G):.5f} vs {climb_time(325,80,G):.5f}")
# cross-check the shape-independent identity S = 18 H via the closed form
# S/H = sqrt(1+G^2) E(k)/G, k^2 = G^2/(1+G^2):
G2 = brentq(lambda g: np.sqrt(1+g*g)*ellipe(g*g/(1+g*g))/g - 18.0, 0.05, 0.15)
print(f" closed-form S=18H gives G = {G2:.6f} (matches)")
# MAIN: sin(theta) = 0.055556 (1/18 = 0.055556)
# speeds 22.5000 = 22.5000
# gradient g = tan(theta) = 0.055641 = 5.564%
# EC: max gradient G = 0.087433 = 8.743%
# equal times: 0.80000 vs 0.80000
# closed-form S=18H gives G = 0.087433 (matches)
The direct climb, discretised into hundreds of thousands of segments, gives the same maximum gradient as the elliptic-integral condition, , and confirms that at that gradient both riders take exactly the same time.