I am trying to gain a more intuitive feeling for the use of logarithms.
So, my questions: What do you use them for? Why were they invented? What are typical situations where one should think: "hey, let's take the $\log$!"?
Thanks for the great comments!
Here a short summary what we have so far:
History:
Logarithms were first published 1614
by John Napier
(mathematician/astronomer) . He needed
them for simplifying the
multiplication of large numbers.Today’s uses:
- In regression analysis: If you expect a predictor variable to follow
a power/exponential law, take the
corresponding logarithm to linearize
the relationship.- In finance to calculate compound interests.
- Or more general: to calculate the time variable in growth/decay
functions. (Nuclear decay, biological
growth…)- In computer science to avoid underflow. (Cool trick! But seriously:
32-bit? Take a double 😉- In the Prime Number Theorem
- For handling very large/small numbers (pH, etc.)
- Plotting (if your scale gets too large)
Best Answer
Logarithms come in handy when searching for power laws. Suppose you have some data points given as pairs of numbers $(x,y)$. You could plot a graph directly of the two quantities, but you could also try taking logarithms of both variables. If there is a power law relationship between $y$ and $x$ like
$$y=a x^n$$
then taking the log turns it into a linear relationship:
$$\log(y) = n \log(x) + \log(a)$$
Finding the exponent $n$ of the power law is now a piece of cake, since it corresponds to the slope of the graph.
If the data do not follow a power law, but an exponential law or a logarithmic law, taking the log of only one of the variables will also reveal this. Say for an exponential law
$$y=a e^{b x}$$
taking the log of both sides gives
$$\log(y) = b x + \log(a)$$
Which means that there will be a linear relationship between $x$ and $\log(y)$.