Sign in

Libre University uses your GitHub account. Signing in is only needed to sit a final test, so the score is kept on your profile.

Logarithms

Computing 2x for any x is straightforward, and the previous lesson did it repeatedly. Going the other way, finding the x for which 2x=10, has no method at all in anything covered so far, and it is the question every growth problem eventually asks: not what the balance will be, but when it doubles.

This lesson defines the function that answers it, derives its three laws from the index laws, and puts it to work on dating, doubling and the measurement scales that span too many orders of magnitude to plot any other way.

The inverse of an exponential

For a fixed base b greater than zero and not equal to one, the exponential y=bx passes the horizontal line test: it increases steadily when b>1 and decreases steadily when b<1, so no output is ever repeated. By the criterion of the fourth lesson it therefore has an inverse, and that inverse is the logarithm to base b:

logby=xmeans exactlybx=y

Read it as the question "what power of b gives y", and most confusion about logarithms disappears. So log28=3 because 23=8; log101000=3; log51=0, since any base to the power zero is one.

Being an inverse fixes its domain and range without further argument. The range of bx is the positive reals, so that is the domain of the logarithm: there is no logarithm of zero or of a negative number, because no power of a positive base produces one. The domain of bx is all of R, so that is the range: a logarithm can be any real number, positive or negative. And by the reflection rule of the fifth lesson, the graph of y=logbx is the graph of y=bx flipped in the line y=x, rising steeply near zero, crossing the axis at x=1, and thereafter climbing ever more slowly.

Two bases are so common they have their own notation. Base 10 is the common logarithm, written log, and base e is the natural logarithm, written ln. Base 2 appears throughout computing, where it counts bits.

Three laws, and where they come from

Each index law from the previous lesson becomes a logarithm law when read backwards. Let M=bm and N=bn, so that m=logbM and n=logbN. Then MN=bmbn=bm+n, and taking the logarithm of both sides gives

logb(MN)=m+n=logbM+logbN

The logarithm turns multiplication into addition. The same move on M/N=bm-n gives logb(M/N)=logbM-logbN, and on Mk=(bm)k=bmk gives

logb(Mk)=klogbM

That third law is the one that solves equations, because it takes an unknown out of an exponent and puts it in front where algebra can reach it.

A fourth relation lets any base be converted to any other, which matters because calculators carry only two. If x=logby then bx=y; take natural logarithms of both sides and use the third law to get xlnb=lny, so

logby=lnylnb

The choice of ln here is arbitrary and base 10 works identically, which is a useful check: log3200 computed as ln200/ln3=5.2983/1.0986=4.8227, and as log200/log3=2.3010/0.4771=4.8227.

Two errors are worth naming because they are so common. There is no law for log(M+N), which does not simplify at all. And log(M)/log(N) is not log(M/N); the first is a change of base and the second is a difference.

Solving for an exponent

The routine has three steps: isolate the exponential, take logarithms of both sides, and use the third law to bring the exponent down.

Example. Solve 3x=200.

Take natural logarithms: ln(3x)=ln200, so xln3=ln200 and x=ln200/ln3=5.2983/1.0986=4.8227. Check: 34.8227=199.99, which is the intended 200 to the precision of the rounded exponent.

Now you. Solve 5x=1000.

Answer

x=ln1000/ln5=6.9078/1.6094=4.2920. Check: 54.292=999.95.

Doubling time is this calculation with the answer 2 fixed in advance. Money at an annual rate r multiplies by (1+r)t, so doubling needs (1+r)t=2, giving t=ln2/ln(1+r). At three per cent that is 0.6931/0.029559=23.45 years; at five per cent, 14.21 years; at eight per cent, 9.01 years.

The familiar rule of thumb, that dividing 72 by the percentage rate gives the doubling time, is now visible as an approximation to this formula: it predicts 24, 14.4 and 9 against the true 23.45, 14.21 and 9.01. It is good to within a few per cent across the range of rates anyone encounters, and it is wrong for very large rates, where the logarithm's curvature bites.

Dating the past

Radiocarbon dating is the same equation solved for time rather than for a rate. Living tissue holds carbon-14 at the atmospheric ratio; from death the isotope decays with a half-life of 5730 years and is not replenished, so measuring what fraction remains gives an age. Willard Libby developed the method in 1949 and received the Nobel Prize for chemistry in 1960 for it.

The decay law from the previous lesson is N/N0=(1/2)t/T. Take logarithms of both sides and use the third law:

t=Tln(N/N0)ln(1/2)

