# Inverse Speed

> One must always invert.

\- [Carl Gustav Jacobi](http://en.wikipedia.org/wiki/Carl_Gustav_Jacob_Jacobi)

I'm grateful to [orthonormal](/lw/5f/bayesians_vs_barbarians/3qzr) for mentioning the following math problem, because it allowed me to have a significant confusion-dissolving insight (actually going on two, but I'll only discuss one in this post), as well as providing an example of how [bad I am](/lw/4pe/lw_is_to_rationality_as_aixi_is_to_intelligence/3n80) [at math](/lw/4vk/what_is_wrong_with_mathematics_education/3pzu):

> "\[I\]f you want to average 40 mph on a trip, and you averaged 20 mph for the first half of the route, how fast do you have to go on the second half of the route?" 

When I read this, my first thought was "Huh? If you spend an hour going 20 mph and then spend another hour going 60 mph, you've just gone 80 miles in 2 hours -- for an average speed of 40 mph, just as desired. So what do you people mean it's impossible?"

As you can see, my confusion resulted from interpreting "half of the route" to refer to the total _time_ of the journey, rather than the total _distance_.

This misinterpretation reveals something fundamental about how I ([I know better by now than to say "we"](/lw/dr/generalizing_from_one_example/)) think about _speed_.

In my mind, speed is a _mapping_ from _times_ to _distances_. The way to compare different speeds is by holding time constant and looking at the different distances traversed in that fixed time. (I know I'm not a total mutant in this regard, because even other people tend to visually represent speeds as little arrows of varying length, with greater lengths corresponding to higher speeds.)

In particular, I _don't_ think of it as a mapping from _distances_ to _times_. I don't find it natural to compare speeds by imagining a fixed distance corresponding to different travel times. Which explains why I find this problem so difficult, and other people's explanations so unilluminating: they tend to begin with something along the lines of "let d be the total distance traveled", upon which my brain experiences an error message that is perhaps best verbalized as something like "wait, what? Who said anything about a fixed distance? If speeds are varying, distances have to be varying, too!" 

If speed is a mapping from times to distances, then the way that you add speeds together and multiply them by numbers (the operations involved in averaging) is by performing the same operations on corresponding distances. (This is an instance of the general definition in mathematics of addition of functions: (f+g)(x) = f(x)+g(x), and similarly for multiplication by numbers: (af)(x) = a*f(x).) In concrete terms, what this means is that in order to add 30 mph and 20 mph together, all you have to do is add 30 and 20 and then stick "mph" on the result. Likewise with averages: provided the times involved are the same, if your speeds are 20 mph and 60 mph, your average speed is 40 mph. 

You cannot do these operations nearly so easily, however, if distance is being held fixed and time varying. Why not? Because if our mapping is from times to distances, then finding the time that corresponds to a given distance requires us to _invert_ that mapping, and there's no easy way to invert the sum of two mappings (we can't for example just add the inverses of the mappings themselves). As a result, I find it difficult to understand the notion of "speed" while thinking of time as a dependent variable. 

And that, at least for me, is why this problem is confusing: the statement doesn't contain a prominent warning saying "Attention! Whereas you normally think of speed as the being the (longness-of-)distance traveled in a given time, here you need to think of it as the (shortness-of-)time required to travel a given distance. In other words, the question is actually about _inverse speed_, even though it talks about 'speed'."

Only when I have "inverse speed" in my vocabulary, can I then solve the problem -- which, properly formulated, would read: "If you want your inverse speed for the whole trip to be 1/40 hpm, and your inverse speed for the first half is 1/20 hpm, how 'slow' (i.e. inversely-fast) do you have to go on the second half?" 

**Solution**: _Now_ it makes sense to begin with "let d be the total distance"! For inverse speed, unlike speed, accepts distances as inputs (and produces times as outputs). So, instead of distance = speed*time -- or, as I would rather have it, distance = speed(time) -- we have the formula time = speed^-1^(distance). Just as the original formula converts questions about speed to questions about distance, this new formula conveniently converts our question about inverse speeds to a question about times: we'll find the time required for the whole journey, the time required for the first half, subtract to find the time required for the second half, then finally convert this back to an inverse speed.

So if d is the total distance, the total time required for the journey is (1/40)\*d = d/40. The time required for the first half of the journey is (1/20)\*(d/2) = d/40. So the time required for the second half is d/40 - d/40 = 0. Hence the inverse speed must be 0.

So we're being asked to travel a nonzero distance in zero time -- which happens to be an impossibility.

Problem solved. 

Now, here's the interesting thing: I'll bet there are people reading this who (despite my best efforts) found the above explanation difficult to follow -- _and yet had no trouble solving the problem themselves_. And I'll bet there are probably also people who consider my explanation to be an example of belaboring the obvious.

I have a term for people in these categories: I call them "good at math". What unites them is the ability to produce correct solutions to problems like this without having to expend significant effort figuring out the sort of stuff I explained above.

If for any reason anyone is ever tempted to describe _me_ as "good at math", I will invite them to reflect on the fact that an _explicit understanding_ of the concept of "inverse speed" as described above (i.e. as a function that sends distances to times) was a _necessary prerequisite_ for my being able to solve this problem, and then to consider that problems of this sort are customarily taught in middle- or high school, by middle- and high school teachers.

No indeed, I was not sorted into the tribe of "good at math".

I should find some sort of prize to award to anyone who can explain how to solve "mixing" problems in a manner I find comprehensible. (You know the type: how much of x% concentration do you add to your y% concentration to get z% concentration? _et similia_.)