Logarithms in any base-what are they used for?

I think we’re all familiar with using base 10 logarithms (common logs) and logarithms in base ‘e’ (natural logs). We’ve probably seen base 2 logarithms used a few times.
So, why is it necessary to have logs in base 7.2 or base pi ?
I wrote a calculator for this - www.1728.com/logrithm.htm - and would like to know the need for such calculations. I had read at Dr Math and other sites that logarithms for any base are necessary but they didn’t explain why. So, what are they used for ?

The main use for logarithms is to compress a large range of values to a manageable size. For example, the well-known Richter scale is logarithmic. If it weren’t for logs, instead of having a scale from 0 to 10, we’d have one from 0 to 1,000,000,000,000, which gets unweildy.

Generally, as Q.E.D. stated, they are used wherever exponents are found.

If you have two variables from some sort of exponential equation, you should be able to find the third. The first two cases are easier, and dealt with earlier in school:

3^2 = 9

9^(1/2) [square root] = 3

But if you have 9 and 3, how do you get to the 2?

That’s where logarithms come in.

log[base 3] 9 = 2

Read the log as ‘what goes with 3 to make 9’

Here’s a simple Math Problem that demonstrates a use:

A basketball player has a probability of 0.9 for making a shot. How many shots must he take in a row to have a probability of less than 0.5 of making them all?

Ignoring the obvious and rather easy trial and error method…

0.9^x = 0.5 (simple probability)

This can be rearranged into a log of base 0.9

log[0.9]0.5 = x = 6.8 (OWTTE)

Therefore the player must take 7 shots (since he can’t take fractional shots).

The previous example (there a many others e.g. interest rates - when will I be a millionaire?) shows why you want to calculate general logs.

Technically you can do all your calculations using only logs of one base (e being the “natural” choice) and some transformations because

log(a,x) = ( log(b,x) / log(b,a) )

Before the availability of computers this had to be done almost exclusively because logarithm tables could not exist for every odd value and calculating them by hand is very impractical.

So you can see general logs as a convenient shorthand function hiding the necessary transformations.

And if you allow powers of arbitrary numbers (again you could limit yourself to powers of e) this definition makes a nice reverse.

You know, I’ve never seen (that I can recall) a calculator or a programming language math library with which you can take arbitrary-base logs. It’s always base e, and sometimes base 10. I guess they figured it was silly to add a function for this when it’s just as easy to divide as enter two arguments.

Achernar
Well, the Internet finally has one at www.1728.com/logrithm.htm
(It wouldn’t surprise me to see there is already a calculator for this on the’Net. Maybe more).
And thanks to all for your answers.
Don’t forget, if you need to find the base 19 logarithm of 23, you know there’s a calculator for it.
(It’s 1.0648868046 by the way).

Base 2 logarithms are used in computer science, particularly complexity theory. For example, searching a binary tree is usually proportional to log base 2.

In an octal or hexidecimal computing system it might possibly save some programming to use log[sub]8[/sub] or log[sub]16[/sub].

For the average joe it might only included in studying logarithms for the sake of completeness.

There aren’t really “octal or hexidecimal computing systems,” just binary systems that are convenient to represent in octal or hexidecimal for us stoopid hoomans.

I suppose this is correct for commercially available systems. I did work with a special purpose computer in which all of the data was handled, stored, transferred, etc. in hexi but maybe the actual computation was binary. I didn’t get into the workings of the processor. But now, on thinking it over, I suppose the guts were binary unless the computer designer wanted to pay an awful lot for a special CPU.

David, why did he choose base 16 instead of, say, base 10? Because in base 16, all numbers are a representation of four binary digits. Octal is a way of writing three binary digits at a time. If you’re using base 2 internally, you want a base that’s a power of two for a shorthand notation system.

Oh, and computers don’t use binary, either. They use electrical currents and switches (aka transistors). As an electrical current can either be on or off, a number system with two digits (1 and 0) and a logic system with two values (true and false) can be used by us humans to reason about it.

