Lemma
← All topics
Pure mathematics

Exponentials and logarithms

Growth, decay, and the inverse that tames them.

Introduction

An exponential function such as y=2xy = 2^x or y=exy = e^{x} multiplies by the same factor every time xx goes up by 11. A logarithm answers the reverse question: what power gives this number? This topic covers exponential graphs, the special number ee, the laws of logarithms, solving equations where the unknown is in a power, exponential growth and decay models, and using logs to turn curves into straight lines.

Why it matters

Bacteria double, money compounds, radioactive atoms decay, a hot drink cools: all exponential. Logarithms are how you get the unknown out of the exponent ("how long until it doubles?"). They are also behind the decibel, pH and Richter scales, which squeeze huge ranges into manageable numbers.

Intuitive explanation

IntuitionLogs count multiplications

log⁡28=3\log_2 8 = 3 because you multiply by 22 three times to get from 11 to 88. So logs turn multiplication into addition: log⁡(ab)=log⁡a+log⁡b\log(ab) = \log a + \log b, since multiplying by abab is "multiply by aa, then by bb".

IntuitionWhy ee is special

For y=axy = a^x, the gradient at every point is proportional to yy. For one special base, e≈2.718e \approx 2.718, the constant of proportionality is exactly 11: the gradient of exe^x equals exe^x. That makes ee the natural base for growth: a quantity growing at a rate proportional to its size is AektAe^{kt}.

Where ee comes from: compound interest

Invest £1 at 100%100\% interest for one year, compounded nn times:

compoundingnnvalue (1+1n)n\left(1 + \frac1n\right)^n
yearly1122
monthly12122.61302.6130
daily3653652.71462.7146
every second31 536 00031\,536\,0002.71828182.7182818

The values approach e=2.718281828…e = 2.718281828\ldots, the result of growing continuously at a rate equal to the current amount. That is why exe^x is the function that equals its own rate of change.

Logarithms count multiplications

log⁡21024=10\log_2 1024 = 10 means "double 1010 times to get 10241024". Logs turn multiplication into addition and powers into multiplication. For three centuries, that is how astronomers and engineers multiplied large numbers: look up two logs in a table, add them, and look up the answer. A slide rule is two logarithmic scales sliding past each other.

Formal definitions

DefinitionLogarithm

For a>0a > 0, a≠1a \ne 1 and x>0x > 0:  log⁡ax=y  ⟺  ay=x\ \log_a x = y \iff a^y = x.

DefinitionNatural logarithm

ln⁡x=log⁡ex\ln x = \log_e x. It is the inverse of exe^x:  eln⁡x=x\ e^{\ln x} = x for x>0x > 0 and ln⁡(ex)=x\ln(e^x) = x for all xx.

DefinitionExponential model

y=Aekty = Ae^{kt}: growth if k>0k > 0, decay if k<0k < 0. AA is the initial value (at t=0t = 0).

Notation

  • log⁡x\log x with no base usually means log⁡10x\log_{10} x (on calculators).
  • exp⁡(x)\exp(x) means exe^x.
  • ln⁡x\ln x is only defined for x>0x > 0.

The laws

IdentitiesLaws of logarithms (any base aa)
log⁡a(xy)=log⁡ax+log⁡ay,log⁡axy=log⁡ax−log⁡ay,log⁡axk=klog⁡ax\log_a(xy) = \log_a x + \log_a y, \qquad \log_a\frac xy = \log_a x - \log_a y, \qquad \log_a x^k = k\log_a x
log⁡aa=1,log⁡a1=0,log⁡a1x=−log⁡ax\log_a a = 1, \qquad \log_a 1 = 0, \qquad \log_a\frac1x = -\log_a x
IdentitiesChange of base
log⁡ax=log⁡bxlog⁡ba=ln⁡xln⁡a\log_a x = \frac{\log_b x}{\log_b a} = \frac{\ln x}{\ln a}
IdentitiesDerivative
ddxekx=kekx\frac{d}{dx}e^{kx} = ke^{kx}

Key results

TheoremStraight-line forms
  • y=axn⇒log⁡y=nlog⁡x+log⁡ay = ax^n \Rightarrow \log y = n\log x + \log a: plot log⁡y\log y against log⁡x\log x; gradient nn, intercept log⁡a\log a.
  • y=kbx⇒log⁡y=xlog⁡b+log⁡ky = kb^x \Rightarrow \log y = x\log b + \log k: plot log⁡y\log y against xx; gradient log⁡b\log b, intercept log⁡k\log k.
