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.
| step | the factor | the guess | as a power of ten | where the guess came from |
|---|---|---|---|---|
| 1 | requests per second, at the busy time | about 300 | 3 times 10^2 | the service has a few thousand active users and they are not constantly clicking |
| 2 | seconds in a year | about 30 million | 3 times 10^7 | an anchor worth memorising: it is pi times ten million, near enough |
| 3 | busy fraction of the day | about one third | 3 times 10^-1 | traffic is concentrated in working hours, so a third rather than all of it |
| 4 | bytes per log line | about 500 | 5 times 10^2 | a line with a timestamp, a path, a status and some identifiers |
| 5 | multiply the digits | 3 times 3 times 3 times 5 is 135, so about 100 | 10^2 | the digits are rounded hard on purpose, since they contribute almost nothing |
| 6 | add the exponents | 2 plus 7 minus 1 plus 2, which is 10 | 10^10 | this is the only step that has to be done carefully |
| 7 | the answer | about 10^12 bytes | a terabyte | one disk, so a line item rather than a project |
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 contentsThis 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