Basis Lab

Logarithms, Growth and Scale

Thinking in Orders of Magnitude

Last timeWhat Decays, and How Fast

An answer to within a factor of ten is cheap, fast and usually enough to make a decision. The method is a product of guesses, and the arithmetic that makes it reliable is addition in log space.

Here is a question of the kind that arrives without warning in a meeting. A

service logs every request, the logs are kept for a year, and somebody asks how

much storage that will need. Nobody present has the number.

An hour with the real traffic data would produce a good answer. Two minutes of

arithmetic produces an answer good to within a factor of ten, which is almost

always the answer the meeting needed, because the decision was whether this is

a trivial cost, a line item, or a project.

The method

Break the unknown into a product of factors, each of which is something you

have either seen or can bound. Round each one to one digit and a power of ten.

Then add the exponents, which is the whole reason this course has been about

logarithms.

FIG 1A year of logs, estimated in two minutes
stepthe factorthe guessas a power of tenwhere the guess came from
1requests per second, at the busy timeabout 3003 times 10^2the service has a few thousand active users and they are not constantly clicking
2seconds in a yearabout 30 million3 times 10^7an anchor worth memorising: it is pi times ten million, near enough
3busy fraction of the dayabout one third3 times 10^-1traffic is concentrated in working hours, so a third rather than all of it
4bytes per log lineabout 5005 times 10^2a line with a timestamp, a path, a status and some identifiers
5multiply the digits3 times 3 times 3 times 5 is 135, so about 10010^2the digits are rounded hard on purpose, since they contribute almost nothing
6add the exponents2 plus 7 minus 1 plus 2, which is 1010^10this is the only step that has to be done carefully
7the answerabout 10^12 bytesa terabyteone disk, so a line item rather than a project
7 steps
Four guesses, none of them defensible on its own, and one answer that is almost certainly right to within a factor of ten. The honest reading is a terabyte give or take, which settles the question that was asked: this is one ordinary disk, so the storage is not the thing to worry about and the conversation should move to retention policy and query cost. Notice where the effort went. The digits were rounded brutally and the exponents were added carefully, because an error in a digit costs a factor of two and an error in an exponent costs a factor of ten.

Anchors rather than intuition

People who are good at this do not have better instincts. They have a small

number of reference quantities memorised to one digit and a power of ten, and

they reach everything else by multiplying.

The list is shorter than it looks, and the precision required is almost

insultingly low.

The lesson stops here

3 more paragraphs to go

You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.

The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.

See the planThe contents

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

The rest of this course

  1. 01Growing by Multiplying
  2. 02The Question a Logarithm Answersopening only
  3. 03Multiplication Becomes Additionopening only
  4. 04Two, Ten, and the Awkward Oneopening only
  5. 05A Chart With a Squashed Axisopening only
  6. 06Why Every Score Is a Log Probabilityopening only
  7. 07What Decays, and How Fastopening only
  8. 08Thinking in Orders of Magnitudeyou are here

Read alongside