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.

Neat about the ellipses!

There is, as you suggest, a simple way to obtain the length without SOLVING integrals, because you can eliminate integrals in equations for the total change in distance between farmer and ram (1 = integral[cos(a)]dt – vT) and the total y distance covered by the ram (1 = integral[v cos(a)]dt), where a is the angular difference in their paths at a given time, T the total time, and the integrals are from 0 to T. Then simple algebra and the quadratic formula gives v = (sqrt(5)+1)/2.

Wonderful! I was looking for a solution like this but couldn’t find one. I think I may have a solution that doesn’t use any calculus at all, but I think it may end up actually being more complicated than yours, so probably not worth it. I updated my solution to include yours. Thanks!

Inspired by the solution from Hector Pefo, here is a solution that does not use calculus. The key observation is that at each point, the speed of the ram in the y direction (the direction of the farmer’s movement) is v times higher than the speed of the farmer in the direction away from the ram. This is because the ram is v times faster than the farmer and the angle between the bearing of the ram and the y direction equals the angle between the bearing of the farmer (the y direction) and the direction away from ram (which equals the bearing of the ram).

At time 1, the ram (initially at (0,0)) and the farmer (initially at (1,0)) meet at (1,1), so the average speed in the y direction is 1. Thus, the farmer moves away from the ram with the average speed 1/v, so the ram approaches the farmer with the average speed v-1/v. At time 1, the distance between the farmer and the ram is 1-(v-1/v) = 0, so v^2-v-1=0 and v=(1+sqrt(5))/2.

Nice solutions!

What is the closed form equation of the trajectory of the ram when starting at $(0,0)$? The length of the trajectory of the ram is $v=\phi$. If the trajectory is an ellipse, this means the value of the elliptic integral is $\phi$ – how is this possible?

(NB – in your solution it might helpful to point out, for completeness, the assumption WLOG that the speed of the man is $1$. )

If you choose some fixed distance, the set of all possible ram starting points such that the ram ends up traveling this fixed distance forms an ellipse. The ram trajectories themselves, however, are

notellipses! To find the equation for the ram’s trajectory when starting from (0,0), set $a=b=0$ in my equation for $y$. Then you obtain:\[

y = \frac{1}{2}\left[ \frac{-1}{1-1/v} \left(\left(1-x\right)^{1-1/v} – 1\right)+\frac{ 1}{1+1/v} \left(\left(1-x\right)^{1+1/v} – 1\right)\right]

\]To find the appropriate value of $v$, use the formula for $v_\text{ram}$, again setting $a=b=0$, and you obtain

\[

v=\frac{1+\sqrt{5}}{2}

\]Here is a numerical approximation, rounding to 5 decimal digits:

\[

y = 1-1.30902\,(1-x)^{0.38197} + 0.30902\,(1-x)^{1.61803}

\]You can see that when $x=0$, $y=0$. And when $x=1$, $y=1$. This is a formula for $y$ in terms of $x$ for the ram’s trajectory, and it’s definitely not an ellipse.

Thanks for the clarification on the closed form (I managed to get the same from your original solution) and also for confirming that the ellipse reference was not for the trajectory.

It’s interesting to note that whilst the closed form for $y$ appears messy it can be written as

$$y=1-\int \sin(\frac 1v \ln (1-x)) dx$$.

I think you meant hyperbolic sin, correct?

\[

y=1-\int \sinh\left(\tfrac{1}{v}\log(1-x)\right)\,dx

\]

Yes! Sorry about the typo.

$$y=1-\int \sinh\left( \ln (1-x)\right) dx$$

(It’s great that your comments section accepts TeX input 🙂 Would it be too much to ask to include a preview box, like on math.stackexchange.com, in order to minimize typesetting errors since the comment can’t be changed once it’s posted?)

Aarrgh!

$$ y=1-\int \sinh \left(\frac 1v \ln (1-x) \right) dx$$

(Sorry about that, it’s past midnight here)

Couldn’t find an easy way to do previews, but I added a plugin that allows anonymous commenters to edit their posts for 5 min after posting.