{"course":{"slug":"maths-you-need","title":"The Maths You Actually Need","url":"https://addaly.com/learn/maths-you-need","level":"intermediate","track":"deep"},"lesson":{"slug":"fermi-estimates-for-ml","title":"Estimating anything to within a factor of three","url":"https://addaly.com/learn/maths-you-need/fermi-estimates-for-ml","position":66,"of":76,"minutes":9,"answer":"Break a question into factors you can guess to within three, multiply, and track the powers of ten; with k independent guesses the result is uncertain by about 3^√k rather than 3^k.","keyIdea":"Break a question into factors you can guess to within three, multiply, and track the powers of ten; with k independent guesses the result is uncertain by about 3^√k rather than 3^k, so six rough factors still land within an order of magnitude, which is usually enough to decide."},"body":{"format":"markdown","text":"## The skill under every lesson in this module\n\nEnrico Fermi is said to have estimated the yield of the first atomic test by dropping scraps of paper as the blast wave passed and pacing out how far they travelled. The method is general: break a question you cannot answer into factors you can guess to within a factor of three, multiply them, and keep track of the powers of ten. The answer is rarely exact and almost always right about which order of magnitude you are in, and that is the thing you need to know before committing a week or a budget.\n\n## Worked: how many tokens is English Wikipedia?\n\n```\narticles              ≈ 7 million\nwords per article     ≈ 650 (most are short; a few are enormous)\ntokens per word       ≈ 1.3\n7 × 10^6 × 650 × 1.3  ≈ 6 × 10^9 tokens\n```\n\nThe published figures are around four to five billion. Within a factor of 1.5, from three guesses. And the answer is immediately useful: a trillion-token training set is two hundred Wikipedias, which tells you why training corpora are mostly not Wikipedia.\n\n## Worked: embedding ten million documents\n\n```\ndocuments                 10^7\ntokens per document       ≈ 500\ntotal tokens              5 × 10^9\nembedding model           ≈ 10^8 parameters → 2 × 10^8 FLOPs per token\ntotal FLOPs               10^18\nlaptop, 10^11 FLOP/s      10^7 s ≈ 4 months\none GPU, 10^14 effective  10^4 s ≈ 3 hours\n```\n\nThe plan changes at the fifth line. On a laptop this is not a job; it is a season. Rent a GPU for an afternoon, or use a smaller model, or embed a sample first. Any of these is a good decision, and all of them were invisible before the multiplication.\n\n## Worked: what a labelling project costs\n\n```\nitems                 10,000\nminutes per item      2\nhours                 333\nrate                  $20 per hour\ncost                  ≈ $6,700\nplus a second labeller on 20% for agreement:   ≈ $8,000\n```\n\nThat is a number a manager can act on, produced in thirty seconds. The course `evaluating-ai` says why the second labeller is not optional; the arithmetic says what it costs.\n\n## Worked: the monthly bill for a retrieval assistant\n\n```\nusers                     1,000\nqueries per user per day  20\ntokens per query          ≈ 3,000 (retrieved passages dominate)\ntokens per day            6 × 10^7\nprice                     ≈ $3 per million input tokens\ndaily cost                ≈ $180  →  monthly ≈ $5,400\n```\n\nIf the true answer is $2,000 or $15,000, you were within a factor of three and the estimate did its job, which was to tell you this is thousands a month and not tens or hundreds of thousands. It also shows where the lever is: the 3,000 tokens per query. Halve the retrieved context and halve the bill; nothing else on the list is as easy to move.\n\n## Why factors of three are enough\n\nEach guess is off by some factor, and the factors multiply. If every one of `k` guesses is uncertain by a factor of three, the product is *not* uncertain by `3^k`, because errors in different directions partly cancel. Working in logs, each error is a step of size `ln 3` in a random direction, and `k` random steps travel about `√k` steps in total. So the product is uncertain by about `3^√k`:\n\n```\nk = 4 factors:  3^2   ≈ 9\nk = 6 factors:  3^2.4 ≈ 15\n```\n\nSix careless guesses give an answer within an order of magnitude. That is often enough to decide, and when it is not, the estimate tells you which factor to go and measure, since the one you were least sure of dominates the error.\n\n## Habits that make estimates good\n\n- **Write the factors down.** An estimate in your head hides the guess that was wrong; on paper it is the line someone can correct.\n- **Anchor on numbers you know.** A page is about 500 words. A token is about four characters. A GPU-hour is a few dollars. A person labels a few hundred simple items an hour. A laptop does `10^11` FLOP/s and a data-centre GPU a thousand times that. Ten such anchors cover most questions in this field.\n- **Sanity-check the answer against something independent.** If the estimate says a job takes four months, ask whether anyone has done that job in an afternoon. If they have, one of your factors is wrong by a thousand, and it is worth finding which.\n- **Estimate before, then measure after.** A pipeline that runs in a tenth of the estimated time is as interesting as one that takes ten times longer; both mean you misunderstood something, and the misunderstanding is usually the more valuable lesson.\n\n## Where it fails\n\nFermi estimation multiplies independent factors. It cannot see a factor you forgot entirely, and in this field the forgotten factor is usually a limit rather than a rate: the memory that does not fit, the rate limit on an API, the bandwidth ceiling from three lessons ago, the disagreement between two labellers. The estimate tells you the size of the job if nothing is in the way. Then look for what is in the way."},"check":{"question":"An estimate is built from six factors, each of which you believe is right to within a factor of three either way. Roughly how uncertain is the product, and why?","options":[{"text":"About a factor of 3⁶, around 700, since each factor's error multiplies in.","correct":false,"tempting":"Assumes every error points the same way; in reality they partly cancel, and the total grows with the square root of the count."},{"text":"About a factor of 3, since the errors average out across six guesses.","correct":false,"tempting":"Overstates the cancellation; errors do not vanish, they add in log space like a random walk, giving √6 steps rather than zero."},{"text":"About a factor of 18, since six factors each contribute three.","correct":false,"tempting":"Adds the factors instead of compounding them; uncertainty multiplies, and the correct compounding uses √6 × ln 3 in the exponent."},{"text":"About a factor of 15: a √6-step random walk in log space.","correct":true}]},"prev":{"slug":"nearest-neighbour-search-arithmetic","title":"Finding the closest vector among ten million: the arithmetic of approximate search","url":"https://addaly.com/learn/maths-you-need/nearest-neighbour-search-arithmetic"},"next":{"slug":"floating-point-anatomy","title":"What a float32 actually stores, and where its seven digits run out","url":"https://addaly.com/learn/maths-you-need/floating-point-anatomy"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Source and assessment review continues. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'Estimating anything to within a factor of three', in The Maths You Actually Need. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/maths-you-need/fermi-estimates-for-ml (Accessed: 29 November 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"Estimating anything to within a factor of three","courseTitle":"The Maths You Actually Need","module":{"index":7,"slug":"cost-and-scale","title":"Counting the cost: complexity and the arithmetic of scale"},"answer":null,"keyIdea":"Break a question into factors you can guess to within three, multiply, and track the powers of ten; with k independent guesses the result is uncertain by about 3^√k rather than 3^k, so six rough factors still land within an order of magnitude, which is usually enough to decide.","hero":{"kind":"plate","image":null,"alt":null,"caption":null},"blocks":[{"t":"h2","id":"the-skill-under-every-lesson-in-this-module","runs":[{"text":"The skill under every lesson in this module"}]},{"t":"p","runs":[{"text":"Enrico Fermi is said to have estimated the yield of the first atomic test by dropping scraps of paper as the blast wave passed and pacing out how far they travelled. The method is general: break a question you cannot answer into factors you can guess to within a factor of three, multiply them, and keep track of the powers of ten. The answer is rarely exact and almost always right about which order of magnitude you are in, and that is the thing you need to know before committing a week or a budget."}]},{"t":"h2","id":"worked-how-many-tokens-is-english-wikipedia","runs":[{"text":"Worked: how many tokens is English Wikipedia?"}]},{"t":"code","lang":"","label":"Text","text":"articles              ≈ 7 million\nwords per article     ≈ 650 (most are short; a few are enormous)\ntokens per word       ≈ 1.3\n7 × 10^6 × 650 × 1.3  ≈ 6 × 10^9 tokens"},{"t":"p","runs":[{"text":"The published figures are around four to five billion. Within a factor of 1.5, from three guesses. And the answer is immediately useful: a trillion-token training set is two hundred Wikipedias, which tells you why training corpora are mostly not Wikipedia."}]},{"t":"h2","id":"worked-embedding-ten-million-documents","runs":[{"text":"Worked: embedding ten million documents"}]},{"t":"code","lang":"","label":"Text","text":"documents                 10^7\ntokens per document       ≈ 500\ntotal tokens              5 × 10^9\nembedding model           ≈ 10^8 parameters → 2 × 10^8 FLOPs per token\ntotal FLOPs               10^18\nlaptop, 10^11 FLOP/s      10^7 s ≈ 4 months\none GPU, 10^14 effective  10^4 s ≈ 3 hours"},{"t":"p","runs":[{"text":"The plan changes at the fifth line. On a laptop this is not a job; it is a season. Rent a GPU for an afternoon, or use a smaller model, or embed a sample first. Any of these is a good decision, and all of them were invisible before the multiplication."}]},{"t":"h2","id":"worked-what-a-labelling-project-costs","runs":[{"text":"Worked: what a labelling project costs"}]},{"t":"code","lang":"","label":"Text","text":"items                 10,000\nminutes per item      2\nhours                 333\nrate                  $20 per hour\ncost                  ≈ $6,700\nplus a second labeller on 20% for agreement:   ≈ $8,000"},{"t":"p","runs":[{"text":"That is a number a manager can act on, produced in thirty seconds. The course "},{"text":"evaluating-ai","code":true},{"text":" says why the second labeller is not optional; the arithmetic says what it costs."}]},{"t":"h2","id":"worked-the-monthly-bill-for-a-retrieval-assistant","runs":[{"text":"Worked: the monthly bill for a retrieval assistant"}]},{"t":"code","lang":"","label":"Text","text":"users                     1,000\nqueries per user per day  20\ntokens per query          ≈ 3,000 (retrieved passages dominate)\ntokens per day            6 × 10^7\nprice                     ≈ $3 per million input tokens\ndaily cost                ≈ $180  →  monthly ≈ $5,400"},{"t":"p","runs":[{"text":"If the true answer is $2,000 or $15,000, you were within a factor of three and the estimate did its job, which was to tell you this is thousands a month and not tens or hundreds of thousands. It also shows where the lever is: the 3,000 tokens per query. Halve the retrieved context and halve the bill; nothing else on the list is as easy to move."}]},{"t":"h2","id":"why-factors-of-three-are-enough","runs":[{"text":"Why factors of three are enough"}]},{"t":"p","runs":[{"text":"Each guess is off by some factor, and the factors multiply. If every one of "},{"text":"k","code":true},{"text":" guesses is uncertain by a factor of three, the product is "},{"text":"not","i":true},{"text":" uncertain by "},{"text":"3^k","code":true},{"text":", because errors in different directions partly cancel. Working in logs, each error is a step of size "},{"text":"ln 3","code":true},{"text":" in a random direction, and "},{"text":"k","code":true},{"text":" random steps travel about "},{"text":"√k","code":true},{"text":" steps in total. So the product is uncertain by about "},{"text":"3^√k","code":true},{"text":":"}]},{"t":"code","lang":"","label":"Text","text":"k = 4 factors:  3^2   ≈ 9\nk = 6 factors:  3^2.4 ≈ 15"},{"t":"p","runs":[{"text":"Six careless guesses give an answer within an order of magnitude. That is often enough to decide, and when it is not, the estimate tells you which factor to go and measure, since the one you were least sure of dominates the error."}]},{"t":"h2","id":"habits-that-make-estimates-good","runs":[{"text":"Habits that make estimates good"}]},{"t":"ul","items":[[{"text":"Write the factors down.","b":true},{"text":" An estimate in your head hides the guess that was wrong; on paper it is the line someone can correct."}],[{"text":"Anchor on numbers you know.","b":true},{"text":" A page is about 500 words. A token is about four characters. A GPU-hour is a few dollars. A person labels a few hundred simple items an hour. A laptop does "},{"text":"10^11","code":true},{"text":" FLOP/s and a data-centre GPU a thousand times that. Ten such anchors cover most questions in this field."}],[{"text":"Sanity-check the answer against something independent.","b":true},{"text":" If the estimate says a job takes four months, ask whether anyone has done that job in an afternoon. If they have, one of your factors is wrong by a thousand, and it is worth finding which."}],[{"text":"Estimate before, then measure after.","b":true},{"text":" A pipeline that runs in a tenth of the estimated time is as interesting as one that takes ten times longer; both mean you misunderstood something, and the misunderstanding is usually the more valuable lesson."}]]},{"t":"h2","id":"where-it-fails","runs":[{"text":"Where it fails"}]},{"t":"p","runs":[{"text":"Fermi estimation multiplies independent factors. It cannot see a factor you forgot entirely, and in this field the forgotten factor is usually a limit rather than a rate: the memory that does not fit, the rate limit on an API, the bandwidth ceiling from three lessons ago, the disagreement between two labellers. The estimate tells you the size of the job if nothing is in the way. Then look for what is in the way."}]}],"check":{"question":[{"text":"An estimate is built from six factors, each of which you believe is right to within a factor of three either way. Roughly how uncertain is the product, and why?"}],"options":[{"text":[{"text":"About a factor of 3⁶, around 700, since each factor’s error multiplies in."}],"correct":false,"tempting":[{"text":"Assumes every error points the same way; in reality they partly cancel, and the total grows with the square root of the count."}]},{"text":[{"text":"About a factor of 3, since the errors average out across six guesses."}],"correct":false,"tempting":[{"text":"Overstates the cancellation; errors do not vanish, they add in log space like a random walk, giving √6 steps rather than zero."}]},{"text":[{"text":"About a factor of 18, since six factors each contribute three."}],"correct":false,"tempting":[{"text":"Adds the factors instead of compounding them; uncertainty multiplies, and the correct compounding uses √6 × ln 3 in the exponent."}]},{"text":[{"text":"About a factor of 15: a √6-step random walk in log space."}],"correct":true,"tempting":null}],"order":[2,0,3,1],"why":null},"prev":{"slug":"nearest-neighbour-search-arithmetic","title":"Finding the closest vector among ten million: the arithmetic of approximate search","minutes":10},"next":{"slug":"floating-point-anatomy","title":"What a float32 actually stores, and where its seven digits run out","minutes":10}}}