This week’s Riddler Classic is a problem about minimum-time optimization.

While passing the time at home one evening, you decide to set up a marble race course. No Teflon is spared, resulting in a track that is effectively frictionless. The start and end of the track are 1 meter apart, and both positions are 10 centimeters off the floor. It’s up to you to design a speedy track. But the track must always be at floor level or higher — please don’t dig a tunnel through your floorboards. What’s the fastest track you can design, and how long will it take the marble to complete the course?

My solution:

[Show Solution]

We will consider a more general version of the problem, where the start and end are $\ell$ meters apart, and the floor is $h$ meters below. Set up coordinates so the track starts at $(0,0)$ and ends at $(\ell,0)$, with the $y$-axis pointing downwards, so we have the constraint $y\leq h$.

If there were no floor to worry about, then the optimal path would be a brachistochrone curve. All minimum-time tracks have a path of this shape, which is given by the parametric equations

\begin{align}

x &= r(\theta-\sin\theta) \\

y &= r(1-\cos\theta)

\end{align}Here, $r$ is a parameter that is chosen depending on the location of the endpoint. Moreover, the marble will travel along this path in such a way that $\theta$ changes at a uniform rate. In particular, $\theta(t) = \sqrt{\frac{g}{r}} t$. In order to have the curve pass through $(\ell,0)$, we should pick $r = \frac{\ell}{2\pi}$. This produces the following result when $\ell=1$:

Unfortunately, this path has a maximum height of $y(\pi) = 2r = \frac{\ell}{\pi} \approx 0.31831$. So if the floor is any closer than this, the track will run into it. To deal with this situation, we will seek a design in three stages:

- From $(0,0)$ to $(a,h)$ (moving down toward the floor).
- From $(a,h)$ to $(\ell-a,h)$ (moving along the floor).
- From $(\ell-a,h)$ to $(\ell,0)$ (moving back up to the endpoint).

We expect the solution to this problem to be symmetric, which is why we will assume the first and third segments of the path are mirror images of one another. Our task is to find $a$ and $r$ in order to minimize total time. Since the first segment is time-optimal, it must be a brachistochrone curve that passes through $(0,0)$ and $(a,h)$. Since it cannot dip below the floor, we must have $0\lt a \leq \frac{\pi h}{2}$ and since we must actually reach the floor, we must have $r \geq \frac{h}{2}$. Assuming it takes $\Delta T_1$ seconds to complete that portion of the path, we have

\begin{align}

a &= r(\theta-\sin \theta) \\

h &= r(1-\cos\theta) \\

\theta &= \sqrt{\frac{g}{r}} \Delta T_1

\end{align}Rearranging these equations, we can express $\theta,a,\Delta T_1$ in terms of $r$:

\begin{align}

\theta &= \arccos\left(1-\tfrac{h}{r}\right) \\

a &= r\left( \arccos\left(1-\tfrac{h}{r}\right)-\sqrt{1-(1-\tfrac{h}{r})^2} \right) \\

\Delta T_1 &= \sqrt{\frac{r}{g}}\arccos\left(1-\tfrac{h}{r}\right)

\end{align}

For the second portion of the path, the marble will travel at constant velocity $\sqrt{2gh}$ for a distance $\ell-2a$. So the total time $\Delta T_2$ for that portion satisfies

\[

\Delta T_2 = \frac{\ell-2a}{\sqrt{2gh}}

\]By symmetry, the third segment will take the same amount of time as the first one, so the total travel time is $\Delta T = 2\Delta T_1 + \Delta T_2$. Expressed in terms of $r$ alone, we get the complicated expression:

\begin{multline}

\Delta T = 2\sqrt{\frac{r}{g}}\arccos\left(1-\tfrac{h}{r}\right) \\

+ \frac{\ell-2r\left( \arccos\left(1-\tfrac{h}{r}\right)-\sqrt{1-(1-\tfrac{h}{r})^2} \right)}{\sqrt{2gh}}

\end{multline}Using calculus, we can verify that the first derivative of this expression with respect to $r$ is always positive. Therefore, the minimum value of $\Delta T$ occurs when $r$ is minimal. In other words, $r=\frac{h}{2}$. Substituting this in, we obtain the expression

\[

\frac{\ell+\pi h}{\sqrt{2 g h}}

\]Putting everything together, we can now write the complete solution to the problem. The minimum-time path has minimum time given by

$\displaystyle

\Delta T_\text{min} = \begin{cases}

\frac{\ell+\pi h}{\sqrt{2 g h}} & \text{if }0\lt h \leq \frac{\ell}{\pi} \\

\sqrt{\frac{2\pi \ell}{g}} & \text{if }h \gt \frac{\ell}{\pi}

\end{cases}

$

The second case corresponds to when the floor is far enough away that the fastest possible path (pure brachistocrone curve) does not touch the floor.

For the problem in question, we are told that $\ell=1$ and $h=0.1$ meters, so we are in the first case, and the minimum time is given by

$\displaystyle

\Delta T_\text{min}\text{ for $\ell=1$ and $h=0.1$ is }

\frac{1+0.1\pi}{\sqrt{2 g}} \approx 0.9382\,\text{sec.}

$

Here is what we get when we plot the time-optimal tracks for $\ell=1$ and several different values of $h$. The plot also includes the minimum times associated with each track.

If the floor is at height $h \leq \frac{\ell}{\pi}$ the equation of the first curved portion of the track follows the parametric equation from earlier, with $r=\frac{h}{2}$.

\[

\begin{aligned}

x &= \tfrac{h}{2}(\theta-\sin\theta)\\

y &= \tfrac{h}{2}(1-\cos\theta)

\end{aligned}

\qquad\theta\in[0,\pi]

\]The actual path traced out by the marble as a function of time is

\[

\begin{aligned}

x(t) &= \tfrac{h}{2}(\omega t-\sin\omega t)\\

y(t) &= \tfrac{h}{2}(1-\cos\omega t) \\

\omega &= \sqrt{\tfrac{2g}{h}} t

\end{aligned}

\qquad\text{with: }0\leq t \leq \tfrac{\pi\sqrt{h}}{\sqrt{2g}}

\]

I don’t have the technical skills required to make an animated gif of the marble moving along the curve at its appropriate speed, but the equations are above, so I’ll leave it up to somebody else!