Skip to content
Vamshi Jandhyala

Books · The Fiddler: Solutions

Chapter 35

When Will You Cross Your Path?

Anita the ant walks 11 inch in a straight line, rotates counterclockwise by an angle φ\varphi, walks 22 inches, rotates by φ\varphi again, walks 33 inches, and so on. At some point her path crosses back over her very first 11-inch segment. Given that φ\varphi is the smallest angle for which this ever happens, how long was the segment along which she first crossed the initial segment?

The Fiddler, Zach Wissner-Gross, October 3, 2025(original post)

At the critical angle the fourth segment (copper) just reaches the initial segment (blue), meeting it exactly at the far endpoint (1,0)(1,0).

Solution

Place the start at the origin with the first segment along the positive xx-axis, so segment 11 is {(x,0):0x1}\{(x,0):0\le x\le1\} and the vertices are P0=(0,0),Pk=Pk1+k(cos(k1)φ, sin(k1)φ).P_0=(0,0),\quad P_k=P_{k-1}+k\bigl(\cos(k-1)\varphi,\ \sin(k-1)\varphi\bigr). For small φ\varphi the spiral opens outward and never returns. As φ\varphi grows, the first segment able to swing back onto the initial one is the fourth. At the smallest such φ\varphi the crossing is marginal: segment 44 meets the initial segment exactly at its far endpoint (1,0)=P1(1,0)=P_1. The line of segment 44 passes through P1P_1 when (P3P1)×(cos3φ,sin3φ)=0\bigl(P_3-P_1\bigr)\times(\cos3\varphi,\sin3\varphi)=0, which telescopes to j=23jsin((4j)φ)=2sin2φ+3sinφ=sinφ(4cosφ+3)=0,\sum_{j=2}^{3} j\,\sin\bigl((4-j)\varphi\bigr)=2\sin2\varphi+3\sin\varphi =\sin\varphi\,(4\cos\varphi+3)=0, so cosφ=34\cos\varphi=-\tfrac34. At that angle the crossing happens along the fourth segment, of length 4 inches\boxed{4\text{ inches}}.

The computation

Walk the actual spiral: build the vertices, and for a sweep of angles find the first segment that crosses the interior of the initial unit segment. The smallest crossing angle is arccos(34)\arccos(-\tfrac34), and the crossing segment is the fourth.

import numpy as np
from math import cos, sin, acos, pi, degrees
def verts(phi, K):
    P = [(0., 0.), (1., 0.)]
    for k in range(2, K + 1):
        h = (k - 1)*phi; P.append((P[-1][0] + k*cos(h), P[-1][1] + k*sin(h)))
    return P
def crosses(A, B, eps=1e-9):             # interior crossing of {y=0, 0<x<1}?
    (x1, y1), (x2, y2) = A, B
    if y1 == y2: return False
    t = -y1 / (y2 - y1)
    return eps < t < 1 - eps and eps < x1 + t*(x2 - x1) < 1 - eps
for phi in np.linspace(.001, pi - .001, 60000):    # smallest crossing angle
    P = verts(phi, 16)
    hit = next((k for k in range(2, 16) if crosses(P[k-1], P[k])), None)
    if hit: print(round(degrees(phi), 3), "deg, seg", hit); break   # 138.593, 4

Extra Credit

What was the measure of the angle φ\varphi?

Solution

From the marginal condition cosφ=34\cos\varphi=-\tfrac34, φ=arccos ⁣(34)2.4189 rad138.59.\varphi=\arccos\!\Bigl(-\tfrac34\Bigr)\approx 2.4189\text{ rad}\approx\boxed{138.59^\circ}. (The exact angle is paywalled at the source; this closed form is my own.)

The computation

Pin the angle by bisection: shrink the bracket to the smallest φ\varphi at which the fourth segment just crosses the initial one. It converges to arccos(34)\arccos(-\tfrac34).

def seg4_crosses(phi):
    P = verts(phi, 4); return crosses(P[3], P[4])
lo, hi = 2.0, 3.0
for _ in range(80):
    mid = (lo + hi) / 2
    lo, hi = (lo, mid) if seg4_crosses(mid) else (mid, hi)
print(round(degrees(hi), 3), round(degrees(acos(-0.75)), 3))   # 138.59  138.59