Speed Discrepancy

Imagine that you biked 100 miles at an average speed of 29 miles per hour (max instantaneous speed: 40mph). Naturally you want to know if that’s a world record. Well, no one cares about imperial units [citation needed] but the record for 100 kilometers is, converted to miles per hour, 28.53. Surely if you can average 29mph for 161km you can go even faster for just 100km. But can you prove you actually broke the 100km record? Is there necessarily some contiguous 100km segment of your century ride for which you broke the 28.53mph record?

What’s the slowest possible speed for your fastest 100km segment?

Here’s another version of the same question: You run a marathon (26.2 miles) and your mile pace for every mile is slower than 8 minutes/mile (7.5mph). Not just every successive mile, but for every interval [x, x+1] of the racecourse, your average speed over that 1-mile interval is slower than 7.5mph. You can also safely say you never went faster than 3 minutes/mile (20mph) as an instantaneous speed. What’s the fastest possible speed you could theoretically have averaged for the whole marathon?

And now to generalize it:

  • d is the distance of the whole race
  • s is a distance smaller than d
  • w is your fastest average speed for any contiguous segment of length s
  • v is your average speed for the whole race
  • m is your max instantaneous speed during the race

In the biking example, we have d = 100 miles , s = 62.1 miles (100km), v = 29mph, and m = 40mph. In that case we’re looking for a formula for w in terms of the other variables.

In the marathon example, we have d = 26.2 miles, s = 1 mile, w = 7.5mph (8 minutes per mile), and m = 20mph. Here we’re looking for a formula for v in terms of the other variables.

I was very surprised by the answers. Can you articulate the intuition for what makes them possible?

Source: Stan Wagon

The obvious pessimization strategy for the bike ride is to ride always at 40 mph, except for a break at the midpoint where you hang around and wait (without moving, at 0 mph) enough to bring the average down to 29 mph. Because 100 miles is less than twice as much as 100 km, any contiguous 100 km segment will include this break, and thus bring its own average even lower than the overall average.

The necessary wait interval I is \frac{d}{v} - \frac{d}{m} — the difference between how long the trip would take at the average speed (29 mph, in this case) and how long it would take at max speed (40 mph) all the way.

In this case, that means that I = \frac{100 \space mi}{29 \space mph \space} - \frac{100 \space mi}{40 \space mph \space} = 3.448 \space h - 2.5 \space h = 0.948 \space h

Any 100 km interval will include this I = 0.948 \space h wait interval, and 100 km of cycling at 40 mph. 40 mph is 64.37 kph, so in total this takes I + s / m = 0.948 \space h + \frac{100 \space km}{64.37 \space kph} = 0.948 \space h + 1.554 \space h = 2.502 \space h.

100 km in 2.502 hours is 39.968 kph, or 24.835 mph, well under the 28.53 mph record.

1 Like

As to the marathon question, maybe I’m missing something, but (theoretically) why couldn’t you have run the full maximum instantaneous speed (20 mph) the whole way, thus averaging 20 mph? This meets the condition of never running any mile-long interval at under 7.5 mph, of course.

Because I confused myself with the silly runner convention of talking about speeds as reciprocals of normal-person speeds. I said “under” 8 minutes per mile but I meant slower. I’ve now edited the problem statement. Thank you!

1 Like

I’m realizing how tricky it is to state this precisely, especially for the general case. It’s a min-max problem where we’re asking for the worst best-case. So we’re asking for the largest possible discrepancy between “fastest speed in any sliding window” and “overall average speed for the whole race”.

Nice job from @zzq making the bike ride version nice and clear! I think the marathon version will be a bit more interesting. And the general formula I think is pretty elegant.

1 Like

The base intuition that makes the discrepancy quite intuitive (to me) is that the shorter your total distance is, the greater is the harm to your average speed that wasting time causes you. This is because the longer your distance, the more you can amortize the harm of wasting time.

This is probably actually even clearer when using inverse units, hours per mile rather than miles per hour. In the bike race case, you have a time budget of 1/29th of an hour per mile, or over the whole 100 mile race, 100/29 hours (3.448 hours). But by the max speed rule, you are forced to spend at least 1/40th of an hour on each mile of the race, so 100/40 hours (2.5 hours) are already accounted for, leaving you with only 3.448 - 2.5 = 0.948 hours to spend as you wish.

In my simple example I had you spend that entire time at a standstill in the middle of the course. But you could equally well spend that time by taking some middle segment at some positive but lower than 40 mph speed so as to extend the total time by 0.948 hours. (Relative to going at max speed the whole time.) So long as you spend an extra 0.948 hours somewhere, that lowers the overall average to 29 mph, and so long as you spend them not closer than 61 km to either end of the track, that extra time is spent fully within any contiguous 100 km stretch. Amortizing that time over 100 km will necessarily result in a lower average speed than amortizing it over 100 miles—the question only is if it does so enough to lower the 100 km average below the world record threshold (which in this case it does.)

So long as you’re spending all that 0.948 hours in such a way that it’s included in all possible 100 km contiguous stretches, all your 100 km contiguous stretches will be equally bad: thus the slowest possible speed for the fastest 100 km segment is what I achieved above—24.835 mph.

