Thursday, August 18, 2011

Fun with Calculus and Airplane Baggage Fees

Today I thought I'd do a little mathematical analysis of Hawaiian Air's luggage handling fee scheme using some simple calculus. Hey, wait, keep reading! I promise I'll try to keep it interesting, and the formulae to a minimum.

I don't remember when I first started wondering about the luggage fee scale used by Hawaiian Air, but it was probably the first time I was checking my own bags in and discovered that the fees go up – way up – upon checking more than one or two bags. But they didn't vary in any sort of predictable way that I could see, so I took the liberty of plotting them out, as you can see below:
Checking one bag with Hawaiian Air will set you back a reasonable $25; two bags,$60; three, and it jumps to $185; four, five, six, and seven will set you back$310, $435,$560, and $760, respectively; and 8 bags will leave your wallet lighter to the tune of$960. Now as you can see from the graph, the amount that it goes up is not uniform. To analyze how it changes, we can look at the slope. Because there are only a small number of points, we can easily calculate the slope between each one, which is equivalent in calculus to taking the first derivative. Taking the slopes using the simple equation s = (y2-y1)/(x2-x1) (I was lazy and wrote a quick routine in Python to do it for me) gives us $25/bag for the first bag,$35/bag for the second one, $125/bag for the third, fourth, and fifth ones, and$200/bag for the seventh and eighth.

Now, while this tells us how fast the fee is changing per bag, we can get more information out of it by taking a second derivative and find out how fast the rate of change is itself changing. For example, it looks on the graph like the biggest jump in terms of absolute price is between the second and third bag, and if we take the  second derivative (essentially taking the slope of the points formed by taking the first derivative) we see that this is indeed the case. Taking the second derivative, we see that the price increases by $10 dollars for the second bag ($35 instead of $25),$90 for the third bag, 0 for the fourth, fifth and sixth ones, \$75 for the seventh, and 0 for the eighth again. Minima and maxima (the largest and smallest values) of the second derivative tell us exactly where the function is changing its value most rapidly, so we can see that the biggest change is between two and three bags.

So what's the lesson we get from all this? First, calculus isn't very difficult, and knowing it can enrich your life in many unexpected ways. In fact, calculus is like a fruit tree; you spend time planting it, watering it, and nurturing it, and in return it continues to delight you with delicious fruit long into the future. In many ways I think calculus is simpler than algebra, trigonometry, or geometry, yet so many people are afraid to try it because of preconceived notions about their mathematical ability. To put it another way, calculus is like color vision; neither is essential to life, yet lack of either leaves the world a drab and dreary place.

Secondly, try to avoid taking three bags on Hawaiian Air if you can, it just gives you the worst bang for your buck, so to speak. Stick with two, or one if possible.

1. I might point out that not everyone has color vision and I understood very little of that analysis. It was interesting, though, and I appreciate the usefulness!

Did you have to take three bags, then? I tried very hard for one and ended up with 1 1/2...

2. I'm aware of color blindness, and feel sorry for those who have it and thankful that I don't. I'm an astronomer, color is pretty much what I work with (well ok, technically astronomers work well outside the visible spectrum all the time, but still...).

It also wasn't the best analysis I could have done, but it also didn't strictly need calculus to do, either, as it was a curve with a finite number of points. Technically, I didn't even use calculus for the computations, just the principles for analysis. Maybe I'll try to explain it better one of these days.

And finally, no, I only had two bags, and neither was completely full. But you can bet I will do everything I can to avoid three...

3. Color vision used to be essential for people, back in the day. In fact, one reason humans and most other primates are trichromatic is because we are omnivorous, so being able to distinguish fine shades of red made the difference between eating a nutritious fruit and eating something poisonous.

Think I said something interesting or insightful? Let me know what you thought! Or even just drop in and say "hi" once in a while - I always enjoy reading comments.