Books · The Fiddler: Solutions
Chapter 5
The Ant Goes Marching
June the ant is on the edge of one of a cylinder’s two circular faces. Her dinner is on the edge of the opposite face, all the way around on the other side: diametrically opposite her, one face down. The radius of the cylinder is 2 meters and its height is 2 meters. What is the shortest path along the surface to her dinner?
The Fiddler, Zach Wissner-Gross, May 22, 2026(original post)
Solution
Put June at in cylindrical coordinates and dinner at . Two families of unrollable paths compete. Across the top, then down: walk straight across the top face along the diameter (length ), arriving above the dinner, then straight down the side (length ), total . Around the side: unrolling the lateral surface, going halfway around is , which loses. Mixed paths interpolate between them and beat neither. The shortest path is
The computation
Parameterise the crossing point on the top face: cross to the point at angle , then descend the unrolled side to the dinner. Minimising the total chord-plus-descent over confirms the optimum is the full diameter () followed by a straight drop.
import numpy as np
from scipy.optimize import minimize_scalar
def mixed(phi):
chord = 2*np.sqrt(2 - 2*np.cos(phi)) # across the top
helix = np.sqrt((2*(np.pi - phi))**2 + 2**2) # unrolled side
return chord + helix
r = minimize_scalar(mixed, bounds=(0, np.pi), method="bounded")
print(r.fun, r.x) # 6.0 at phi = pi: diameter, then down
Extra Credit
Now June is on a hollowed-out cylinder: a cylindrical shell with outer radius 2 meters, inner radius 1 meter, and height 2 meters. She stands on the outer edge of one flat face; dinner is on the opposite face, all the way around on the other side. What is the shortest path along the shell’s surface?
Solution
The new surface opens a shortcut through the hole: cross the top annulus to the inner circle, descend the inner wall, cross the bottom annulus back out. Each leg unrolls flat; the chord between radius- and radius- points separated by angle is , and the inner wall descent of while turning through unrolls to . By symmetry , leaving minimised at with shorter than the outer-wall helix () or skirting the hole on the top (). (The source’s value is behind its paywall; this is my own.)
The computation
Minimise the three-leg through-the-hole length over the entry angle, and cross-check the two rival outside routes (the outer-wall helix and the top-skirt-then-down path).
f = lambda a: 2*np.sqrt(5 - 4*np.cos(a)) + np.sqrt(4 + (np.pi - 2*a)**2)
r = minimize_scalar(f, bounds=(0, np.pi/2), method="bounded", options={"xatol": 1e-12})
print(r.x, r.fun) # 0.45775..., 5.368959...
print(np.sqrt(4 + (2*np.pi)**2)) # outer wall: 6.5938
lp = np.sqrt(4 - 1); arc = (np.pi - 2*np.arccos(1/2)) * 1
print(2*lp + arc + 2) # top-skirt-then-down: 6.5113