The Riddler puzzle this week appears simple at first glance, but I promise you it’s not!

You, a hard-driving sheep farmer, are tucked into the southeast corner of your square, fenced-in sheep paddock. There are two gates equidistant from you: one at the southwest corner and one at the northeast corner. An angry, recalcitrant ram enters the paddock from the southwest gate and charges directly at you at a constant speed. You run — obviously! — at a constant speed along the eastern fence toward the northeast gate in an attempt to escape. The ram keeps charging, always directly at you.

How much faster than you does the ram have to run so that he catches you just as you reach the gate?

Here is a very simple solution by Hector Pefo. Minimal calculus required!

[Show Solution]

**roughly 1.618**. Suppose from now on that the ram starts at $(a,b)$ instead. We’ll derive a formula for $v$ in terms of $a$ and $b$. See below for a diagram.

Suppose the path of the ram at time $t$ makes an angle $\alpha(t)$ with the path of the farmer. First, note that the total $y$-distance covered by the ram must be $1-b$. But we can also find this by projecting the path of the ram onto the $y$-axis. In other words:

\[

1-b = \int_0^1 v\,\cos\alpha(t)\,dt

\]Second, change reference frame so we imagine the ram moving in a straight line, always with the farmer in its sights. One component of the farmer’s motion contributes to shrinking his distance to the ram, while the other doesn’t affect the distance. The total distance traveled by the farmer *in the direction of the ram* can be found by projecting the farmer’s (now curved) path onto the ram’s path. The difference in the ram’s distance $v$ and the projected distance covered by the farmer is equal to the initial distance separating them since they ultimately reach the same spot:

\[

\sqrt{(1-a)^2+b^2} = v-\int_0^1\cos\alpha(t)\,dt

\]Even though we don’t know $\alpha(t)$, we can substitute one equation into the other to eliminate the integral and solve for $v$! The result is the equation:

\[

v^2-\sqrt{(1-a)^2+b^2}\,v-(1-b) = 0

\]Solving this quadratic equation for $v$ (discard the negative solution, since the ram’s speed is positive), we obtain the solution:

\[

v_\text{ram}=\frac{1}{2} \left(\sqrt{(1-a)^2+b^2}+\sqrt{(1-a)^2+(2-b)^2}\right)

\]If we specialize this formula to the ram starting at the southwest gate by setting $a=b=0$, we obtain the Golden Ratio:

$\displaystyle

(\text{Ram speed}) = \frac{1+\sqrt{5}}{2} \approx 1.618

$

And here is my solution, which finds an equation for the path of the ram but requires knowledge of calculus and differential equations.

[Show Solution]

I’ll derive the equations for the pursuit curves first, and then I’ll show some pretty pictures — hang on!

### Solution details

We’ll use the same coordinate setup as in the first solution, again assuming the ram starts at $(a,b)$. Suppose the ram’s position at time $t$ is $(x(t),y(t))$. From now on, we’ll simply write $x$ and $y$ to keep the notation clean. We are given two pieces of information: the ram always moves towards the farmer, and the ram’s speed is constant (let’s call it $v$). We can write these as:

\[

\frac{dy}{dx} = \frac{t-y}{1-x}

\qquad\text{and}\qquad

v\, t = \int_a^x \sqrt{1 + \left(\frac{dy}{d\xi}\right)^2}\,d\xi

\]The first equation forms the slope (see diagram above) while the second equation says that the arc length of the curve traced out by the ram should be $v$ times the distance traveled by the farmer. One might be tempted to substitute and eliminate $\frac{dy}{dx}$, but the remaining equation will still have $x,$ $y,$ and $t,$ so that doesn’t help us. Instead, isolate $t$ from the first equation and substitute it into the second equation to obtain

\[

y+(1-x)\frac{dy}{dx} = \frac{1}{v}\int_a^x \sqrt{1 + \left(\frac{dy}{d\xi}\right)^2}\,d\xi

\]We now have a single equation that relates $y$ and $x$ with no $t$-dependence! Differentiate both sides with respect to $x$ and let $w=\frac{dy}{dx}$. The result is the following separable ordinary differential equation

