October 2, 2025
Anita the ant is going for a walk in the sand, leaving a trail as she goes. First, she walks 1 inch in a straight line. Then she rotates counterclockwise by an angle \( \phi \), after which she walks another 2 inches. She rotates counterclockwise an angle \( \phi \) again, after which she walks 3 inches. She keeps doing this over and over again, rotating counterclockwise an angle \( \phi \) and then walking 1 inch farther than she did in the previous segment.
At some point during her journey, she crosses over her initial 1-inch segment. By “cross over,” I am including the two end points of that first segment.
Anita realizes that \( \phi \) was the smallest possible angle such that she crossed over her 1-inch segment. (Among the ants, she’s known for her mathematical prowess.)
How long was the segment along which she first crossed over the 1-inch segment? Your answer should be a whole number of inches.
Extra credit: It’s time for you to check Anita’s work. What was the measure of angle \( \phi \)? Remember, this was the smallest possible angle for each turn such that she crossed over her 1-inch segment at some later point.
The way I approached this problem was by first visualizing it. For different values of the turning angle \( \phi \), what would Anita’s walk actually look like? How does her path behave when she eventually crosses over her own trail? To explore this, I wrote a MATLAB script that plots Anita’s path for various angles. If her trajectory appears to spiral outward, the script draws the first 15 paths; otherwise, it stops the plot as soon as the first crossing occurs. I placed Anita’s walk on a Cartesian plane, set her starting point at the origin, and assumed that her first path runs from \((0, 0)\) to \((0, 1)\). Below are some examples of her walks:
There are several observations to be made here. First of all, the zero-crossings of Anita's path, that is, the x-coordinate when Anita crosses the x-axis, seems to be monotonically increasing in absolute value. For example, for \(\phi = 90^\circ\), the zero-crossings are: -2, 3, -4, 5, etc. For \(\phi = 120^\circ\), it's -1, 2, -2, 3, -3, etc. Please note that we are not counting the first path here, which is along the x-axis already. This is reflected by the ever increasing "swings" of Anita's position, both in the x and in the y direction, as the length of her path increases. Secondly, if the first zero-crossing does occur within \([0, 1]\), it seems to always occur on the fourth path. For example, observe for \(\phi = 150^\circ\) and \(\phi = 165^\circ\). Also note that for \(\phi = 165^\circ\), the third path did NOT cross the x-axis at \(x = 0\), although it looked close. It is still \(x < 0\). In fact, it is not possible for Anita to cross her first path on her third path, a fact that we will prove later in the write-up.
Since I have the MATLAB code to plot Anita's walks, I can also easily tweak the logic to have it do a step search to find the minimum angle, which is something I did, just to get the answer, and the result revealed more observations that will be key to solving the puzzle in a more analytical fashion. Below is the MATLAB code, which I am showing for the top-level code for simplicity and clarity:
function find_min_angle()
% FIND_MIN_ANGLE()
% Finds the smallest turning angle (degrees) for which Anita crosses
% her initial 1-inch segment, then animates the corresponding path.
fprintf('Searching for smallest phi that causes a crossing...\n');
step_deg = 0.1; % search resolution
max_deg = 180; % upper bound
steps = 15; % max path segments
found_phi = NaN;
for phi_deg = step_deg:step_deg:max_deg
if crosses_for_angle(phi_deg, steps)
found_phi = phi_deg;
fprintf('First crossing occurs around phi = %.2f°\n', found_phi);
break;
end
end
if isnan(found_phi)
fprintf('No crossing found up to %.1f°.\n', max_deg);
else
draw_anita_path(found_phi, steps, true); % animate final path
end
end
Since turning angles \(\phi\) greater than \(180^\circ\) are just mirror images of their \((360^\circ\ - \phi)\) counterparts, i.e. having Anita turning clockwise rather than counterclockwise, I only needed to search from \(0^\circ\) up to \(180^\circ\). I let the search step be in \(0.1^\circ\) increments and for each test angle, I test for the crossing by having Anita walk up to 15 paths. Given the deviating nature of her walks, here I am assuming that if she can't cross her initial path after 15 steps, she will never be able to do so again. The minimum angle that I found to satisfy the zero-crossing of her initial path appears to be \(\boxed{138.6^\circ}\), which is a good numerical approximation. The answer to the original puzzle is therefore exactly \(\boxed{4 \text{ inches}}\). Here is Anita's actual walk from the puzzle:
However, I wanted to analyze Anita's walk from a more mathematical angle, so I proceeded to do a little bit more digging. Indeed, the minimum angle walk resulted in the initial crossing at the fourth step, but why? Can't earlier steps result in a crossing? Well, it is clear that the second walk can't result in a crossing, but what about the third step? Using the Cartesian plane, let \((x_k, y_k)\) be the co-ordinate of Anita after the \(k\)th walk. For example, \((x_1, y_1) = (1, 0)\). Given her turning angle \(0^\circ < \phi < 180^\circ\), we have:
\begin{align} (x_k, y_k) &= (x_{k-1} + k \cos{(k-1)\phi}, \,y_{k-1} + k \sin{(k-1)\phi}) \end{align}
So for example again, \((x_2, y_2) = (1 + 2\cos{\phi}, 2\sin{\phi})\). Now let's prove that Anita can never cross her initial path on her third step. If \(\phi = 90^\circ\), then her third path will be \(2\phi = 180^\circ\) with respect to her initial path, that is, her third path will be parallel to her initial path (and she will be traveling in the opposite direction), and so she will not cross her initial path. This can also be visualized in the earlier graph.
For \(\phi \neq 90^\circ\), let us write out \((x_3, y_3) = (x_2 + 3 \cos{2\phi}, y_2 + 3 \sin{2\phi})\). Slope is just rise/run and will be \(\frac{3 \sin{2\phi}}{3 \cos{2\phi}} = \tan{2\phi}\). The equation of the line containing the line segment of Anita's third step will be \((y - y_3) = m(x - x_3)\), where \(m\) is the slope. For x-crossing to occur, \(y = 0\). Substituting that into the equation of the line for \(x\) yields:
\begin{align} -y_3 &= m(x - x_3) \\ \\ -y_3 &= mx - mx_3 \\ \\ x &= \frac{mx_3 - y_3}{m}\\ \end{align}
Now we fully expand our equation:
\begin{align} x &= \frac{mx_3 - y_3}{m}\\ \\ &= \frac{\tan{2\phi}(1 + 2\cos{\phi} + 3 \cos{2\phi}) - (2\sin{\phi} + 3 \sin{2\phi})}{\tan{2\phi}} \\ \\ &= 1 + 2\cos{\phi} + 3 \cos{2\phi} - \frac{2\sin{\phi}\cos{2\phi}}{\sin{2\phi}} - 3\cos{2\phi} \\ \\ &= 1 + 2\cos{\phi} - \frac{2\sin{\phi}\cos{2\phi}}{2\sin{\phi}\cos{\phi}} \\ \\ &= 1 + 2\cos{\phi} - \frac{\cos{2\phi}}{\cos{\phi}} \\ \\ &= 1 + 2\cos{\phi} - \frac{2\cos^2{\phi} - 1}{\cos{\phi}} \\ \\ &= 1 + 2\cos{\phi} - 2\cos{\phi} + \frac{1}{\cos{\phi}} \\ \\ &= \boxed{1 + \frac{1}{\cos{\phi}}} \end{align}
So things actually simplified quite a bit! Keep in mind, \(0^\circ < \phi < 180^\circ\) and \(\phi \neq 90^\circ\). For \(\phi < 90^\circ\), \(\cos{\phi} > 0\) and so \((1 + \frac{1}{\cos{\phi}}) > 1\). For \(90^\circ < \phi < 180^\circ\), \(-1 < \cos{\phi} < 0\) and so \(\frac{1}{\cos{\phi}} < -1\) and thus \((1 + \frac{1}{\cos{\phi}}) < 0\). Either way, there is no way for Anita to cross in the interval \([0, 1]\) for \(x\) on her third step. This completes our proof.
Therefore, for the initial crossing to occur, it must happen at earliest on the fourth step or later. From the observation that the zero-crossings "diverge", we know that a lower bound for the minimum angle is at \(\phi = 120^\circ\), since it's the minimum angle for which the first zero-crossing is at \(x = -1\). Any angle smaller than that and the first zero-crossing makes it impossible for the second one, which will be positive, to land in \([0, 1]\).
Now since the math will get messy, I will use the graph visualizations to jump to the conclusion that if the positive zero-crossing does not happen by the fourth step, it will never happen. The positive zero-crossing that can be valid for Anita on the fifth path is within a narrow range of \(120^\circ \leq \phi < 126^\circ\). In fact, at \(\phi \approx 125.99^\circ\), the fourth path is the one that crosses the positive x-axis for the first time, as seen below:
However, even at this angle, the zero-crossings do not occur within \([0, 1]\), and I swept the range of \(120^\circ \leq \phi < 126^\circ\) and found that none of those angles also work. This concludes that \(\phi \ge 126^\circ\) and the zero-crossing must be on Anita's 4th step.
From earlier, we already numerically found the minimum angle to be around \(138.6^\circ\). Can we formally quantify it? Let's try. Visually, we observe that as \(\phi\) increases, the first positive zero-crossing decreases, and thus at the minimum angle, the point of intersection must be at \((1, 0)\). Let \(\theta\) be the minimum turning angle. We first need to establish an equation of the line containing Anita's fourth step, which is: \((y - y_4) = m(x - x_4)\). So we have:
\begin{align} (y - y_4) &= m(x - x_4) \\ \\ (0 - y_4) &= m(1 - x_4) \\ \\ y_4 &= m(x_4 - 1) \\ \\ 2\sin{\theta} + 3\sin{2\theta} + 4\sin{3\theta} &= (\tan{3\theta})((1 + 2\cos{\theta} + 3\cos{2\theta} + 4\cos{3\theta}) - 1)\\ \\ 2\sin{\theta} + 3\sin{2\theta} + 4\sin{3\theta} &= (\tan{3\theta})(2\cos{\theta} + 3\cos{2\theta} + 4\cos{3\theta})\\ \\ (\cos{3\theta})(2\sin{\theta} + 3\sin{2\theta} + 4\sin{3\theta}) &= (\sin{3\theta})(2\cos{\theta} + 3\cos{2\theta} + 4\cos{3\theta}) \\ \\ (\cos{3\theta})(2\sin{\theta} + 3\sin{2\theta}) &= (\sin{3\theta})(2\cos{\theta} + 3\cos{2\theta}) \\ \end{align}
So the equation that represents the minimum angle is:
\begin{align} (\cos{3\theta})(2\sin{\theta} + 3\sin{2\theta}) - (\sin{3\theta})(2\cos{\theta} + 3\cos{2\theta}) &= 0 \\ \end{align}
Now, let's use trig identities to solve for \(\theta\), our minimum angle. Recall that \(\sin{(a \pm b)} = \sin{a}\cos{b} \pm \sin{b}\cos{a}\), we have:
\begin{align} (\cos{3\theta})(2\sin{\theta} + 3\sin{2\theta}) - (\sin{3\theta})(2\cos{\theta} + 3\cos{2\theta}) &= 0 \\ \\ 2\sin{\theta}\cos{3\theta} + 3\sin{2\theta}\cos{3\theta} - 2\sin{3\theta}\cos{\theta} - 3\sin{3\theta}\cos{2\theta} &= 0 \\ \\ 2(\sin{\theta}\cos{3\theta} - \sin{3\theta}\cos{\theta}) + 3(\sin{2\theta}\cos{3\theta} - \sin{3\theta}\cos{2\theta}) & = 0 \\ \\ 2\sin{(\theta - 3\theta)} + 3\sin{(2\theta - 3\theta)} & = 0 \\ \\ 2\sin{(-2\theta)} + 3\sin{(-\theta)} &= 0 \\ \\ -2\sin{2\theta} - 3\sin{\theta} &= 0 \quad \text{sine is odd} \\ \\ 2\sin{2\theta} + 3\sin{\theta} &= 0 \\ \\ 4\sin{\theta}\cos{\theta} + 3\sin{\theta} &= 0 \\ \\ \sin{\theta}(4\cos{\theta} + 3) &= 0 \\ \end{align}
So we have either \(\sin{\theta} = 0\) or \((4\cos{\theta} + 3) = 0\). Now, since \(0^\circ < \theta < 180^\circ\), we can only have \((4\cos{\theta} + 3) = 0\). Thus, we have:
\(\theta = \boxed{\arccos\!\left(-\tfrac{3}{4}\right)} \approx 138.59^\circ\) for \(0^\circ < \theta < 180^\circ\). This matches with our numerical result! So this is our exact solution for the minimum angle.