Skip to content
Vamshi Jandhyala

Books · The Fiddler: Solutions

Chapter 2

Can You Power up the Hill?

↓ Download PDF handout

This year’s Tour de Fiddler sets two riders against a hill. A cyclist’s speed along the ground is modelled by v=Pmsinθ+10,v = \frac{P}{m\sin\theta + 10}, where PP is pedalling power, mm is mass, and θ\theta is the angle of the incline. Riders mark a road by its gradient gg, the slope written as a percentage, so a 4545^\circ wall has gradient 11; that is, g=tanθg = \tan\theta. A climber has power 300300 and mass 6060; a sprinter has power 325325 and mass 8080. 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 00 to a peak where it is again 00. 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, v=P/(msinθ+10)v = P/(m\sin\theta + 10), so matching their speeds on a slope of angle θ\theta means 30060sinθ+10=32580sinθ+10.\frac{300}{60\sin\theta + 10} = \frac{325}{80\sin\theta + 10}. 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 sinθ\sin\theta, with the awkward squared and trigonometric pieces never appearing. Cross-multiplying, 300(80sinθ+10)=325(60sinθ+10),300\,(80\sin\theta + 10) = 325\,(60\sin\theta + 10), and expanding both sides gives 24000sinθ+3000=19500sinθ+325024000\sin\theta + 3000 = 19500\sin\theta + 3250, so 4500sinθ=2504500\sin\theta = 250 and sinθ=2504500=118.\sin\theta = \frac{250}{4500} = \frac{1}{18}. At this incline both riders travel at 300/(60118+10)=22.5300/(60\cdot\tfrac1{18} + 10) = 22.5, the same speed. The gradient is the slope g=tanθg = \tan\theta, and with sinθ=118\sin\theta = \tfrac1{18} the cosine is cosθ=11324=32318\cos\theta = \sqrt{1 - \tfrac1{324}} = \tfrac{\sqrt{323}}{18}, so g=tanθ=sinθcosθ=1/18323/18= 13230.0556  (5.56%). g = \tan\theta = \frac{\sin\theta}{\cos\theta} = \frac{1/18}{\sqrt{323}/18} = \boxed{\ \frac{1}{\sqrt{323}} \approx 0.0556\ \ (5.56\%).\ } The two riders trade advantages with the slope (Figure, left). On the flat the sprinter’s greater power wins outright, 32.532.5 against the climber’s 3030; 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 5.56%5.56\%.

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 dsds at local angle θ\theta is dt=ds/v=(msinθ+10)ds/Pdt = ds/v = (m\sin\theta + 10)\,ds/P, so the total climbing time is T=1P(m ⁣sinθds+10 ⁣ds).T = \frac{1}{P}\left( m\!\int \sin\theta\, ds + 10\!\int ds \right). Now sinθ\sin\theta is exactly the vertical rise per unit of road travelled, since a step dsds along ground tilted at θ\theta lifts the rider by dy=sinθdsdy = \sin\theta\, ds. So the first integral is just the total height climbed, and the second is the total length of road, T=mH+10SP,H=total rise,S=total road length.T = \frac{m H + 10 S}{P}, \qquad H = \text{total rise}, \quad S = \text{total road length}. Every twist of the hill has cancelled out. Only the height gained and the length of tarmac survive, and both riders face the same HH and the same SS. Equal times therefore ask only that 60H+10S300=80H+10S325,\frac{60H + 10S}{300} = \frac{80H + 10S}{325}, which reduces, exactly as the main puzzle did, to 250S=4500H250 S = 4500 H, so S=18HS = 18H. 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 y(x)=H2(1cos(πx/W))y(x) = \tfrac{H}{2}\bigl(1 - \cos(\pi x / W)\bigr) across a horizontal span WW: it climbs from base to peak with zero slope at each end, and its steepest point, the middle, has gradient G=Hπ/(2W)G = H\pi/(2W). The road length is the arc length of this curve, S=0W1+y(x)2  dx=HG1+G2  E ⁣(G1+G2),S = \int_0^W \sqrt{1 + y'(x)^2}\; dx = \frac{H}{G}\sqrt{1 + G^2}\; E\!\left(\frac{G}{\sqrt{1+G^2}}\right), with EE the complete elliptic integral of the second kind. Imposing S=18HS = 18H leaves a single equation for the maximum gradient, 1+G2  E ⁣(G1+G2)=18G,\sqrt{1 + G^2}\; E\!\left(\frac{G}{\sqrt{1+G^2}}\right) = 18\,G, whose root is  G0.0874  (8.74%). \boxed{\ G \approx 0.0874\ \ (8.74\%).\ } A hill this shallow is barely longer than its horizontal run, so to a first approximation SWS \approx W and Gπ/368.73%G \approx \pi/36 \approx 8.73\%; the small extra length the curve carries nudges the true maximum up to 8.74%8.74\% (Figure, right).

Left: each rider’s ground speed against gradient. The sprinter leads on the flat, the lighter climber on the steep, and the curves cross at g=1/3235.56%g = 1/\sqrt{323} \approx 5.56\%, both at speed 22.522.5. Right: the gradient along the sinusoidal hill. Equal climbing times force the road to be 1818 times the rise, which for this shape means a maximum gradient near 8.74%8.74\%.

The computation

The identity T=(mH+10S)/PT = (mH + 10S)/P 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 ds/vds/v 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, G0.0874G \approx 0.0874, and confirms that at that gradient both riders take exactly the same time.