PropositionGraphs

y=exy = e^x passes through (0,1)(0, 1), is always positive and has asymptote y=0y = 0. y=ln⁡xy = \ln x is its reflection in y=xy = x: through (1,0)(1, 0), asymptote x=0x = 0.

Proofs

ProofThe product law

Let log⁡ax=p\log_a x = p and log⁡ay=q\log_a y = q, so x=apx = a^p and y=aqy = a^q. Then xy=ap+qxy = a^{p + q}, so log⁡a(xy)=p+q=log⁡ax+log⁡ay\log_a(xy) = p + q = \log_a x + \log_a y.

∎
ProofChange of base

If y=log⁡axy = \log_a x then ay=xa^y = x. Take ln⁡\ln of both sides: yln⁡a=ln⁡xy\ln a = \ln x, so y=ln⁡xln⁡ay = \frac{\ln x}{\ln a}.

∎

Methods

MethodUnknown in an exponent

Take logs of both sides (or rewrite with the same base), bring the power down with log⁡xk=klog⁡x\log x^k = k\log x, and solve. For ee, use ln⁡\ln.

MethodHidden quadratics

e2x−5ex+6=0e^{2x} - 5e^x + 6 = 0 is a quadratic in u=exu = e^x. Solve for uu, then x=ln⁡ux = \ln u, rejecting u≤0u \le 0.

MethodFitting a model from data

Take logs of the data, plot, and read the gradient and intercept from the line of best fit. Then convert back.

The log laws are the index laws, read backwards

Let log⁡aM=m\log_aM = m and log⁡aN=n\log_aN = n, so M=amM = a^m and N=anN = a^n. Then:

  • MN=am+nMN = a^{m+n}, so log⁡a(MN)=m+n=log⁡aM+log⁡aN\log_a(MN) = m + n = \log_aM + \log_aN.
  • MN=am−n\frac MN = a^{m-n}, so log⁡aMN=log⁡aM−log⁡aN\log_a\frac MN = \log_aM - \log_aN.
  • Mk=akmM^k = a^{km}, so log⁡aMk=klog⁡aM\log_aM^k = k\log_aM.

Change of base

Let x=log⁡abx = \log_ab, so ax=ba^x = b. Take log⁡c\log_c of both sides: xlog⁡ca=log⁡cbx\log_ca = \log_cb. Hence

log⁡ab=log⁡cblog⁡ca.\log_ab = \frac{\log_cb}{\log_ca}.

All logarithm functions are constant multiples of each other: log⁡ab=1ln⁡aln⁡b\log_ab = \frac{1}{\ln a}\ln b. Choosing a base just chooses a scale.

Why ee is the natural base

From first principles, ddxax=ax⋅lim⁡h→0ah−1h\frac{d}{dx}a^x = a^x\cdot\lim_{h\to0}\frac{a^h - 1}{h}. The limit is ln⁡a\ln a, so ddxax=axln⁡a\frac{d}{dx}a^x = a^x\ln a. Only for a=ea = e is the constant exactly 11. Every other base carries an awkward factor. Similarly ddxlog⁡ax=1xln⁡a\frac{d}{dx}\log_ax = \frac{1}{x\ln a}, which is simplest when a=ea = e.

The logarithm as an area

ln⁡x=∫1xdtt\ln x = \int_1^x\frac{dt}{t}, the area under the hyperbola y=1ty = \frac1t from 11 to xx. The multiplication law becomes a geometric fact. Stretching the region horizontally by a factor aa and squashing it vertically by 1a\frac1a preserves areas, and it maps the area from 11 to bb onto the area from aa to abab. So

∫1abdtt=∫1adtt+∫aabdtt=ln⁡a+ln⁡b.\int_1^{ab}\frac{dt}{t} = \int_1^a\frac{dt}t + \int_a^{ab}\frac{dt}t = \ln a + \ln b.

Gregory of Saint-Vincent noticed this in 1647, before anyone had defined ee.