If I have understood the OP correctly, he is asking not, “Why logarithms?” but rather, “Why logarithms other than base 2, e and 10?” The answer is, no good reason at all. We use base 10 because we represent integers base 10. We use base e because logarithms to this base have particularly nice properties ( mainly concerned with calculus). Mathematically speaking, this is the only important base. As one of my lecturers put it, “No-one in his right mind would take logarithms to any base other than e.” In mathematics beyond the baby level, we write “log” for “log to the base e” for this very reason. For historical reasons, though, logarithms to the base 2 are used in computer science, for calculating entropy, for example.

The definition of bit as a unit of information is the base 2 log of the number of possible simbols when they are all of equal probability.

When asked this, I usually ask “You know reasons to use powers for numbers besides 2,e, and 10, right?” (if they’re over 13, and ask this question, they usually do) “Those are pretty much situations where logarithms in different bases might be useful.” Logs are complements of exponents, the way subtraction complements addition, or division complements multiplication. If you know the value of the base, then it’s a problem of logs and powers. This fundamental self-evident truth is sometimes lose elementary algebra tends to focus on unknown bases (X^4, etc.) and also covers the simple method to convert between bases.

In short quite a few problems phrased in the standard bases are actually problems in other bases. If you’re asking why you’d need a calculator in base X - well, you probably don’t. They’re nice if you’re pushing the limits of accuracy of the base 2, e or 10 functions on your computer program – but only if you know the alternative base calculator is several digits more accurate. many aren’t. Indeed, many rely on the common bases internally, so why bother? You’d do as well or better by working with a higher accuracy math package in binary (base 2) logs, where the accuracy of the algorithm is best defined, and fewer unnecessary hidden errors propagate through your calculations (for a given bit-size representation of the data.

Jabba:
I’m no mathematician, but I do read math papers, and though I see both ln and log used for base e, it’s always seemed to me that log was used when the general form of exponentiation is indicated (e.g. algorithms that compute in “n log n” time, since theoretical math isn’t strongly numerical), but “ln” is used when base e is specifically meant. Are you saying this isn’t a true convention in pure math?

It’s also proportional to log base 37.

In my experience, ‘log’ with no subscript meant ‘log[sub]10[/sub]’ (log[sub]10[/sub] was the default case when the base was not specified), and ‘ln’ (pronounced ‘lawn’) meant ‘log[sub]e[/sub]’. I don’t remember encountering log[sub]2[/sub] much. :slight_smile:

Sunspace, in my world ln' is pronounced ell-en’, or `the natural log’. It’s an interesting function.

ln -1 = πi

d/dx ln x = x[sup]-1[/sup]

A true math geek can come in and tell you more.

For what its worth, my mother was an engineering student in the WWII years. She couldn’t afford to buy a slide rule, so she did ALL of her calculations using log tables.

Think about that the next time you buy a good scientific caculator for $9.95.

Jabba
You understood the OP correctly. Maybe I should have been more succinct and asked “What are base 17 logs or base 23 logs used for?”
However, Jabba, I have to agree with Sunspace that whenever I see ‘log’ without any base specified, I always think of it as log[sub]10[/sub] and not natural log. I go back to a time before calculators when a lot of mathematical calculations had to be done with log tables. You could use a slide rule but that only gave you 3 significant figures. For higher accuracy, you needed to use log tables. Since, log tables did make arithmetic much easier to do, log[sub]10[/sub] logarithms were much more useful and practical than natural logarithms. In fact, that is how they came to be known as common logarithms because they were used more widely than natural logarithms. Seems almost sacriligious but “common logs” were considered much more important than natural logarithms.
Brother Cadfael I admire your mother for only using log tables. They were a royal pain to use but still it was better than trying to estimate 23798354.9/(27.6) by hand.

Logarithms of bases other than 10, 2, and e don’t have much use. But it’s easy to write proofs about logarithms in arbitrary bases, so why not?