The Student Room Group

How do logs actually work?

I understand how to calculate them and stuff but how do they actually work?
It amazes me by the simple notation and some rules you can get an answer which you couldn't otherwise. But what takes place in the calculator?

Like what's behind the 'log'?
Just like there is a slower version of multiplying which is adding, for integration you are ultimately finding the area of the most precise shapes under the curve, for trig you use a set graph etc

How do logs actually work?

Is it just magic?

I have tried searching for it online but can't find an answer.
Reply 1
Original post by Mystery.
...


I quite liked this answer:

This is related to Joe's answer, but I want to emphasize something else. The main point I want to make is that if nthn^\text{th} roots are intuitive, then so are logarithms.

If you want to solve the equation x5=11x^5=11, you take a fifth root: x=115x=\sqrt[5]{11}. But what does 115\sqrt[5]{11} mean? Well, it means the unique real number xx such that x5=11x^5=11, so this alone doesn't tell you much.

To get somewhat of an intuitive feel for it, you can look at the curve y=x5y=x^5, notice that it is always increasing, and that it crosses y=11y=11 somewhere between 11 and
2 (because 15=11^5=1 and 25=322^5=32). But ultimately the definition of  5\sqrt[5]{\ } relies on the notion of the more familiar operation of multiplying 5 copies of a number, xx5x\mapsto x^5.

What if you want to solve the equation 5x=115^x=11? You take a logarithm with base 5, x=log5(11)x=\log_5(11). Again this is a solution by definition: log5(11)\log_5(11) is the unique real number x such that 5x=115^x=11. To get a more intuitive feel for it, you can look at the curve y=5xy=5^x, notice that it is always increasing, and that it crosses y=11y=11 somewhere between 1 and 2 (because 5^1=5 and 5^2=25). Ultimately the definition of log5\log_5 relies on the notion of *inverting* the more familiar operation of raising 5 to a power, x5xx\mapsto 5^x.

One way to get an intuitive feeling for the properties of logarithms is to see how the properties are derived from the more intuitive exponential function. For example, there is the familiar rule of exponents, 5a+b=5a5b5^{a+b}=5^a\cdot 5^b. This equation implies by the definition of the logarithm that a+b=log5(5a5b)a+b=\log_5(5^a\cdot 5^b). On the other hand, a=log5(5a)a=\log_5(5^a) and b=log5(5b)b=\log_5(5^b) also by the definition of the logarithm, so the exponential identity becomes the logarithmic identity
log5(5a)+log5(5b)=log5(5a5b)\log_5(5^a)+\log_5(5^b)=\log_5(5^a\cdot 5^b). When a nd b range over the real numbers, this implies the general product-to-sum identity,

log5(uv)=log5(u)+log5(v)\log_5(uv)=\log_5(u)+\log_5(v).Everything comes from "switching and y" as Joe said. For example, every time 1 is added to x, y=5xy=5^x increases by a factor of five: 5x+1=55x5^{x+1}=5\cdot 5^x. Therefore, for the inverse, every time x increases by a factor of 5, 1 is added to y=log5(x)y=\log_5(x).Part of the answer to your question to when we would say "Let's take the log\log" is whenever we are trying to solve for a quantity in an exponent, echoing Joe's answer somewhat (but devoid of the practical context given there). If you want to know when (2t+1)3=10(2t+1)^3 = 10, a good first step is to say, "Let's take the cube root!" Analogously, if you want to know when 32t+1=103^{2t+1}=10, a good first step is to say, "Let's take the log\log!"
Original post by Mystery.
...


To add to Zacken's answer, there are other ways to define logs using infinite series or integrals. These don't give such an intuitive notion though.

As to what goes on in the calculator, some functions have Taylor series associated with them. These may or may not be infinite series and may or may not be equal to the function. If they are equal then you can take the first few terms to get an approximation to the function. It turns out than ln has a bunch of these series and these are equal to ln(you have to choose the right one depending on x), so we can take the first few terms to get an approximation. I think the calculator does this to calculate logs.
Original post by Mystery.
I understand how to calculate them and stuff but how do they actually work?
It amazes me by the simple notation and some rules you can get an answer which you couldn't otherwise. But what takes place in the calculator?

Like what's behind the 'log'?
Just like there is a slower version of multiplying which is adding, for integration you are ultimately finding the area of the most precise shapes under the curve, for trig you use a set graph etc

How do logs actually work?

Is it just magic?

I have tried searching for it online but can't find an answer.


Your calculator computes the value of a series which converges on log (x) by running a loop.

sooo as you probably expect it's repeated use of simpler functions

explanation of how the old sinclair calculator did logs about halfway down this page http://files.righto.com/calculator/sinclair_scientific_simulator.html
Reply 4
Original post by Joinedup
Your calculator computes the value of a series which converges on log (x) by running a loop.


How does it run on a loop?
Reply 5
Just a little to add. In order to help students in an exam, I encourage them to write the following margin notes when they start an exam.
23=100log28=3 2^3=100 \Rightarrow \log_2 8=3 and from that ab=clogac=ba^b=c \Rightarrow \log_a c=b

The proofs of the essential log identities are very straightforward and are also enlightening. Finally, the old school definition of a log is also worth learning. This gets you are feeling for what a log is as opposed to merely knowing which button to press.

The log of a number to a given base is the power to which you raise the base to equal the original number.

As to how a calculator "does" a log. As already stated, logs are calculated using series generally but some speed gains can be had by using look up tables for key values such as ln2\ln 2
Reply 6
Original post by Zacken
How does it run on a loop?

Well the loop will run until the answer converges to the precision of the display. The algorithms are so well studied that you will not find a sticky output confounding things.

Does this answer your question? It is a loop in the computing sense.
Reply 7
Original post by nerak99
Well the loop will run until the answer converges to the precision of the display. The algorithms are so well studied that you will not find a sticky output confounding things.

Does this answer your question? It is a loop in the computing sense.


Ah, okay - I figured that the word loop implied an almost recursive way of computing the value, just calculating more and more terms didn't really seem like a loop to me, but I realise that the structure is something like

while {sum of terms != precision}
continue adding.

Quick Reply

Latest