## Saturday, 5 August 2017

### Bikes, Maths and The Big Pig

This morning I posted a question on Twitter to test how easily people get confused when thinking of averages. Within a few hours I had over a thousand answers, enough to confirm my hypothesis that the answer is "pretty easily".

[You can check the current live result here; the thread below is fun if you like that sort of thing]

Here's where I'd normally say something like "the correct answer is of course that it's impossible". That's the point of this test though - it's not obviously impossible because the majority of people intuitively went for the wrong answer.

I think the reason why this happens is interesting, but let's first quickly explain why the correct answer is that it's impossible.

The easiest way to explain is by illustration. In fact the reason I posed the question in the way I did was because I once actually experienced precisely this scenario when cycling on Majorca. I recognise this seems almost too good to be true, so for the doubters out there here's the Strava map of that ride and route profile.

The peak itself is known as "Puig Major" - I'm sure I'm not the only cyclist to have ground my way up there thinking Puig Major must mean "Big Pig" in Spanish1.

As you can see from the chart above it's precisely 10 miles up the hill. So if  - as in fact I did, back when I used to be fitter than I am now - you average 10 mph on the way up, it takes 1 hour to reach the summit.

At this point the impossibility of the challenge hopefully does become obvious. The total journey up and back down again is 20 miles, so to achieve a 20 mph average you'd clearly have to do the whole journey in an hour ... but you've already used all that hour just to get to the top of the hill.

***

The answer is of course2 true independent of the actual distance involved. It's easy enough3 to prove algebraically that it's impossible to double your average speed after you've covered half the distance of your journey (because you'd need to complete the second half of your journey in zero time):

***

I think part of the reason why most people instinctively get this wrong is explained in Kahneman's "Thinking, Fast and Slow" - we have a tendency to intuitively use the data that's closest to hand rather than taking the time to think if it's the right data.

So in this example we easily know it's the same distance up as it is down, so we instinctively calculate the total average as being the distance-weighted average of the two speeds (i.e. "half at 10 mph + half at 30 mph = all at 20 mph").

The problem is that we can't calculate average speed by weighting the two "halves" by distance, we have to weight them by time spent. So it would be correct to say "half the time at 10mph + half the time at 30 mph = all the time at 20mph" - but if you were to spend as long at 30 mph as you did at 10 mph, you'd travel 3x as far on the journey down!

The generic rule here - well worth remembering when sanity checking analyses - is you weight averages by the denominator not the numerator. Speed = Distance / Time, so to average two speeds you weight the total by the time spent at each speed, not the distance traveled

***

Having come this far I can't resist a little physics addition to this problem: why is it harder to achieve the same average speed on a hilly course than a flat one?

The potential energy you invest in to go up a hill you get back coming down, so you might think it should be just as easy to achieve the same average speed on a hilly course (that ends where it starts) as you could on a flat one. Cyclists will know this simply ain't so.

The answer is (at least in part4) to do with wind resistance being a function of the square of your speed: if you go twice as fast you incur four times the drag.

Let's imagine we went up our hill at 10 mph and down it at 30mph. We now know how to calculate our average speed: we spend 60 minutes at 10 mph and 20 minutes at 30 mph, so our average speed is 15 mph (10 x 60/80 + 30 x 20/80 = 7.5 + 7.5 = 15).

Now let's compare the wind-resistance work involved in doing a flat 20 miles at a constant 15mph with our up-and-down-the-hill alternative.

Work = Force x Distance

Distance is the same in both cases, Force is proportional to the square of speed.

The average square of speed in the flat scenario is easy = 15^2 = 225

The average (correctly weighted by time) square of speed in our hilly scenario = 100 x 60/80 + 900 x 20/80 = 75 + 225 = 300

We do 33% more wind-resistance work on our hilly ride.

***

OK, enough - I'm off to find somewhere flat to ride my bike5.

1. disappointingly it in fact just means "big hill"
2. here I go again
3. and again

4. there will be other moving-part speed-related friction factors which the existence of gears makes complicated
5. I live in East Lothian, that's not going to happen Anonymous said...

I cannot believe that your explanation of this can be possibly be true as your clearly not a proper mathematician. So there. Natch.

You got me. Anonymous said...

To be pedantic you asked what speed you would need to get an average of 20mph not 20.00mph.
The answer is you would need to cycle back down a 390 mile hill at 390mph to get an average of 20mph actually (19.5mph rounded to 20mph but your request was for an average of 20mph not 20.0mph). There are other answers but this is the slowest speed and shortest distance that you could achieve that average. Therefore relatively the safest speed! Beverley Cuddy said...

If the upward section was miles and that took 30 min sat 10mph if he managed to travel at 600mph (possibly by falling off a cliff) the average speed would be 20mph as that downward journey would only take 30 seconds. It worries me I have been worrying about this....more coffee perhaps.

Kevin Hague said...

sorry Beverley (hi by the way!) but that doesn't really work.

10mph for 30 mins = 5 miles
600mph for 5 miles = 30 seconds
so he's traveled 10 miles in 30.5 minutes = 19.67 mph

he can only achieve 20mph by getting back in no time (unless we're allowing rounding to come to our rescue!)