Turning exponential data into straight lines

  • y=abx⇒log⁡y=log⁡a+xlog⁡by = ab^x \Rightarrow \log y = \log a + x\log b. Plot log⁡y\log y against xx: gradient log⁡b\log b, intercept log⁡a\log a.
  • y=axn⇒log⁡y=log⁡a+nlog⁡xy = ax^n \Rightarrow \log y = \log a + n\log x. Plot log⁡y\log y against log⁡x\log x: gradient nn, intercept log⁡a\log a.

Scientists use log scales precisely so that these hidden straight lines become visible.

Examples

ExampleA one-line equation

3x=20⇒x=ln⁡20ln⁡3=2.7273^x = 20 \Rightarrow x = \frac{\ln 20}{\ln 3} = 2.727.

Step-by-step worked examples are in the Worked examples tab.

Common mistakes

Common mistakelog⁡(a+b)≠log⁡a+log⁡b\log(a + b) \ne \log a + \log b

There is no law for the log of a sum.

Common mistakeln⁡\ln of a negative number

ex=−2e^x = -2 has no solutions. Reject such roots in hidden quadratics.

Common mistakeMisreading log⁡\log plots

For y=axny = ax^n the intercept is log⁡a\log a, so a=10intercepta = 10^{\text{intercept}}, not the intercept itself.

Common mistakeDividing logs incorrectly

ln⁡8ln⁡2=3\frac{\ln 8}{\ln 2} = 3, but ln⁡82=ln⁡4\ln\frac82 = \ln 4. These are different.

Applications

  • Radioactive decay and carbon dating: N=N0e−λtN = N_0e^{-\lambda t}, half-life ln⁡2λ\frac{\ln 2}{\lambda}.
  • Newton's law of cooling: T=Troom+(T0−Troom)e−ktT = T_{\text{room}} + (T_0 - T_{\text{room}})e^{-kt}.
  • Finance: continuous compounding A=PertA = Pe^{rt}.
  • Science scales: decibels, pH and earthquake magnitudes are logarithmic.

Connections

Summary

  • log⁡ax=y  ⟺  ay=x\log_a x = y \iff a^y = x; ln⁡\ln is log⁡e\log_e, the inverse of exe^x.
  • Product, quotient and power laws; change of base.
  • Unknown in a power: take logs. Watch for hidden quadratics in exe^x or axa^x.
  • Models AektAe^{kt}: AA initial value, kk rate.
  • y=axny = ax^n: plot log⁡y\log y against log⁡x\log x; y=kbxy = kb^x: plot log⁡y\log y against xx.

Worked examples

Try each one yourself first, then open the solution.

Example 1Combining logs

Write 2log⁡36−log⁡342\log_3 6 - \log_3 4 as a single integer.

Show the solution
  1. 1Power law

    2log⁡36=log⁡3362\log_3 6 = \log_3 36.

  2. 2Quotient law

    log⁡3364=log⁡39\log_3\frac{36}{4} = \log_3 9.

  3. 3Evaluate

    =2= 2.

Answer

22

Example 2Solving a log equation

Solve log⁡2(x+2)+log⁡2x=3\log_2(x + 2) + \log_2 x = 3.

Show the solution
  1. 1Combine

    log⁡2(x(x+2))=3\log_2\big(x(x + 2)\big) = 3.

  2. 2Remove the log

    x2+2x=8⇒(x+4)(x−2)=0x^2 + 2x = 8 \Rightarrow (x + 4)(x - 2) = 0.

  3. 3Check the domain

    x=−4x = -4 makes log⁡2x\log_2 x undefined, so reject it. x=2x = 2.

Answer

x=2x = 2

Example 3Unknown in two exponents

Solve 52x−1=3x+25^{2x - 1} = 3^{x + 2}, giving xx to 3 significant figures.

Show the solution
  1. 1Take logs

    (2x−1)ln⁡5=(x+2)ln⁡3(2x - 1)\ln5 = (x + 2)\ln 3.

  2. 2Collect xx

    x(2ln⁡5−ln⁡3)=2ln⁡3+ln⁡5x(2\ln5 - \ln3) = 2\ln3 + \ln5.

  3. 3Solve

    x=2ln⁡3+ln⁡52ln⁡5−ln⁡3=ln⁡45ln⁡253=1.79x = \dfrac{2\ln3 + \ln5}{2\ln5 - \ln 3} = \dfrac{\ln 45}{\ln\frac{25}{3}} = 1.79.

Answer

x=1.79x = 1.79

