This week’s Riddler Express features Alice and Bob in a race. Alice, the faster runner, wants to watch Bob’s humiliation for as long as possible. The race will be run on a down-and-back course. Alice wants to set her pace so that she will maximize the amount of time between her making the turn and her passing Bob on the way to victory. If Alice runs too slow, Bob will be too close behind her. If Alice runs too fast, she will speed past Bob.

# The Solution

Alice will have to run 141% faster than Bob. That is, Alice’s running speed will have to be 2.41 (or ) times Bob’s running speed. To find the solution, we need to use some Calculus.

The first step will be to write an expression for the time Alice is facing Bob, . Let be Bob’s running speed, be Alice’s running speed, and be the distance between the starting line and the turn around point. Since Alice wants to win the race, assume that . Set to be the time that Alice reaches the half-way points and be the time that Alice and Bob pass each other. That gives us the following expressions.

and

Now, we can write as a function of as shown below.

Finding the absolute maximum value of a function is a common Calculus problem. The first step is to find the critical points. The derivative of is given below.

Since the derivative exists for all , the only critical points are where . This last equation simplifies to the quadratic equation which has two solutions . Only the solution, , fits within the domain .

To check that does have an absolute maximum at , we need to check the values of at the “endpoints” of the domain and the critical point. That is, for , , and . This check gives , , and . Since, is the largest value in the list, we can be certain that the absolute maximum value of occurs at .

Using this pace, Alice will be able to face Bob for about 8.6% of the total race duration. That is not counting the time that Alice waits on Bob at the finish line.

I’m almost getting the hang of plotting in R.

# Filling in Some Details

There are a few steps above that I skipped. I will fill in the details now.

First, to find a formula for , I used the fact that at , the distance that Bob ran will be equal the distance remaining for Alice. This sets up the equation below, which I solved for .

To get the quadratic equation from , I used the following steps.

Thanks to Graydon Snider for the excellent problem.