Thursday, July 4, 2013

Harmonic Mean

In mathematics there are several ways to take the mean (average) value.
The most well known is the arithmetic mean, which is the just average we usually think about.
But today I would like to mention about "Harmonic Mean".
Harmonic Mean of two numbers X and Y is

2/(1/X   +  1/Y)

I come up with an instance to use harmonic mean.
Suppose I live at the foot of a hill, my office is at the top of the hill, and
I drive a roundtrip between my home and my office.
Furthermore, suppose my MPG( millage per gallon) is 10 for upward and 40 for downward for sake of simplicity.
Then my MPG for the round trip must be computed as follow:
MPG = # miles driven/ # gallon consumed.
Let D be the # miles in one way.
So #miles driven for the round trip is 2D

then #gallon for up should be D/10, and
       #gallon for down should be D/40.
So  # gallon consumed for the round trip is the sum D/10 + D/40.

Hence, MPG = (2D) / (D/10 +D/40)

                     = 2/(1/10 + 1/40) = 80/5 = 16 mpg.

Notice that the distance D is irrelevant to find the average fuel consumption for the round trip.
The blue part (obtained from above line by dividing top and bottom of the expression by D.)
is exactly the harmonic mean of 10 and 40. So in this sense 16 is the average mpg of 10 and 40.

Now I want to improve my overall mpg by driving mildly.
Which strategy  works better?
1. Improve only my uphill consumption rate from 10mpg to 20mpg.
2. Improve only my down consumption rate from 40mpg to 80mpg.

The first strategy will result to 26.666 mpg, pretty good.
But....
the second strategy will result to 17.777 mpg......Not much change!

Here is the lesson.
To improve the harmonic mean, one should consider improving the lower value.
Improving the lowest performer will result a better overall performance.
Help the most struggling worker will do better than help the talented one to go further.
Isn't it Harmonic??
Anyway, in reality, my commuting route has lots of short sloped roads, disgusting traffic lights,
and entrance to a freeway. If I can pass these mpg-killing points with mild loss of fuel, my over all mpg will improve a lot. In fact after I realized this, my MPG is improving from 39 to 46!
Thinking mathematically saves lots of fuels and money!
(I lied here, it doesn't save much money for me because I live close to my office.)

No comments:

Post a Comment