Likewise, this “silly runner convention” of using the reciprocal speed, minutes per mile, makes the marathon case fairly simple. Run the full thing at max instantaneous speed, 20 mph, but stop at each mile marker for 5 minutes (8 - 3 = 5), and as each contiguous 1 mile interval, no matter where it starts, passes (no less than) one mile marker, this means that each contiguous mile takes (no less than) 8 minutes (three running, five waiting) as is required.

(Actually, as worded, the 7.5 mph average limit is exclusive—“slower than”, rather than “no faster than”. So imagine I said to wait for 5 + \varepsilon minutes. Note also that the inclusivity of the [x, x+1] intervals in which we must run slower than 7.5 mph means that actually some of the intervals will include two mile markers, one at each end, and thus will have an even lower average speed than most segments, but that’s allowed.)

Running a whole marathon at 20mph (three minutes a mile) takes 26.2 \cdot 3 = 78.6 minutes. Waiting around at 26 mile markers for 5 minutes apiece takes 26 \cdot 5 = 130 minutes. In total, that’s 208.6 minutes, or 7.962 minutes per mile; in other words, 208.6/60=3.477 hours, averaging 7.535 mph.

In fact, as in the bike race, while it’s easier to calculate when you always are either at max speed or a standstill, all that really matters is that you somehow waste 5 minutes each mile, above and beyond the mandatory 3 minutes, but no more. You could equally well alternate half-mile segments at 20 mph and at 4.615 mph, because then any given mile-long interval will include half a mile at each of those two speeds (even if it starts in the middle of one of the two, it will pick up what it missed during the next iteration of that segment), and thus the average speed in each such mile interval is 7.5 mph. Or you could alternate 0.2 mile segments at 20 mph and 0.8 mile segments at 6.486 mph. Intuitively, the way this works is that you can set it up so that both the first 0.2 miles of the race and the final 0.2 miles are fast, without counterbalancing that final fast segment with a following slow segment.

This also shows that the only reason you can beat 7.5 miles per hour overall is that a marathon is not an integer number of miles.

1 Like

Now for the general formula.

\frac{d}{m} is the amount of time that is “baked in” by your max speed; that is, it’s the amount of time the race would take if you went at max speed the entire time.

\frac{d}{v} is the amount of time the race actually takes you. So I = \frac{d}{m} - \frac{d}{v} is the amount of time that’s free for us to decide how to allocate.

First, the case in which d < 2s. In such a case, all segments of length s overlap the half-way point, and thus if we allocate all of I to that point—or indeed to anywhere within the segment of length 2s - d around it in which one is less than s away from both the start and the finish lines—that time is fully included in any segment of length s. So \frac{s}{m} + I is the amount of time spent on each such s-length segment—the first term being the amount of time it takes to run it at max speed, and the second being the waiting-around time.

So, the average speed for such a segment is \frac{s}{\frac{s}{m} + I} = \frac{s}{\frac{s}{m} + \frac{d}{m} - \frac{d}{v}} = \frac{s}{\frac{s+d}{m} - \frac{d}{v}}. This is w, because all length-s segments include the maximum allowed amount of wasted time, I; and thus this is the only, and thus fastest, average speed for such a segment. (We can’t do better, and have a slower fastest speed, because we’re already wasting all the time we’re allowed to.)

What about if s is less than half d? Then you can’t put all the wasted time in the middle in such a way that all segments of length-s include it. If 2s < d < 3s, then by putting half of the wasted time at the one-third point and the other half at the two-thirds point, any length-s segment overlaps at least one of them. You can’t get the fastest segment to include more than half of the wasted time, because if you put more than half the wasted time in (WLOG) the first half of the track, segments that don’t overlap the first half of the track (which exist, because by assumption s is less than half of d) will include less than half the wasted time, and thus be faster.

So: best we can do is make all length-s segments include I/2 wasted time. Thus, much like above: w = \frac{s}{\frac{s}{m} + I/2} = \frac{s}{\frac{s}{m} + \frac{d}{2m} - \frac{d}{2v}}.

In general, by that same argument, if for some integer k we have ks < d < (k+1)s, best we can do is split the wasted time I into k equally-sized portions spaced along the track at equal intervals. This ensures that at least I/k is wasted on any length-s segment. Nor can we do better (that is, slower), because if we divide the track into k equally sized and spaced segments S_{i} where i=1, 2, …, k and we spend more than I/k time in any given one of them, then there must be some i such that we spend less than I/k time in S_i, and thus we have a length s segment (specifically, S_i) where we’re faster. (That is—WLOG, say that we spend more than I/k time in S_1 and no less than I/k time in each of S_2, …, S_{k-1}. But then we have less than I/k time available to us to spend in S_k.)

This gives us a general formula using this k, which is \lfloor \frac{d}{s} \rfloor. Best we can do is ensure that we spend \frac{I}{\lfloor \frac{d}{s} \rfloor} in each length-s segment, so our worst fastest speed w will be:

w = \frac{s}{\frac{s}{m} + \frac{I}{\lfloor \frac{d}{s} \rfloor}} = \frac{s}{\frac{s}{m} + \frac{\frac{d}{m} - \frac{d}{v}}{\lfloor \frac{d}{s} \rfloor}}

That is to say: worst case, to run a length-s segment we’ll need to spend a \lfloor \frac{d}{s} \rfloor share of the wasted time I, above and beyond the time it takes to run that segment (\frac{s}{m}). Adding those two times, we get the total worst-case fastest time, and we can divide the length s by it to get the worst-case fastest speed.