Example 4A hidden quadratic in $e^x$

Solve e2x−4ex+3=0e^{2x} - 4e^x + 3 = 0.

Show the solution
  1. 1Substitute u=exu = e^x

    u2−4u+3=0⇒(u−1)(u−3)=0u^2 - 4u + 3 = 0 \Rightarrow (u - 1)(u - 3) = 0.

  2. 2Back to xx

    ex=1⇒x=0e^x = 1 \Rightarrow x = 0;  ex=3⇒x=ln⁡3\ e^x = 3 \Rightarrow x = \ln 3.

Answer

x=0x = 0 or x=ln⁡3x = \ln3

Example 5Half-life

A radioactive sample has mass M=80e−0.02tM = 80e^{-0.02t} grams after tt years. Find the half-life.

Show the solution
  1. 1Set up

    80e−0.02t=40⇒e−0.02t=1280e^{-0.02t} = 40 \Rightarrow e^{-0.02t} = \frac12.

  2. 2Take logs

    −0.02t=ln⁡12=−ln⁡2-0.02t = \ln\frac12 = -\ln 2.

  3. 3Solve

    t=ln⁡20.02=34.7t = \dfrac{\ln 2}{0.02} = 34.7 years.

Answer

34.734.7 years

Example 6Finding the model from two readings

A population is modelled by P=AektP = Ae^{kt}. When t=0t = 0, P=500P = 500; when t=4t = 4, P=800P = 800. Find kk, and the population when t=10t = 10.

Show the solution
  1. 1Initial value

    A=500A = 500.

  2. 2Find kk

    800=500e4k⇒e4k=1.6⇒k=14ln⁡1.6=0.1175800 = 500e^{4k} \Rightarrow e^{4k} = 1.6 \Rightarrow k = \tfrac14\ln1.6 = 0.1175.

  3. 3Predict

    P(10)=500e10k=500×1.62.5=1619P(10) = 500e^{10k} = 500 \times 1.6^{2.5} = 1619.

Answer

k=0.1175k = 0.1175, P(10)≈1619P(10) \approx 1619

Example 7Reading a power law from a log graph

A graph of log⁡10y\log_{10} y against log⁡10x\log_{10} x is a straight line with gradient 1.51.5 passing through (0,0.6)(0, 0.6). Find yy in terms of xx.

Show the solution
  1. 1Model

    y=axn⇒log⁡y=nlog⁡x+log⁡ay = ax^n \Rightarrow \log y = n\log x + \log a.

  2. 2Match

    n=1.5n = 1.5 and log⁡a=0.6⇒a=100.6=3.98\log a = 0.6 \Rightarrow a = 10^{0.6} = 3.98.

  3. 3Write the model

    y=3.98x1.5y = 3.98x^{1.5}.

Answer

y=3.98x1.5y = 3.98x^{1.5}

Example 8Sketching a transformed exponential

Sketch y=3−e−xy = 3 - e^{-x}, showing the intercept and asymptote.

Show the solution
  1. 1Start with e−xe^{-x}

    Decreasing, through (0,1)(0, 1), asymptote y=0y = 0.

  2. 2Reflect and shift

    −e−x-e^{-x} is increasing, through (0,−1)(0, -1), below the axis. Adding 3 moves it up 3.

  3. 3Key features

    yy-intercept (0,2)(0, 2); horizontal asymptote y=3y = 3 as x→∞x \to \infty; xx-intercept where e−x=3e^{-x} = 3, x=−ln⁡3x = -\ln 3.

Answer

Through (0,2)(0, 2) and (−ln⁡3,0)(-\ln3, 0), asymptote y=3y = 3

Beyond the specification

University-level ideas and the deeper mathematics behind this topic. Not needed for exams, but this is where the subject really opens up.

Defining exponentials and logs properly (university)

What is 222^{\sqrt2}? You cannot multiply 22 by itself "2\sqrt2 times". Integer powers are repeated multiplication, rational powers are roots, but irrational powers need a genuinely new definition. Analysis gives one, starting from the logarithm.

DefinitionThe natural logarithm

For x>0x > 0: ln⁡x=∫1xdtt\displaystyle\ln x = \int_1^x\frac{dt}{t}.

Theoremln⁡(ab)=ln⁡a+ln⁡b\ln(ab) = \ln a + \ln b
Proof

