The tortoise and the hare are about to begin a 10-mile race along a “stretch” of road. The tortoise is driving a car that travels 60 miles per hour, while the hare is driving a car that travels 75 miles per hour. (For the purposes of this problem, assume that both cars accelerate from 0 miles per hour to their cruising speed instantaneously.)
The hare does a quick mental calculation and realizes if it waits until two minutes have passed, they’ll cross the finish line at the exact same moment. And so, when the race begins, the tortoise drives off while the hare patiently waits.
But one minute into the race, after the tortoise has driven 1 mile, something extraordinary happens. The road turns out to be magical and instantaneously stretches by 10 miles! As a result of this stretching, the tortoise is now 2 miles ahead of the hare, who remains at the starting line.
At the end of every subsequent minute, the road stretches by 10 miles. With this in mind, the hare does some more mental math.
How long after the race has begun should the hare wait so that both the tortoise and the hare will cross the finish line at the same exact moment?
By traveling 60mph, Tortoise can travel 1 mile per minute, which ends up being 1/10th of the 10 miles. By traveling 75mph, Hare can travel 1.25 miles per minute, or 1/8th of 10 miles.
Let’s observe that during the time interval \([0,1)\), the road is 10 miles long. At exactly \(t=1\) minute, Tortoise has traveled 1 mile, the road stretches to 20 miles long which stretches Tortoise to the 2 mile mark where he maintains his 1/10th proportion of the way. The road stays 20 miles long during the time interval \([1,2)\), where Tortoise travels another mile (or 1/20th of the distance of the road).
At some positive integer time \(t\), Hare has still not moved and the road stretches to \(10*(t+1)\) miles long. If he begins moving at time \(t\), on the time interval \([t,t+1)\) Hare travels 1.25 miles or \(\frac{1}{8(t+1)}\) of the distance. During the stretch to \(10*(t+2)\) miles at time \(t+1\), Hare maintains that same proportion of the distance. And so on.
Tortoise travels 1 mile during the first minute, which is 1/10th of the way. After the stretch, the road is now 20 miles long, so his 1 mile journey during the second minute is 1/20th of the way. After the next stretch, he will go 1/30th of the way, and so on.
We need to know at which point he will go the whole way. In other words, what number \(N\) will be such that \[ \frac{1}{10}+\frac{1}{20}+\frac{1}{30}+ \ldots + \frac{1}{10N} > 1 \] Multiplying both sides of this equation by 10, we need to find \[ 1+\frac12+\frac13 +\ldots + \frac{1}{N} > 10, \] or the 10th harmonic number. Although we could quickly look this up on the OEIS (indeed, it is sequence A004080), we’ll create a function that will be useful for us later.
## This harmonic function will take an input n, which will be the
## the number the harmonic series must sum to, and an optional k
## which will be the minute when we start summing the harmonic series.
harmonic <- function(n,k=0){
## The first term in our harmonic series will be S
S <- 1/(k+1)
## Keep track of the number of steps.
N <- 1
## while the series sum is still less than n, keep summing!
while(S<n){
# increment k and the number of steps, N
k<- k+1
N <- N+1
# add to our series
S <- S+1/(k+1)
}
# let us know how many steps it took.
return(N)
}
## Test the function to make sure it matches the first several values
## of the sequence given on OEIS: 1, 4, 11, 31, 83, 227, 616, 1674
## 4550, 12367
harmonic(1)
## [1] 1
harmonic(2)
## [1] 4
harmonic(3)
## [1] 11
harmonic(4)
## [1] 31
harmonic(10)
## [1] 12367
During the 12,367th minute, Tortoise will complete the race.
Hare is going to wait some number of minutes \(k\) before starting his race. If he began right away and waited 0 minutes, he would travel 1/8th of the entire way, however, by waiting \(k\) minutes, he’ll be first traveling only \(1/(8(k+1))\) of the way. We would like to know how many minutes it will take Hare to go the whole way. This is some number \(N\) such that \[ \frac{1}{8(k+1)}+\frac{1}{8(k+2)}+\frac{1}{8(k+3)}+\ldots + \frac{1}{8(k+N)} > 1, \] or, when you multiply both sides by 8, we’re looking for an N such that \[ \frac{1}{k+1}+\frac{1}{k+2}+\frac{1}{k+3}+\ldots +\frac{1}{k+N} > 8. \]
harmonic(8)
## [1] 1674
harmonic(8,1)
## [1] 4549
harmonic(8,2)
## [1] 7499
harmonic(8,3)
## [1] 10465
harmonic(8,4)
## [1] 13438
If Hare waits 4 minutes, it will take longer for him to finish the race. Beginning at 3 minutes, he will finish too early. Sometime after 3 minutes he will need to begin his journey.
Let’s work with Hare’s initial start, and start him at exactly 4 minutes. What fraction of the way does he need to go in order to finish during the 12,367th minute like Tortoise? We answer this by finding out what proportion of the distance Hare would travel up to immediatey befor the 12367th minute.
## Proportion of distance instantaneously before the 12367th minute:
sum(1/(8*(5:12367)))
## [1] 0.9895887
## What proportion would need to be added on for this to go the
## whole distance?
1-sum(1/(8*(5:12367)))
## [1] 0.01041129
## If I wanted to make this a fraction, what is the whole number
## denominator?
1/(1-sum(1/(8*(5:12367))))
## [1] 96.04957
Notice that \(8*12 = 96\). If Hare begins immediately at \(t=3\) minutes, he would have traveled \(\frac{1}{8*4}\) of the total distance, however, he only needs to travel \(\frac{1}{8*12}\) of the total distance which is 1/3rd of what he would have. So, if he begins exactly at 3 minutes and 40 seconds, he will travel the necessary proportion.
## Proportion traveled:
1/(8*12) + sum(1/(8*(5:12367)))
## [1] 1.000005
What is the proportion traveled by Tortoise during that same time?
sum(1/(10*(1:12367)))
## [1] 1.000004
When do they reach the end of the road? To answer, let’s find out what proportion of the distance they both have gone at \(t=12366\) minutes, then we stretch the road to 123670 miles and see how much distance each of them have left.
## Distance Hare has left
123670*(1 - 1/(8*12) - sum(1/(8*(5:12366))))
## [1] 0.5851458
## Distance Tortoise has left
123670*(1 - sum(1/(10*(1:12366))))
## [1] 0.4681167
Since Tortoise travels a mile per minute, it will take him exactly 0.4681167 minutes for him to travel the 0.4681167 miles he has left.
Hare travels 1.25 miles per minute, so it will take him
123670*(1 - 1/(8*12) - sum(1/(8*(5:12366))))/1.25
## [1] 0.4681167
the same exact number of minutes to finish the race!
By beginning at exactly 3 minutes and 40 seconds into the race, Hare will cross the finish line at the same moment Tortoise does.