Applied Mathematics · Section 5
Logarithmic Series
From a shrinking fraction, integrated — to the dial that tames the unimaginably large.
Here's a piece of magic the engineers of 1614 would have traded a finger for: a way to turn multiplication — slow, miserable, error-strewn multiplication — into plain addition. That's the logarithm, and it ran every serious calculation on Earth for three hundred years, from the orbits of planets to the spans of bridges, until the pocket calculator quietly retired it. But the logarithm isn't really a new idea at all. Back in Section 1 we took the geometric series, added up the area underneath it, and a logarithm fell out the bottom — almost as an afterthought. This section is that afterthought, taken seriously. We'll watch the same shrinking-fraction series we already know turn itself, by one stroke of integration, into the function that compresses the loudness of a jet and the faintness of a whisper onto the same small dial; that measures information in bits; that makes "search a million things" cost only twenty steps. And we'll see exactly where it crawls, where it lies, and why — for all its power — it's the slowest, most patient series in the whole book.
Chapter One — Theory
1. From the Geometric Series to the Logarithm
Let me bring back the one identity that started this whole book. The geometric series — shave a number by the same fraction over and over, and the endless pile adds up to something finite. With a sign flipped on the ratio, it reads:
Now here's the move, and it's the same one we glimpsed at the close of Section 1. This isn't a fact about one number — it's an equality between two functions of $t$, true all along the stretch $|t|<1$. And when two functions agree over a whole stretch, so does the area underneath them. So let's integrate both sides, from $0$ up to some $x$, and just see what we're handed.
Left side — what's the area under $1/(1+t)$?
That one you may already know: the antiderivative of $\frac{1}{1+t}$ is $\ln(1+t)$. So $\int_0^x \frac{dt}{1+t} = \ln(1+x) - \ln(1) = \ln(1+x)$.
Right side — integrate the series term by term
Set the two equal — they have to be — and out drops one of the loveliest series in mathematics, gotten for almost nothing:
Look how close to the surface it was sitting. We didn't invent anything — we took a series we'd had since the first page and added up its area, and the logarithm was waiting underneath.
The other face: inverse of the exponential
And there's a second way to see what this thing is, which we owe to Section 4. The exponential is the function that grows in proportion to itself; the logarithm is simply its mirror. If $e^y = 1+x$, then by definition $y = \ln(1+x)$ — the log undoes the exponential. So everything Section 4 told you about $e^x$ has a shadow here: where the exponential takes a sum in the exponent and turns it into a product ($e^{a+b}=e^a e^b$), the logarithm runs that backward and turns a product into a sum. Hold onto that — it's the single most useful thing the logarithm does, and we'll come back to it in Chapter Four.
So the logarithm sits at a crossroads in this book: it is the geometric series of Section 1, integrated, and it is the exponential of Section 4, inverted. Two roads in, one quiet function out.
Chapter Two — Theory
2. Convergence and the Boundary
Now I wrote a little condition next to that boxed result — $-1 < x \le 1$ — and that condition is not bookkeeping. It's the whole drama. Because the series came from integrating the geometric series, it inherits the geometric series' fussiness about where it's allowed to live. Inside $|x|<1$ the terms $x^k/k$ shrink fast and the sum settles. But the two ends of the interval are where the real story is, so let's walk right up to each edge and look over.
The right edge: $x = 1$ gives $\ln 2$, painfully
Set $x=1$. Every power $1^k$ is just $1$, so the series collapses to
This is the famous alternating harmonic series, and it's a small miracle: it converges, even though its terms only shrink like $1/k$ — about as slowly as anything can while still dying away. Why does it converge when the steps are so reluctant to vanish? Because the signs flip. Each term overshoots the target, the next undershoots it, and the swings get smaller, so the partial sums close in on $\ln 2$ from both sides like a clamp tightening. But — and you can feel this coming — it tightens with agonizing slowness. To pin down $\ln 2$ to even three decimal places this way, you'd need thousands of terms. Hold that thought; it's the seed of Chapter Three.
The left edge: $x = -1$ blows up — and it should
Now creep to the other end, $x=-1$. Each $(-1)^k$ cancels the alternating sign, and every term goes negative:
Inside the parentheses sits the harmonic series, and here's the famous fact: it diverges. It crawls, but it never stops climbing — it will eventually pass any number you name. So the right-hand side runs off to $-\infty$. And isn't that exactly right? The left side is $\ln(1+(-1)) = \ln 0$, and $\ln 0$ really is $-\infty$ — to get a number down to zero by the exponential you'd have to go infinitely far down. The series isn't malfunctioning at the edge; it's faithfully reporting that the logarithm itself falls off a cliff there.
At $x=1$ the alternating signs rescue a barely-shrinking series and it converges (slowly) to $\ln 2$. At $x=-1$ there's no rescue — the harmonic series diverges to $-\infty$, which is precisely $\ln 0$. The boundary of convergence is the function telling the truth about itself.
That asymmetry — fine at one end, catastrophic at the other — is the logarithm's signature, and we'll see it again in the lab.
Chapter Three — Theory
3. Why the Logarithm Crawls — and How to Compute It Fast
Look hard at the series again: $x - \frac{x^2}{2} + \frac{x^3}{3} - \cdots$. Every single term carries a $\frac{1}{k}$ out front, dragging it down. Compare that to the exponential of Section 4, where each term is divided by the explosively-growing $k!$ and the whole thing converges in a handful of terms. The logarithm has only $k$ in the denominator — the gentlest possible brake — so it converges like a snail. And here is the beautiful part: that very sluggishness is the logarithm's superpower in disguise.
Because the function grows so reluctantly, it can swallow enormous inputs and give back tame outputs. Multiply your input by a thousand, and $\ln$ goes up by only about $6.9$. Multiply by a million, and it climbs by just $13.8$. The slowness is the compression. Every log scale you'll meet in Chapter Five — decibels, pH, Richter, the running time of a good algorithm — is cashing in on this one fact: the logarithm flattens the unimaginably large into something a human can hold in one hand.
But slowness is a problem if you actually need a number
For squashing scales, slow growth is a gift. For computing a logarithm, it's a curse. We saw it in Chapter Two: getting $\ln 2$ from the raw series takes thousands of terms. No calculator could afford that. So how does a machine — which can only add, multiply, and divide — actually produce $\ln$? It uses a cleverer series. Watch this trick. Take the logarithmic series at $+x$ and at $-x$ and subtract:
All the even powers cancel, the signs stop alternating, and what's left is $2\,\operatorname{artanh}(x)$ — a series in odd powers only, which converges far faster. To get any number $u>0$, you solve $\frac{1+x}{1-x}=u$ for $x = \frac{u-1}{u+1}$, and now $x$ is small even when $u$ is not, so a few terms suffice.
And one more practical dodge: range reduction
Even the fast series wants a modest input. So before computing anything, a machine first peels the number down to size using the multiplication-into-addition law (Chapter Four). Any positive $a$ can be written $a = m \cdot 2^{k}$ with $m$ between $1$ and $2$, and then
Now $\ln 2$ is a single constant baked into the chip, $k$ is just an exponent it reads off for free, and $\ln m$ — for $m$ already close to $1$ — comes from a couple of terms of the fast series. That's the real recipe: shrink the range with the addition law, then finish with a rapidly-converging series. Slow series, clever packaging.
Chapter Four — Theory
4. The Great Gift — and the Toolkit
We've leaned on it twice already, so let's finally put it center stage, because it is the reason the logarithm was invented in the first place. The exponential turns adding into multiplying; the logarithm, its inverse, runs that backward:
Sit with how strange and wonderful that is. The hardest of the elementary operations — multiplying two big awkward numbers — gets traded for the easiest, adding. That single trade is what John Napier sold the world in 1614, and it's why the slide rule (Chapter Five) sat in every engineer's pocket until about 1975. It's also, as we'll see, why machine-learning code takes the log of a probability before doing anything else: a product of a thousand tiny probabilities, which would vanish to zero, becomes a sum of a thousand manageable numbers.
One more practical note: the natural log $\ln$ (base $e$) is the one the series gives, but you'll meet $\log_2$ (information, bits) and $\log_{10}$ (decibels, pH) constantly. They're all the same function up to a constant stretch — $\log_b a = \ln a / \ln b$ — so everything here transfers with a single multiply. Keep that in your back pocket; mixing the bases up is one of the quiet bugs in Chapter Six·c.
The toolkit
Here's the whole section on one card. Keep it beside you for the applications — it's all you'll need.
| Identity | Closed form / series | Condition |
|---|---|---|
| Logarithmic series | $x-\dfrac{x^2}{2}+\dfrac{x^3}{3}-\cdots$ | $-1<x\le1$ |
| Small-$x$ shortcut | $\ln(1+x)\approx x-\dfrac{x^2}{2}$ | $|x|\ll1$ |
| $\ln 2$ at the edge | $1-\tfrac12+\tfrac13-\tfrac14+\cdots$ | $x=1$ (slow) |
| Fast series | $2\!\left(x+\dfrac{x^3}{3}+\dfrac{x^5}{5}+\cdots\right)$ | $|x|<1$ |
| Multiplication law | $\ln(ab)=\ln a+\ln b$ | $a,b>0$ |
| Derivative | $\dfrac{d}{dx}\ln x=\dfrac{1}{x}$ | $x>0$ |
| Change of base | $\log_b a=\dfrac{\ln a}{\ln b}$ | $a,b>0$ |
Chapter Five — Applications
5. Real-World Applications
For each of these, keep your eye on the same two fingerprints. Either someone needs to turn a runaway product into a sum, or they need to squash a span of many orders of magnitude onto one small dial. Every time, the logarithm is the tool — and its slow crawl is exactly why it works.
How much information is in a surprise?
The problem. Claude Shannon, 1948, wants to measure information with a number. The intuition is plain: learning something you already expected tells you nothing; learning something rare tells you a lot. "The sun rose" — zero information. "It snowed in the Sahara" — a great deal. How do you turn "rare" into a quantity, and one that adds up sensibly across independent facts?
The move. Tie information to probability through the logarithm. Define the surprise of an event of probability $p$ as
Why the log is forced on you. Two independent facts should carry information that adds: learn one, then the other, and your total surprise is the sum. But their probabilities multiply ($p_1 p_2$). The only function that turns multiplying into adding is — you guessed it — the logarithm (Chapter Four). So $I$ must be a log; nothing else works. A fair coin has $p=\tfrac12$, giving $-\log_2\tfrac12 = 1$ bit — exactly one yes/no answer's worth. A one-in-a-million event carries $\log_2 10^6 \approx 20$ bits. Average the surprise over all outcomes and you get Shannon's entropy, $H=-\sum p\log_2 p$, the bedrock number behind every compression scheme and every communication channel on Earth.
How do you put a whisper and a jet engine on the same axis?
The problem. A jet at takeoff carries something like a trillion times the sound power of a quiet room. Pin both to a linear scale and the room is an invisible smudge against the wall. Loudness, acidity, earthquake energy, star brightness — physical quantities routinely span ten or twelve orders of magnitude. No linear ruler can show them together.
The move. Take the logarithm of the ratio. The decibel is $10\log_{10}(P/P_0)$; pH is $-\log_{10}[\mathrm{H^+}]$; the Richter magnitude and stellar magnitude are the same idea.
Why it tames the range. This is Chapter Three cashing in. Because the log crawls, a factor of a trillion ($10^{12}$) in power becomes just $120$ decibels — a number you can mark on a knob. Each $\times10$ in the underlying quantity is one fixed step on the dial: $+10$ dB, $+1$ pH unit, $+1$ Richter. And there's a human bonus — our own senses (hearing, brightness) already respond roughly to the log of a stimulus, so a log scale isn't just convenient, it actually matches the way we perceive the world.
How can you search a million things in twenty steps?
The problem. You've a sorted list of a million names and you want one of them. Checking one at a time averages half a million looks — hopeless at scale. Can you do dramatically better?
The move. Binary search: look at the middle, throw away half, repeat. Each step halves what's left, so the number of steps to crack $n$ items is
Why it feels like magic. Here is the slow crawl of Chapter Three working for you instead of against you. Because the log grows so reluctantly, the cost barely moves as the problem explodes: a thousand items take $10$ steps, a million take $20$, a billion take just $30$. Double the data and you add a single step. This one fact — $\log_2 n$ stays tiny while $n$ runs away — is why balanced trees, database indexes, and divide-and-conquer algorithms scale to the whole internet. "It's $O(\log n)$" is an engineer's way of saying "it's basically free."
How do you multiply a million probabilities without hitting zero?
The problem. To fit a model, you ask: how likely is all my data, given these parameters? For independent data points that likelihood is a product of thousands of probabilities, each below $1$. Multiply a few thousand numbers like $0.01$ together and the result underflows to a literal $0.0$ in the computer — and you can't optimize zero.
The move. Maximize the log-likelihood instead. By the law of Chapter Four, the log of a product is the sum of the logs:
Why it rescues everything. The vanishing product becomes a tame, well-behaved sum of manageable negative numbers — no underflow, and the maximum lands in the same place because $\ln$ is increasing. This is not a niche trick; it is the default. Train almost any classifier and the loss you minimize is cross-entropy — the negative log-likelihood — which is information theory (§5.1) and the addition law shaking hands. Every neural network you've used was trained by adding up logs.
Why do quants measure returns in logs?
The problem. A stock goes up 10% one day and down 10% the next. Are you back where you started? No — you're at $1.10\times0.90 = 0.99$, down 1%. Simple percentage returns don't add across time; they multiply, and that makes them clumsy to total, average, or model.
The move. Use the log return, $\ln(P_t/P_{t-1})$. Because the log turns the multiplying chain of daily growth factors into a sum, log returns add cleanly over time: a week's return is just the sum of its days.
The bonus from the series. And for the small moves that dominate day to day, the very first term of our series saves the day: $\ln(1+r)\approx r$ when $r$ is small (Chapter One, and the binomial/Taylor approximation of the earlier sections). So a $+0.5\%$ day is a log return of almost exactly $0.005$ — the log return and the simple return agree to the eye, yet the log version is the one that adds up over a month, models cleanly as a random walk, and keeps prices honestly positive. That's why the quant's spreadsheet is full of logs.
How did engineers multiply for 300 years without a calculator?
The problem. Before electronics, multiplying two seven-digit numbers by hand was a slow, blunder-prone slog — and astronomers, navigators, and engineers had to do it all day long. Lives and ships rode on getting it right.
The move. Napier's logarithms, made physical as the slide rule. Lay out two rulers whose markings are spaced by $\ln$ of the number, so that distance along the ruler equals the logarithm. To multiply $a$ by $b$, you slide one ruler so you add their lengths — and by $\ln(ab)=\ln a+\ln b$, the combined length lands you exactly at the product.
Why it's the addition law made wood and brass. The slide rule is Chapter Four you can hold: it converts every multiplication into a physical addition of lengths. From Napier in 1614 through the Apollo program — engineers checked the Moon-landing trajectories on slide rules — three and a half centuries of science ran on this one identity. The logarithm didn't just describe the world; for 300 years it was the machine we computed it with.
Interactive — Practice
▸ Interactive Lab
Now it's your turn. Drag the sliders and watch the series build, crawl, and compress. Two knobs run the show: $x$, where you're evaluating, and $N$, how many terms you keep. Watch the partial sum chase $\ln(1+x)$ — fast in the middle, hopelessly slow at the edge. Prefer the keyboard? Focus a slider and use the arrow keys; Home and End jump to the extremes.
Each problem from the book, made live. Drag its slider; the dashed line is always the value the logarithm predicts.
Chapter Six — Practice
6. Word Problems
Here's the thing about these — not one of them says "take a logarithm." Out in the world nobody tells you. Your job is to spot the tell: either a product that needs to become a sum, or a span of many orders of magnitude that needs squashing onto a dial. Find it, pick the right base, and solve.
You're thinking of one whole number between 1 and 1,000,000. I get to ask yes/no questions, and you answer honestly.
(a) What is the smallest number of questions that guarantees I find it? (b) In information terms, how many bits does your secret number contain?
An amplifier raises a signal's power by a factor of 1000.
(a) What is the gain in decibels? (b) A second stage adds another $\times 100$. What's the total gain in dB — and notice how you can get it without multiplying the ratios.
A sample of lemon juice has a hydrogen-ion concentration of $[\mathrm{H^+}] = 10^{-2.3}$ mol/L.
(a) What is its pH? (b) Pure water is pH 7. How many times more acidic (more $\mathrm{H^+}$) is the lemon juice?
A database holds 1 billion ($10^9$) sorted records. A lookup uses binary search.
(a) Worst-case number of comparisons? (b) The table grows to 2 billion. How many more comparisons does that cost?
A weather station reports "rain" 20% of days and "dry" 80%.
(a) How many bits of surprise does a "rain" day carry? (b) What is the average information per day (the entropy)?
You must compute $\ln(1.2)$ by hand, accurate to three decimals, with only $+,-,\times,\div$.
(a) Using the plain series with $x=0.2$, roughly how many terms do you need? (b) Now use the fast series with the matching small $x$ — how many terms then?
Solutions
Problem 1 — Twenty questions. (a) Each good question halves the field, so the count is $\log_2 1{,}000{,}000 \approx 19.93$ — round up to 20 questions. (b) Same number, read as information: a uniform choice among $10^6$ outcomes carries $\log_2 10^6 \approx 19.93$ bits. The bits and the questions are literally the same quantity — one yes/no answer is one bit.
What breaks this? The clean $\log_2 n$ assumes every question can split the remaining pool exactly in half. If your questions are clumsy (or the number isn't uniformly likely), some answers reveal less than a full bit and you'll need more. Optimal questioning is the entropy bound — you can't beat it, and you only meet it with perfect halving.
Problem 2 — Amplifier. (a) $10\log_{10}(1000) = 10\times 3 = \mathbf{30\ dB}$. (b) The second stage is $10\log_{10}(100)=20$ dB. Total power ratio is $1000\times100=10^5$, but you needn't multiply: by the addition law the dB just add, $30+20=\mathbf{50\ dB}$ — and indeed $10\log_{10}(10^5)=50$.
What breaks this? Decibels add only because the underlying ratios multiply and the log converts that to a sum. Mix up power ratios with amplitude (voltage/pressure) ratios and you'll be off by a factor of two, since amplitude dB use $20\log_{10}$, not $10\log_{10}$ — the silent base/coefficient bug of Chapter Six·c.
Problem 3 — Lemon juice. (a) $\mathrm{pH} = -\log_{10}(10^{-2.3}) = \mathbf{2.3}$. (b) The difference from water is $7 - 2.3 = 4.7$ pH units, and each unit is a factor of ten, so it's $10^{4.7}\approx \mathbf{50{,}000\times}$ more acidic. That enormous multiplier collapsing to "4.7 units apart" is the compression of Chapter Three in one bite.
What breaks this? The tidy subtraction hides a $50{,}000\times$ jump — wonderful for readability, dangerous if you forget it's there. Someone who reads "pH 2 vs pH 6" as "three times more acidic" instead of "ten thousand times" has been fooled by the very compression that makes the scale useful.
Problem 4 — Billion-record lookup. (a) $\lceil\log_2 10^9\rceil = \lceil 29.9\rceil = \mathbf{30}$ comparisons. (b) Doubling to $2\times10^9$ adds $\log_2 2 = 1$ — exactly one more comparison. That's the headline of the whole section: under a logarithm, doubling the world costs a single step.
What breaks this? It assumes the data is sorted and randomly addressable. On a structure where each "halving" actually costs a slow disk seek, the constant per step swamps the lovely $\log n$ count — the asymptotics are right but the real-world clock is dominated by the thing the model left out.
Problem 5 — Weather. (a) A rain day has $p=0.2$, so $-\log_2 0.2 \approx \mathbf{2.32\ bits}$ — more than a dry day's $-\log_2 0.8 \approx 0.32$ bits, because rain is rarer and so more informative. (b) Entropy $= -(0.2\log_2 0.2 + 0.8\log_2 0.8) \approx 0.2(2.32)+0.8(0.32) \approx \mathbf{0.72\ bits/day}$ — well under 1 bit, since the weather is fairly predictable.
What breaks this? The entropy formula assumes each day is independent of the last. Real weather is "sticky" — rain follows rain — so the true information per day is lower than 0.72, and a compressor that exploits that correlation beats the naive bound. Independence is the quiet assumption.
Problem 6 — Computing ln(1.2). (a) Plain series, $x=0.2$: terms are $0.2,\,0.02,\,0.00267,\,0.0004,\ldots$ The fourth term is already near $0.0004<0.0005$, so about 4 terms give $\ln 1.2\approx 0.1823$. (b) Fast series: $\frac{1+x}{1-x}=1.2 \Rightarrow x=\frac{0.2}{2.2}\approx0.0909$. Now $2x\approx0.1818$ and the next term $2x^3/3\approx0.0005$ — so just 2 terms nail three decimals. Same answer, a third of the work.
What breaks this? The plain series degrades exactly as Chapter Two warned: push $x$ toward $1$ and the term count explodes toward thousands. The fast series stays cheap because its $x$ is tiny by construction — which is the whole reason real libraries never touch the plain series near the edge.
Chapter Six·c — Practice
6c. When the Model Breaks
Now look — the logarithmic series, and the logarithm itself, keep a few promises quietly in the background. Every problem above honored them. The skill isn't plugging into $\ln$; it's noticing the moment one of these promises snaps:
- $-1 < x \le 1$ — the series only lives on that interval; outside it, it's nonsense.
- The input is positive — $\ln x$ doesn't exist for $x\le 0$ over the reals.
- You're averaging the right thing — the log of an average is not the average of the logs.
- Everyone agrees on the base — bits, nats, and decibels differ by silent constant factors.
A student wants $\ln 5$, so they write $\ln(1+4)$ and plug $x=4$ into $x-\frac{x^2}{2}+\frac{x^3}{3}-\cdots$. (a) What goes wrong? (b) How should they have done it?
(a) With $x=4$ the powers $4^k$ grow faster than the $\frac1k$ can tame them, so the terms balloon — $4,\,-8,\,21.3,\,-64,\ldots$ — and the partial sums swing wildly with no hope of settling. The series diverges; assumption 1 is violated. It's not that the answer is slightly off — there is no answer out there at all.
(b) Range-reduce first (Chapter Three). Write $5 = \frac{5}{4}\cdot 4$, so $\ln 5 = \ln\frac54 + \ln 4 = \ln(1+0.25) + 2\ln 2$. Now the series runs at $x=0.25$, comfortably inside the interval, and $\ln 2$ is a known constant. Pull the input back into the series' home before you evaluate.
To get $\ln 2$, a program sums $1-\frac12+\frac13-\cdots$ and stops after 1000 terms. (a) Is the answer right? (b) Why is this still a bad idea?
(a) It's converging to the right value — but after 1000 terms the error is still about $1/2000\approx 0.0005$, so you've barely scraped three decimals. The series is honest and hopeless at once.
(b) This is Section 1's lesson wearing a new coat: a convergent series is not automatically a usable one. The alternating harmonic series sits right on the boundary $x=1$, where convergence is at its very weakest. A real library never goes near it — it uses the fast (artanh) series, which gets ten digits from a handful of terms. Convergent answers your "does it settle?" question; it says nothing about "settles by when?"
A data pipeline computes $\ln p$ for probabilities $p$, and one batch contains an event that was assigned $p=0$. (a) What happens? (b) What's the fix?
(a) $\ln 0 = -\infty$ (Chapter Two saw this — it's the $x=-1$ cliff). In a computer that becomes
-inf, which then poisons every sum it touches: your whole log-likelihood becomes $-\infty$ and the optimizer is blind. Worse is $\ln$ of a negative number — undefined over the reals entirely (it lives in the complex plane). Assumption 2 broke.(b) Never hand the log a zero. In practice you clamp — compute $\ln(p+\varepsilon)$ with a tiny floor $\varepsilon$, or work with "log-probabilities" from the start and add a smoothing count so nothing is ever exactly impossible. Every serious ML framework guards its logs this way; the crash in part (a) is one of the most common bugs in numerical code.
An investment doubles one year ($\times 2$) and halves the next ($\times \tfrac12$). A report averages the returns as $\frac{+100\% + (-50\%)}{2} = +25\%$ per year and calls it a good fund. (a) What actually happened to the money? (b) What was averaged wrong?
This is the dangerous one, because nothing crashes and the number looks fine. The money is exactly where it started: $\times2\times\tfrac12 = \times1$, a $0\%$ true return — not $+25\%$.
(a) Growth multiplies across years, so the honest summary is the geometric mean ($\sqrt{2\cdot\tfrac12}=1$), not the arithmetic mean of percentages. (b) And the clean way to see it is through the log: $\ln 2 + \ln\frac12 = 0$, so the average log return is $0$ — correct. The blunder was averaging the raw returns instead of their logs. This is Jensen's inequality again (Section 1, Probe 5): because $\ln$ is concave, the log of the average overstates the average of the logs, so arithmetic-averaging multiplicative things always flatters the result. Average in the space where your quantities add — and for things that multiply, that space is the log.
A team's information code mixes a library that returns entropy in nats (natural log) with their own code expecting bits (log base 2). Everything runs; the numbers are just always too small. (a) By how much? (b) Why didn't it crash?
(a) Nats and bits differ by exactly the constant $\ln 2 \approx 0.693$: $1\text{ nat} = \frac{1}{\ln 2}\approx 1.443$ bits. So the team's numbers are systematically a factor of $\ln 2$ too small — every entropy off by 31%.
(b) Nothing crashed because all logs are the same function up to a scaling (Chapter Four, change of base) — the code is dimensionally consistent, just in the wrong unit. It's the decibel trap of Problem 2's footnote, generalized: $10\log_{10}$ vs $20\log_{10}$, nats vs bits vs dB. A logarithm without a stated base is like a length without a unit — the arithmetic is fine and the answer is still wrong.
The takeaway for modelers
| Ask… | If "no"… |
|---|---|
| Is the series argument in $(-1,1]$? | Diverges → range-reduce with $\ln(ab)=\ln a+\ln b$ (Probe 1) |
| Will it converge fast enough to use? | Near the edge it crawls → use the fast/artanh series (Probe 2) |
| Is every input strictly positive? | $\ln 0=-\infty$, $\ln(\text{neg})$ undefined → clamp / smooth (Probe 3) |
| Are you averaging additive quantities? | Multiplicative? → average the logs / geometric mean (Probe 4) |
| Is the base agreed on everywhere? | Silent factor of $\ln2$ or $\ln10$ → fix the units (Probe 5) |
And the marvelous part, same as every section: an absurd answer — a number that won't settle, a -inf, a fund that "made 25%" while the money sat still — isn't a wall. It's the logarithm leaning over and telling you which promise you broke. The deadliest case, as always, is the one that fires no alarm — Probe 4 — which is why you grill the assumptions before you ever trust the number.
Chapter Seven — Close
7. The One Pattern to Remember
The logarithm does two things, and they're the same thing seen twice. It turns multiplying into adding ($\ln(ab)=\ln a+\ln b$) — so reach for it whenever a runaway product needs to become a tame sum (likelihoods, log returns, bits of information, the slide rule). And it squashes the unimaginably large onto a human dial — so reach for it whenever a span of many orders of magnitude needs compressing (decibels, pH, Richter, the cost of searching a billion things). The price for both gifts is the same: it crawls, because every term of $x-\frac{x^2}{2}+\frac{x^3}{3}-\cdots$ is divided only by $k$.
And that's the whole story. The logarithmic series wasn't a new arrival — it was the geometric series of Section 1, integrated; the exponential of Section 4, turned inside out. Its slow convergence isn't a flaw to apologize for: it's the very thing that lets it flatten a trillion-to-one range into a number you can write on a knob, and lets binary search crack a billion records in thirty steps. The little condition $-1<x\le1$ isn't fussiness either — at one edge it gives you $\ln 2$, at the other it correctly falls off the cliff to $-\infty$. The boundary is the function being honest.
So whenever you see things that multiply, or a range too wide to look at — reach for the log. It will turn the product into a sum and the mountain into a molehill, patiently, one slow term at a time.
One series, born from Section 1 and inverse to Section 4 — turning × into +, and the vast into the small. It was the geometric series all along, just integrated.