\[

(1-x)\frac{dw}{dx} = \frac{1}{v}\sqrt{1+w^2}

\]The general solution of this ODE has the form

\[

w = \frac{1}{2}\left( C(1-x)^{-1/v}-C^{-1}(1-x)^{1/v}\right)

\]Where $C$ is a constant that depends on the initial condition. We can solve for $C$ using the fact that when $t=0$, we have $x=a$ and $w=b/(a-1)$. The result is that

\[

C=(1-a)^{-1+1/v}\left(-b+\sqrt{(1-a)^2+b^2}\right)

\]Now recall that $w = \frac{dy}{dx}$ so we can integrate once more to obtain $y$ as a function of $x$, i.e. the path of the ram. We also have the initial condition $y(a)=b$. I’ll spare you the algebra… The result is

\begin{align}

y = b &+ \frac{1}{2}\left[

\frac{ b-\sqrt{b^2+(1-a)^2}}{1-1/v} \left(\left( \frac{1-x}{1-a} \right)^{1-1/v} – 1\right)\right.\\

&\qquad\qquad+\left.\frac{ b+\sqrt{b^2+(1-a)^2}}{1+1/v} \left(\left( \frac{1-x}{1-a} \right)^{1+1/v} – 1\right)

\right]

\end{align}So now we know everything! To figure out where the ram intercepts the farmer, set $x=1$ and obtain

\[

y_\text{final}=\frac{-b+v\sqrt{(1-a)^2+b^2}}{v^2-1}

\]If we know that the ram barely makes it to the northeast gate $(1,1)$ on time, set $y_\text{final}=1$ and solve for $v$. The simplified result is

\[

v_\text{ram}=\frac{1}{2} \left(\sqrt{(1-a)^2+b^2}+\sqrt{(1-a)^2+(2-b)^2}\right)

\]This is precisely the same result we found using the first method!

### Cool pictures!

Since we have an explicit formula for $y$ in terms of $x$, we can see what the ram’s path might look like for a variety of starting points. In the figure below, the farmer moves from the southeast corner to the northeast corner at a uniform speed, and each curve is a different ram’s path that starts along the western gate. Note: each ram chases the farmer, and each has a different speed that has been tuned to meet the farmer right at the end of his run.

Finally, suppose we know the speed of the ram. What is the “safe zone” outside of which the ram can’t reach the farmer in time? If you look at the formula for $v$, you’ll notice that it’s actually the average of two distances: the initial distance between the ram and the farmer, and the initial distance between the ram and the farmer’s reflection across the north fence. So if we fix the ram’s speed, the set of starting points $(a,b)$ describes an ellipse with the farmer and his reflection as the foci! See below for an illustration of the safe zones for different ram speeds.

I should point out that these trajectories are known as pursuit curves. Another notable example is circular pursuit, which was covered in a previous Riddler problem!

### Infinite pursuit

If the ram and the farmer have identical speeds, something interesting happens… As you might imagine, the ram never catches the farmer. But it turns out that if the farmer continues forever in a straight line, the ram will end up directly behind the farmer, always a *constant* distance away! The equations we derived for $y$ aren’t helpful in this case, so we must return the the beginning. Rearranging the equation for the slope gives us:

\[

t-y = (1-x)\frac{dy}{dx}

\]Now $t-y$ is precisely what we’re after; it’s the vertical distance separating the farmer from the ram. Substituting our expression for $\frac{dy}{dx}$ into this equation and setting $v=1$, we find

\begin{align}

t-y &= (1-x)\left( \frac{1}{2}\left( C(1-x)^{-1/v}-C^{-1}(1-x)^{1/v}\right) \right) \\

&= \frac{1}{2}\left( C-C^{-1}(1-x)^{2}\right)

\end{align}And in the limit $x\to 1$, this is simply

\[

\text{(limiting distance)} = \frac{1}{2}C = \frac{\sqrt{(1-a)^2+b^2}-b}{2}

\]So if the ram starts at $(0,0)$, the limiting distance between the farmer and ram will be $\frac{1}{2}$. Neat! If we ask for the set of all possible starting ram locations that yield a limiting distance of $\frac{1}{2}$, we get a different conic section: a parabola this time. Here is a plot showing the possible starting points for various limiting distances.