Friday, April 14, 2006

Adventures with Logarithms

You've probably heard this joke (or a variant) before:

The ark lands after The Flood. Noah lets all the animals out. Says, "Go forth and multiply." Several months pass. Noah decides to check up on the animals. All are doing fine except a pair of snakes. "What's the problem?" says Noah. "Cut down some trees and let us live there," say the snakes. Noah follows their advice. Several more weeks pass. Noah checks on the snakes again. Lots of little snakes, everybody is happy. Noah asks, "Want to tell me how the trees helped?" "Certainly," say the snakes. "We're adders, and we need logs to multiply."

(Source: Math Jokes page)

The question is, do you understand what the snakes are talking about (i.e. what makes this joke funny)? If not, read on, and learn the secrets of logarithms and the workings of the slide rule!

What's 10 × 10? It's 100, but recall that we can also write it as 102. Basically, when we're multiplying, we just collect all the like bases (10 in this example), and add their exponents together (1+1 = 2).

So what's 2 × 4 × 12? It's 96, but we could write it as 25x 31, because 2 × 4 × 12 = 2 × 4 × 4 × 3 = 21 × 22 × 22 × 31 = 21+2+2 × 3.

We can even use the nifty exponent-adding trick for fractional powers. For example, the square root of 2, sqrt(2), is 21/2 in exponential notation. Likewise, the cube root of 2, cubrt(2), is 21/3. So if we had 25 × sqrt(2), we could express it as 25+1/2 = 211/2.

Suppose we wanted to express the number 2 in terms of a power of ten. The question is, for what value of x does 10x = 2? We know that 100 = 1 < 2 < 101 = 10, so 0 < x < 1. And the square root of 10 is approximately 3.16, so 0 < x < 1/2. The fourth root of 10, 101/4, is approximately 1.78, so now we know that 1/4 < x < 1/2. We could keep going at this all day, computing 103/8 and comparing it with 2, squeezing x between tighter and tighter bounds, until we came up with an answer that we decided was "close enough." Or, we could take the easy way out, and use a calculator to compute the logarithm (base ten) of 2, because that's exactly what a logarithm is. The solution to log10(y) tells you the exponent x that makes 10x equal y. Incidentally, log10(2) = 0.30103 (to 5 decimal places).

The logarithm's base is denoted by the subscripted number. We could use any base we wanted, as long as it's a positive number; the most common base is ten because that's the base of our number system. Other common bases are 2 (especially for things dealing with [binary] computers), and e, which approximately equals 2.71828 and is an awesome math constant with lots of nifty features, despite the fact that it is an irrational number.

What's the difference between the number whose logarithm is 0.30103 and whose logarithm is 1.30103? Recall that from the definition, the first number must be 100.30103 = 2, and the second number must be 101.30103 = 100.30103+1 = 100.30103 × 101 = 2 × 10 = 20. So, we can see that this is a little bit like scientific notation: the number after the decimal point gives us a number between 1 and 10, and the number before the decimal point tells us what power of ten to multiply by. The decimal part is called the mantissa, and the whole number part is called the characteristic.

The characteristic gives you an idea of what order of magnitude the number is. For example, if log(x) = 3.77815, you may have no idea what 100.77815 is, but you would know that x is somewhere between 1000 (=103) and 10000 (=104). (x actually equals 6000.)

Now we have discussed more than enough to understand the joke about the snakes. The snakes were adders, and the only way to multiply by using the addition operation is with logs. But logarithms are much more than fodder for a joke!

In the 1630's, William Oughtred connected two seemingly unrelated ideas -- the additive properties of logarithms and the additive properties of measurement -- to invent the slide rule. If log(x) + log(y) = log(xy), then if you could represent these quantities by distances, the sum of their distances should equal a distance representing their product. This is the concept behind the slide rule, "a mechanical analog computer, consisting of calibrated strips, usually a fixed outer pair and a movable inner one, with a sliding window called the cursor" (Wikipedia). Slide rules were commonly used for science and engineering calculations until they were made obsolete by the electronic calculator and the computer. But slide rules are still great and as a professional mathematician I am proud to say that I own one.

The Wikipedia article on slide rules lists several advantages to slide rules. One big one is that slide rules require you to think about the reasonableness of your results. The result of multiplying 2.5 × 3.5 on a slide rule appears identical to the result of multiplying 25 × 350, because on the slide rule you work only with the mantissa, not the characteristic. For this reason you always have to keep the order of magnitude of your calculation straight in your head. This helps you to remain aware of the calculation so that you're less likely to accept an erroneous result. Too often I see people plugging numbers into a calculator or computer, and naively assuming that the output is absolutely correct. For this reason I think that it could be pedagogically beneficial to use slide rules in math classes.

You now know more than you ever wanted to know about logarithms and slide rules, and I hope that if you ever hear that joke again, your laugh will be full of humor rather than nervousness and math anxiety. I hope that by adding this bit of knowledge about logs to your knowledge base, your life will multiply in richness! (Ha ha, what a crazy mathematician I am!)


1 comment:

Anonymous said...