Example. A piece of charcoal retains 22 per cent of the carbon-14 of living wood. How old is it?

Substituting, t=5730×ln(0.22)/ln(0.5)=5730×(-1.5141)/(-0.6931)=5730×2.1844=12{,}517 years. A check on plausibility: two half-lives would leave 25 per cent at 11{,}460 years, and 22 per cent is a little less, so the age must be a little more, as it is.

Now you. A bone retains 35 per cent. How old is it?

Answer

t=5730×ln(0.35)/ln(0.5)=5730×1.5146=8679 years.

The technique has honest limits, and practitioners state them. Beyond about 50{,}000 years, roughly nine half-lives, too little carbon-14 remains to measure against background. The atmospheric ratio is not in fact constant, so raw dates are corrected against tree-ring and coral records, a calibration that can move a result by centuries. And nuclear weapons testing in the 1950s nearly doubled atmospheric carbon-14, which makes recent material behave strangely and, incidentally, allows the year of formation of tissue from that era to be dated precisely.

Why the logarithm was a technology

Logarithms were invented as a labour-saving device, not as a piece of theory. John Napier published Mirifici Logarithmorum Canonis Descriptio in 1614 after twenty years of computation, and Henry Briggs recast the idea to base 10 and published tables to fourteen places in 1624. The point was the first law. Before mechanical calculators, multiplying two eight-digit numbers by hand was slow and error-prone, while adding them was easy, so a table that converted every multiplication into an addition roughly halved the labour of astronomical calculation. Laplace said it doubled the life of the astronomer.

The slide rule is that idea in wood. Two rulers marked not in units but in the logarithms of units, slid against each other, add lengths that represent logarithms and therefore multiply the numbers. Every engineer carried one until pocket calculators arrived in the early 1970s, and the Apollo programme was flown with them.

Two habits of that era survive because they remain useful. The characteristic, the whole-number part of a base-10 logarithm, is the order of magnitude: log(6.02×1023)=23.78, so Avogadro's number has 24 digits. And in computing, log2 counts how many times a quantity can be halved, which is why searching a sorted list of a trillion items takes at most log2(1012)=39.9, that is 40, comparisons.

Scales that span too much to plot

When a quantity ranges over many orders of magnitude, plotting it linearly wastes almost the whole axis on the top end. Taking logarithms first compresses it into something a person can read, and several measurement scales have this built in.

Acidity is defined as pH=-log10[H+], with the concentration in moles per litre. Sound level in decibels is 10log10(I/I0) against a reference intensity, so an increase of 30 dB is a factor of 103=1000 in intensity: ordinary conversation at 55 dB carries a thousandth of the energy of a food blender at 85 dB. Earthquake magnitude, as defined by Charles Richter in 1935, adds one unit per factor of ten in ground-motion amplitude, which corresponds to a factor of about 31.6 in energy, since energy scales as the 1.5 power of amplitude. Stellar magnitudes, formalised by Norman Pogson in 1856 to match an ancient naked-eye scale, put five magnitudes to a factor of 100 in brightness, so one magnitude is a factor of 1001/5=2.512, and the scale runs backwards with brighter objects having smaller numbers.

Example. A solution has a hydrogen ion concentration of 3.2×10-4 mol per litre. What is its pH, and how does it compare with pure water at pH 7?

pH=-log10(3.2×10-4)=-(log103.2-4)=4-0.5051=3.495. That is 3.5 units below neutral, so the concentration is about 103.5=3160 times that of pure water. This is roughly the acidity of orange juice.

Now you. Seawater has a hydrogen ion concentration near 4.5×10-9 mol per litre. What is its pH?

Answer

pH=-log10(4.5×10-9)=9-log104.5=9-0.6532=8.347, mildly alkaline.

How slowly it grows

The previous lesson showed the exponential outrunning every polynomial. Reflecting that statement in the line y=x gives its counterpart: the logarithm grows more slowly than every positive power of x, however small the power. It does grow without limit, since log2x reaches 100 when x reaches 2100, but it takes its time.

That slowness is exactly why logarithmic scales work. Multiplying the input by a fixed factor adds a fixed amount to the output, so a plot of the logarithm turns proportional change into equal steps, and data spanning a factor of a billion fits on one axis.

Growth and decay are now fully covered: exponentials go forward, logarithms come back, and each is the other's mirror. What none of this describes is anything that repeats. A tide, a note, a rotating shaft and an alternating current return to the same value again and again, and no polynomial, exponential or logarithm can do that, since each is either injective or eventually monotone. Functions that repeat come from angles, and the next lesson starts with the triangle.