Skip to content
Vamshi Jandhyala

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)

June (top edge) and her dinner (bottom edge, diametrically opposite). Figure from the source post.

Solution

Put June at (2,0,2)(2, 0, 2) in cylindrical coordinates and dinner at (2,π,0)(2, \pi, 0). Two families of unrollable paths compete. Across the top, then down: walk straight across the top face along the diameter (length 44), arriving above the dinner, then straight down the side (length 22), total 66. Around the side: unrolling the lateral surface, going halfway around is (2π)2+226.594\sqrt{(2\pi)^2+2^2}\approx6.594, which loses. Mixed paths interpolate between them and beat neither. The shortest path is 6 meters.\boxed{6 \text{ meters}}.

The computation

Parameterise the crossing point on the top face: cross to the point at angle φ\varphi, then descend the unrolled side to the dinner. Minimising the total chord-plus-descent over φ\varphi confirms the optimum is the full diameter (φ=π\varphi=\pi) 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?

The cylindrical shell: outer radius 2, inner radius 1, height 2. Figure from the source post.

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-22 and radius-11 points separated by angle γ\gamma is 54cosγ\sqrt{5-4\cos\gamma}, and the inner wall descent of 22 while turning through βα\beta-\alpha unrolls to 4+(βα)2\sqrt{4+(\beta-\alpha)^2}. By symmetry β=πα\beta=\pi-\alpha, leaving f(α)=254cosα+4+(π2α)2,f(\alpha) = 2\sqrt{5 - 4\cos\alpha} + \sqrt{4 + (\pi - 2\alpha)^2}, minimised at α=0.45775\alpha^* = 0.45775 with f(α)=5.36896 meters,f(\alpha^*) = \boxed{5.36896 \text{ meters}}, shorter than the outer-wall helix (6.596.59) or skirting the hole on the top (6.516.51). (The source’s value is behind its paywall; this is my own.)

The computation

Minimise the three-leg through-the-hole length f(α)f(\alpha) 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