This week’s Riddler Classic is a problem involving traversing a triangle.

Amare the ant is traveling within Triangle ABC, as shown below. Angle A measures 15 degrees, and sides AB and AC both have length 1.

Amare must:

- Start at point B.
- Second, touch a point — any point — on side AC.
- Third, touch a point — any point — back on side AB.
- Finally, proceed to a point — any point — on side AC (not necessarily the same point he touched earlier).
What is the shortest distance Amare can travel to complete the desired path?

I solved the problem in two different ways. The elegant solution:

[Show Solution]

Reflect the triangle about the line $AC$, so $B \mapsto B’$ and $E \mapsto E’$, as shown:

Now reflect the new triangle about the line $AB’$, so $C\mapsto C’$ and $F \mapsto F’$:

The key insight is that since the reflections preserve lengths, the path $BD+DE+EF$ followed by Amare has the same length as the path $BD+DE’+E’F’$ shown in red below:

If we move the points $E$ and $F$, then the points $E’$ and $F’$ move accordingly, and we obtain another possible path:

Rather than picking $D,E,F$, we can instead pick $D,E’,F’$. Since the goal is to minimize the total distance, it’s clear that we should place $F’$ such that $AF’ \perp BF’$, and $D$ and $E’$ should be placed so that all three points lie on a line. This produces the figure:

So the shortest distance Amare can travel can be found by examining the right triangle $ABF’$. Since $AB$ has length $1$, we conclude that that

$\displaystyle

\text{Minimum distance } = \sin(3\theta)

$

In the case where $\theta = 15^\circ$, we get a length of $\sin(45^\circ) = \frac{1}{\sqrt{2}} \approx 0.7071$.

Note that this solution only works if $3\theta \lt 90^\circ$, i.e. $0 \lt \theta \lt 30^\circ$. In the case that $\theta \geq 30^\circ$, we obtain the degenerate solution $D = E = F = A$, so Amare should head directly to point $A$ and the total distance traveled is $1$.

And the more complicated solution:

[Show Solution]

We can also use calculus to solve the problem. Let’s start with the same picture as before:

Suppose $|AD|=x$, $|AE|=y$, and $|AF|=z$. From the law of cosines:

\begin{align}

|BD| &= \sqrt{1+x^2-2x\cos(\theta)} \\

|DE| &= \sqrt{x^2+y^2-2xy\cos(\theta)} \\

|EF| &= \sqrt{y^2+z^2-2yz\cos(\theta)}

\end{align}Let $f(x,y,z)$ be the sum of these three distances, which is the total distance traveled by Amare. We want to find $x,y,z$ such that $f(x,y,z)$ is minimized. A necessary condition for minimality is that the partial derivatives of $f$ with respect to $x,y,z$ should be zero. Let’s start with $z$:

\[

\frac{\partial}{\partial z}f(x,y,z) = \frac{z-y \cos (\theta )}{\sqrt{y^2+z^2-2 y z \cos (\theta )}}

\]Setting this equal to zero, we conclude that $z=y\cos(\theta)$. We can now substitute this value of $z$ into the definition for $f$ and we obtain a simpler expression in only two variables:

\begin{align}

g(x,y) &= f(x,y,y\cos(\theta)) \\

&= \sqrt{1+x^2-2x\cos(\theta)} + \sqrt{x^2+y^2-2xy\cos(\theta)} + y\sin(\theta)

\end{align}To make sure there is no funny business going on, let’s plot this function to see what it looks like for $\theta=15^\circ$. Here is a contour plot:

We can clearly see that there is a unique minimum that occurs in the region near $(x,y) \approx (0.8,0.7)$. Ok, so let’s proceed. Consider now the derivative with respect to $y$:

\[

\frac{\partial}{\partial y} g(x,y) = \frac{y-x \cos (\theta )}{\sqrt{x^2+y^2-2 x y \cos (\theta )}} + \sin (\theta )

\]Setting this equal to zero (I’ll spare you the algebra), we obtain $y = x \cos(2\theta)\sec(\theta)$. Substituting this into $g(x,y)$, we obtain a function of just $x$:

\begin{align}

h(x) &= g(x,x \cos(2\theta)\sec(\theta)) \\

&= \sqrt{1+x^2-2 x \cos (\theta )}+x \sin (2 \theta )

\end{align}Finally, we can take the derivative with respect to $x$:

\[

\frac{\partial}{\partial x}h(x) = \frac{x-\cos (\theta )}{\sqrt{1+x^2-2 x \cos (\theta )}} + \sin (2 \theta )

\]Solving for $x$, (sparing you the algebra again!) we obtain $x = \cos (3 \theta ) \sec (2 \theta )$. Putting everything together, the $(x,y,z)$ that minimize the total distance traveled by Amare is

\[

x = \cos (3 \theta ) \sec (2 \theta ),\quad

y = \cos(3\theta)\sec(\theta),\quad

z = \cos(3\theta)

\]Substituting into either $h(x)$, $g(x,y)$, or $f(x,y,z)$, we obtain the minimum distance traveled by Amare (after simplification):

$\displaystyle

\text{Minimum distance } = \sin(3\theta)

$

If you read the first solution, then it should come as no surprise that the total distance is also equal to $\sqrt{1-z^2}$, since (based on the last figure of the first solution), we have $z=|AF|=|AF’|$ and $|BF’|^2 + |AF’|^2 = 1$ by the Pythagorean theorem.

Elegantly done! I used calculus but live for solns like this where the appropriate framing makes the solution trivial. Well done.

BTW, I publish a blog of math probs and solutions too at: https://www.starvind.com/category/math/puzzles-problems/

Thanks! Your blog is very nice, thanks for the link!