What is a logarithmic scale? Why is it more useful for some things than a regular numerical scale?

200 views

[ad_1]

What is a logarithmic scale? Why is it more useful for some things than a regular numerical scale?

In: Mathematics
[ad_2]

It just raises everything to the power of ten so basically a 1 on the logarithmic scale is 10, 2 is 100, 3 is 1000. You get the idea. It can help scale down monstrous graphs.
Like maybe a graph has the first point at 1 and the last one at 100,000. Log scale can simplify things

a straight line is usually better to see than something curved.

if you have/expect exponential laws like y = a * exp(b * x), plotting log(y) vs x gives you a straight line: log(y) = log(a) + b * x .

if you expect a power law like y = a * x^b, plotting log(y) vs. log(x) gives you: log(y) = log(a)+b * log(x)

Also, a logarithmic plot usually makes sense on financial data (where doubling the value is more characteristic than a specific price).
A logarithmic plot can show details to smaller numbers, that would be visually lost on a linear plot where you only see the largest values.

Your standard scale will have evenly spaced lines at 1, 2, 3, 4, 5, 6, 7….

A log scale will have evenly spaced lines at 1, 10, 100, 1000, 10,000

Log scales are useful for looking at things that tend to grow exponentially [like say deaths in a pandemic](https://www.motherjones.com/wp-content/uploads/2020/05/blog_lse_linear_vs_log.jpg), they let you get details at both the lower end and the higher end.

If you look at the left plot on there, you really can’t get any details before it starts ramping up around March 22, everything left of that basically looks like its 0 because fitting both 10 and 40k on a graph with a linear scale really squishes data at the low end.

If you look at the right plot which is a semi-log (x axis is linear dates, y axis is a log scale) you can see that things start getting reported around March 4th and then proceeds to climb at roughly a straight line. If you plot something like 5^x on a semi-log plot like this you’ll get a straight line so when we look at exponential growth we expect to see a straight line.

Log plots are used whenever the difference between the smallest and largest number is several orders of magnitude. If you are plotting sound over time you’d work in dB which are a log scale because the difference between the loudest sound and the quietest sound you can hear is 10,000,000,000x difference in pressure

Say you are a caveman who doesn’t care about numbers. You are attacked by a lion one day. The next day, you are attacked by 3 lions. The next day, you are attacked by 9. Then, 27. Then, 81. You can imagine that being attacked by 28 lions vs 27 lions isn’t very much of a difference, but 3*27=81 lions is a legitimate increase in danger.

We want to graph this increase in danger. We set the x axis to 3^x, and the y axis to a regular, linear axis for danger level. You can then draw a straight line to express the relation, instead of a logarithm if the x axis was linear.

If I remember correctly, at some young age the brain understands logarithms implicitly but then forgets. We kinda just know that 10=>100 is a bigger increase than 10=>22.

Imagine you wanted to plot the net worth of people in your area in a graph that shows all the data.

Now most of the net worth will be around the lower end with some higher in between. So you can nicely see how the worth is distributed among the people.

Then suddenly Elon Musk decides to join your area. Now your nice graph is screwed.

Why is it screwed? Because the number line that previously was at let’s say 500k max suddenly jumped to 147 billion.

So the graph, as it is supposed to show all points, now is squished such that Elon Musk is at the top, a single outlier in the whole distribution. Even the richest guy in your area before is a measly 0.00034% on the scale. (Yes that’s right, those are 3 zeros after the decimal AND it’s percent. That is how laughable 500k are in that distribution)

This makes it impossible to see any difference between the 500k guy and the 300k guy the 30k guy and so on. They’re all down in the same line from Elons perspective.

So now you take a logarithmic scale, meaning you take their net worth, throw it into a logarithmic function and then plot that value. You obviously have to adjust the y axis accordingly.

The 30k guy is now a 4.47.

The 200k guy is now a 5.3.

The 500k guy is now a 5.7.

And Elon? Well he’s an 11.17.

These now fit on a single graph and you can still make out differences between the “smaller” numbers.

Logarithmic scales are generally often used when exponential growth is concerned, like population growth, spreading of diseases. Also when you have to work with data that spans a huge range of values, like comparing the size of objects in the universe.

Using logarithmic scales and transformations is very common in machine learning and data science.

OP, take some time to really digest this concept. Logarithmic plots are used frequently because they’re great ways to condense data into more digestible formats but it’s important as a consumer of data (news media, maybe at work, politics, etc) it’s important to understand what you’re being presented with.

As a general rule, check the units, and the scale on any plot you’re being presented with because people can do all sorts of massaging to still show “accurate” data but in ways that wildly miscommunicate what the data actually presents. My college statistics courses really changed the way I saw the world. It made me a skeptic of any data being presented to me, and I now I ask more questions. That’s a healthy skepticism to have because sometimes you’ll find that after you start to digest the plots, you can make some pretty accurate assumptions about the author’s opinions or beliefs just in how they presented their data, which I’d argue is an objectively bad thing.

I’m ranting on something off topic here, but the main point I was trying to make is that log plots are very useful tools but understand them well so you can be sure you’re not reaching the wrong conclusions just because the data being presented looks a particular way, even if that data is factual, it can be presented in a way that’s misleading.

Quick calculus lesson:

Lots of things like population rates, net worth, contagion spread, fire, technology, and others don’t “grow” or “gain popularity” etc. at a linear rate, instead they grow at an exponential rate.

Linear growth means that the *rate* at which something is changing is constant: for any given change on the x-axis, there is the same proportion of change on the y-axis. On day one (for example) you might see one unit of change. Then you have one more the next day, then one more, and so on.

Exponential growth means that the rate at which something is changing is actually increasing: in the first day (for example) you can have two units of growth. The next you might have four, then eight, then sixteen, and so on. As things spread to other things, there are more things to do the spreading.

A logarithmic scale is useful because mathematically speaking, a logarithm is the inverse of an exponent – it “cancels it out”, in a way. That is to say, if you plot an exponential function on a linear scale, you get the parabola that you’d expect – this is because the rate of change is always increasing. If you plot an exponential function on a logarithmic scale, the y-axis increases exponentially, and “‘cancels out” the exponential property of the line. This makes it look like a straight line (assuming a basic exponential function).

It’s useful because lots of things are measured better by their rate of change, not so much by their change itself. Like if you’re driving a car, you usually don’t really care how many miles you’ve gone, you’re more concerned with how many miles *per hour* you’re going right now. You are concerned about the rate of change of miles rather than just the miles.

You could take it one step further and measure your acceleration, which measures the rate of change of your miles per hour which would be a second level measure of miles (displacement). Mathematically this would be known as the second derivative of displacement (with velocity being the first derivative). If you were accelerating, then the rate of change (speed) of your miles would also be increasing, and not staying constant.

With something that grows exponentially like a virus, we don’t get much information about how many people are getting infected, or even how many people got infected during a period of time. We’re expecting it to grow exponentially so while total infections or infections in the last x unit of time are good for scaring people, we actually learn from the acceleration of the virus.

If you plot an exponentially growing virus on a logarithmic scale, it cancels out that exponential growth into a straight line. If the line is steep, it means it’s accelerating more quickly at a constant rate. If it’s shallow, then it’s accelerating more slowly at a constant rate. If the line curves up, the acceleration itself is increasing, and if it curves down, the acceleration itself is decreasing – and that tells us that either a. it’s running its course (in that there are not enough potential receivers to match potential spreaders) b. anti-viral measures are working or c. a little of both.

In broad terms, a logarithm tells how many digits a number has. So, a scale using logarithms, instead of regular numbers, it’s useful to compare how big numbers are when you have numbers with different amounts of digits or “orders of magnitude”.

What you call a “regular” numerical scale works by addition. A log scale works the same, just with multiplication instead of addition. (To paraphrase mm..mBacon12345: 1, 2, 3, 4 becomes 1, 2, 4, 8.)

If you happen to be familiar with music, the musical scale is my favorite example of log scales in the “real world”. The keys on a piano are “evenly” spaced. Pick a note (say, middle C), and go one octave up (say, high C), and your second note’s frequency is double your first one’s. (That’s why they harmonize so well that we call them by the same name.)

There are 12 intervals in that octave (7 white keys, 5 black keys). If they were evenly spaced in an “additive” sense, a) it would sound awful, and b) the next octave up would sound awful, but not the same awful, a different awful. Instead, they are evenly spaced in a “multiplicative” sense, and a) it sounds great, and b) if you shift a tune one octave up, it is still recognizably the same tune.

To gloss over a long and interesting story, our idea of harmony is rooted in small ratios: 2/1, 3/2, 5/4, etc, and our modern 12-tone scale is kind of a best-fit of evenly-spaced small-number ratios between 1/1 and 2/1. The interval between two adjacent notes is the ratio 2^(1/12). So the piano keyboard is a log-scale number line.

Any topic where it’s the ratios of things that carry the meaning (rather than their sums and differences), will be at home on a log scale.