In ∫aabdtt\int_a^{ab}\frac{dt}{t} substitute t=aut = au: dt=a dudt = a\,du, and the limits become 11 to bb. So ∫aabdtt=∫1ba duau=ln⁡b\int_a^{ab}\frac{dt}{t} = \int_1^b\frac{a\,du}{au} = \ln b. Hence ln⁡(ab)=∫1a+∫aab=ln⁡a+ln⁡b\ln(ab) = \int_1^a + \int_a^{ab} = \ln a + \ln b.

∎

From the definition: ln⁡\ln is differentiable with ln⁡′x=1x>0\ln' x = \frac1x > 0, so it is strictly increasing. Also ln⁡(2n)=nln⁡2→∞\ln(2^n) = n\ln 2 \to \infty and ln⁡(2−n)→−∞\ln(2^{-n}) \to -\infty. So ln⁡\ln is a bijection from (0,∞)(0, \infty) onto R\mathbb{R}.

DefinitionThe exponential function and real powers

exp⁡\exp is the inverse of ln⁡\ln. Then e=exp⁡(1)e = \exp(1), and for a>0a > 0 and any real xx,

ax=exp⁡(xln⁡a).a^x = \exp(x\ln a).

Everything else is now a theorem:

  • Index laws: ax+y=exp⁡((x+y)ln⁡a)=exp⁡(xln⁡a)exp⁡(yln⁡a)=axaya^{x+y} = \exp\big((x + y)\ln a\big) = \exp(x\ln a)\exp(y\ln a) = a^xa^y.
  • Consistency: for whole numbers this agrees with repeated multiplication, and for x=pqx = \frac pq with apq\sqrt[q]{a^p}.
  • Continuity: axa^x is continuous and differentiable in xx, so 222^{\sqrt2} is the limit of 21.4,21.41,21.414,…2^{1.4}, 2^{1.41}, 2^{1.414}, \ldots, matching intuition.
  • The derivative: ddxexp⁡(x)=exp⁡(x)\frac{d}{dx}\exp(x) = \exp(x), by the inverse function rule: 1ln⁡′(exp⁡x)=exp⁡x\frac{1}{\ln'(\exp x)} = \exp x.

This approach (log first, via an integral) is used in many analysis courses. The alternative is the power series exp⁡x=∑xnn!\exp x = \sum\frac{x^n}{n!} (see the Differentiation lesson). The two definitions give the same function, which is a theorem in its own right.

Mathematical curiosityIs 222^{\sqrt2} rational?

No. The Gelfond–Schneider theorem (1934) says that if aa and bb are algebraic, a≠0,1a \ne 0, 1, and bb is irrational, then aba^b is transcendental. So 222^{\sqrt2} is transcendental. This settled Hilbert's 7th problem. Yet there is a one-line proof that some irrational x,yx, y have xyx^y rational: either 22\sqrt2^{\sqrt2} is rational (done), or it is not, and then (22)2=22=2\left(\sqrt2^{\sqrt2}\right)^{\sqrt2} = \sqrt2^2 = 2.

Why exponentials are inevitable (university)

Why do exponentials appear everywhere in science? Because they are the only sensible functions that turn addition into multiplication.

TheoremCauchy's exponential equation

If f:R→(0,∞)f: \mathbb{R}\to(0, \infty) is continuous and f(x+y)=f(x)f(y)f(x + y) = f(x)f(y) for all x,yx, y, then f(x)=axf(x) = a^x, where a=f(1)a = f(1).

Proof

Let g=ln⁡fg = \ln f, so g(x+y)=g(x)+g(y)g(x + y) = g(x) + g(y).

  • Integers: g(n)=ng(1)g(n) = ng(1) by induction, and g(0)=0g(0) = 0 (put x=y=0x = y = 0), g(−n)=−g(n)g(-n) = -g(n).
  • Rationals: qg(pq)=g(p)=pg(1)qg\left(\frac pq\right) = g(p) = pg(1), so g(pq)=pqg(1)g\left(\frac pq\right) = \frac pqg(1).
  • Reals: every real is a limit of rationals, and gg is continuous, so g(x)=xg(1)g(x) = xg(1) for all xx.

Hence f(x)=exg(1)=axf(x) = e^{xg(1)} = a^x with a=eg(1)=f(1)a = e^{g(1)} = f(1).

∎

Why this matters. Any process whose growth over a time s+ts + t is the growth over ss followed by the growth over tt must be exponential. That covers radioactive decay (nuclei do not age), compound interest, and the survival function of a memoryless waiting time. "Memoryless" and "exponential" are the same thing.

Similarly, a continuous ff with f(xy)=f(x)+f(y)f(xy) = f(x) + f(y) on (0,∞)(0, \infty) must be a multiple of ln⁡\ln. That is why every measure of quantities that combine by multiplying (information, loudness, acidity, earthquake energy) ends up on a log scale.

CounterexampleWithout continuity, things go wild

There are solutions of g(x+y)=g(x)+g(y)g(x + y) = g(x) + g(y) that are not of the form cxcx. They need the axiom of choice to construct: view R\mathbb{R} as a vector space over Q\mathbb{Q}, choose a basis (a Hamel basis), and define gg linearly with respect to it. Such gg have graphs that are dense in the whole plane, and they are not measurable. So the continuity assumption is doing real work.

Orders of growth (university)

As n→∞n \to \infty:

ln⁡n  ≪  nε  ≪  nk  ≪  an  ≪  n!  ≪  nn(ε>0, k fixed, a>1),\ln n \;\ll\; n^{\varepsilon} \;\ll\; n^k \;\ll\; a^n \;\ll\; n! \;\ll\; n^n \qquad (\varepsilon > 0,\ k \text{ fixed},\ a > 1),

where f≪gf \ll g means fg→0\frac fg \to 0.

TheoremExponentials beat powers

For any kk and any a>1a > 1, nkan→0\frac{n^k}{a^n} \to 0.

Proof

Write a=1+ha = 1 + h with h>0h > 0. For n>2kn > 2k, the binomial theorem gives

an≥(nk+1)hk+1≥(n/2)k+1(k+1)!hk+1,a^n \ge \binom{n}{k+1}h^{k+1} \ge \frac{(n/2)^{k+1}}{(k+1)!}h^{k+1},

which is a constant multiple of nk+1n^{k+1}. So nkan≤Cn→0\frac{n^k}{a^n} \le \frac{C}{n} \to 0.

∎
TheoremPowers beat logs

For any ε>0\varepsilon > 0, ln⁡nnε→0\frac{\ln n}{n^\varepsilon} \to 0.

Proof

Put n=em/εn = e^{m/\varepsilon}. Then ln⁡nnε=m/εem→0\frac{\ln n}{n^\varepsilon} = \frac{m/\varepsilon}{e^m} \to 0 by the previous theorem (with eme^m in place of ana^n).

∎
TheoremFactorials beat exponentials

ann!→0\frac{a^n}{n!} \to 0 for every aa.

Why: once n>2an > 2a, each extra factor an\frac{a}{n} is less than 12\frac12. (This is also why ∑ann!\sum\frac{a^n}{n!} converges for every aa.)

Why computer scientists care

An algorithm taking log⁡2n\log_2n steps (binary search) handles a billion items in 3030 steps. One taking n2n^2 steps needs 101810^{18}. One taking 2n2^n steps (brute-force search) is hopeless for n=100n = 100, since 2100>10302^{100} > 10^{30}. The great open problem P vs NP asks, roughly, whether many problems that seem to need exponential time can actually be solved in polynomial time.

Logarithms and the primes

TheoremThe Prime Number Theorem (Hadamard, de la Vallée Poussin, 1896)

The number of primes up to xx satisfies π(x)∼xln⁡x\pi(x) \sim \frac{x}{\ln x}.

So the "probability" that a number near xx is prime is about 1ln⁡x\frac{1}{\ln x}. Near 1010010^{100}, roughly one number in 230230 is prime. Gauss guessed this at age 15 from tables of primes. The proof needed complex analysis and the zeta function (see Sequences and series).

Logarithms as a measure of information (university)

How much information is in a message? Shannon (1948) argued that if two independent events have probabilities pp and qq, learning both should give the sum of their separate informations, while their joint probability is the product pqpq. Only a logarithm turns products into sums (previous section), so the information in an event of probability pp must be

I(p)=−log⁡2p bits.I(p) = -\log_2p \text{ bits}.

A fair coin flip carries 11 bit, and a roll of a fair die carries log⁡26≈2.585\log_26 \approx 2.585 bits.

DefinitionShannon entropy

For a random variable taking values with probabilities p1,…,pnp_1, \ldots, p_n, the entropy (average information) is

H=−∑ipilog⁡2pi.H = -\sum_ip_i\log_2p_i.

HH is largest, log⁡2n\log_2n, when all outcomes are equally likely, and it is 00 when one outcome is certain. Entropy is the theoretical limit of data compression: English text has about 11 to 1.51.5 bits of information per letter, which is why a zip file of a novel is so much smaller than the original.

Logarithmic scales in science

scaledefinitiona step of 1 means
decibels10log⁡10PP010\log_{10}\frac{P}{P_0}×1.26\times1.26 power (+10+10 dB =×10= \times10)
pH−log⁡10[H+]-\log_{10}[\text{H}^+]×10\times10 less acidic
Richter / moment magnitude≈23log⁡10E+c\approx\frac23\log_{10}E + c≈×32\approx\times32 energy
stellar magnitude−2.5log⁡10FF0-2.5\log_{10}\frac{F}{F_0}×12.512\times\frac{1}{2.512} brightness

Human senses work roughly logarithmically (the Weber–Fechner law): we notice ratios, not differences. A 10%10\% increase in loudness feels similar whether the sound is quiet or loud.

Mathematical curiosityEntropy in physics

Boltzmann's formula S=kln⁡WS = k\ln W, carved on his gravestone in Vienna, defines thermodynamic entropy as the logarithm of the number WW of microscopic arrangements. It has the same mathematical form as Shannon's entropy. Information theory and the second law of thermodynamics are, at bottom, the same mathematics.

Why does this work?

Why does this work?Why is ee the natural base?

For y=axy = a^x, dydx=lim⁡h→0ax+h−axh=ax⋅lim⁡h→0ah−1h\frac{dy}{dx} = \lim_{h\to0}\frac{a^{x + h} - a^x}{h} = a^x \cdot \lim_{h\to0}\frac{a^h - 1}{h}. The limit is a constant kak_a; for a=2a = 2 it is 0.693…0.693\ldots, for a=3a = 3 it is 1.0986…1.0986\ldots The base for which ka=1k_a = 1 is called ee. Equivalently e=lim⁡n→∞(1+1n)ne = \lim_{n\to\infty}\left(1 + \frac1n\right)^n, the limit of compounding interest ever more often.

Beyond the syllabus

Beyond the syllabusee is irrational

e=∑k=0∞1k!e = \sum_{k=0}^\infty\frac{1}{k!}. Suppose e=pqe = \frac pq. Then N=q!(e−∑k=0q1k!)N = q!\left(e - \sum_{k=0}^q\frac1{k!}\right) is an integer (both parts are), and positive. But N=1q+1+1(q+1)(q+2)+⋯<1q+1+1(q+1)2+⋯=1q≤1N = \frac{1}{q + 1} + \frac{1}{(q + 1)(q + 2)} + \dots < \frac1{q + 1} + \frac{1}{(q + 1)^2} + \dots = \frac1q \le 1. An integer strictly between 00 and 11 is impossible. ■\blacksquare (Hermite later proved ee is transcendental: not a root of any polynomial with integer coefficients.)

Beyond the syllabusLogarithms and the primes

The number of primes up to xx is approximately xln⁡x\frac{x}{\ln x} (the prime number theorem, 1896). Even better is Li⁡(x)=∫2xdtln⁡t\operatorname{Li}(x) = \int_2^x\frac{dt}{\ln t}. How good this approximation is depends on the location of the zeros of the Riemann zeta function, the subject of the Riemann hypothesis, the most famous unsolved problem in mathematics.

Mathematical curiosities

Mathematical curiosityBenford's law

In many real data sets (populations, river lengths, accounts) the first digit is dd with probability log⁡10(1+1d)\log_{10}\left(1 + \frac1d\right): about 30% start with 1 and under 5% with 9. Data spread over several orders of magnitude are roughly uniform on a logarithmic scale.

Further exploration

Further explorationInvestigations
  • Which is bigger, eπe^\pi or πe\pi^e? (Study f(x)=ln⁡xxf(x) = \frac{\ln x}{x}.)
  • Show that xy=yxx^y = y^x with x<yx < y positive integers has only the solution 24=422^4 = 4^2.
Now practise60 questions from Very easy to Extreme →