{"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":"law-of-large-numbers-and-its-speed","title":"The law of large numbers, and how fast it works","url":"https://addaly.com/learn/maths-you-need/law-of-large-numbers-and-its-speed","position":50,"of":76,"minutes":9,"answer":"Because variances of independent draws add, the spread of an average falls as σ/√n, which is slow, and the law stops applying when the variance is infinite or when correlated rows are counted as independent.","keyIdea":"Because variances of independent draws add, the spread of an average falls as σ/√n, which is slow, and the law stops applying when the variance is infinite or when correlated rows are counted as independent, in which case the effective n is the row count divided by 1 + (m − 1)ρ."},"body":{"format":"markdown","text":"## The law, and the mechanism behind it\n\nThe average of many independent draws settles toward the expected value. Everyone knows this; fewer people know how fast, and fewer still know when it stops being true. Both come from three lines of algebra.\n\nEach draw has some variance `σ²`. For independent draws, variances add, so the sum of `n` of them has variance `n σ²`. The average is the sum divided by `n`, and dividing a quantity by `n` divides its variance by `n²`. So\n\n```\nVar(average) = n σ² / n² = σ² / n\nSD(average)  = σ / √n\n```\n\nThe spread of the average shrinks with the square root of the sample size, and the word doing the work is *independent*. If the draws were correlated, the covariances would add too, and the `n` in the denominator would be smaller than it looks.\n\n## How slow the square root is\n\nA coin flip has `σ = 0.5`. The average of 100 flips has spread 0.05; of 10,000 flips, 0.005. Ten times the precision costs a hundred times the samples. Module 4 stated this; here it is derived, and it is worth feeling the weight of it. An accuracy estimate you want to sharpen from ±3 points to ±1 point needs nine times the test items. There is no cleverness that changes the exponent for a plain average.\n\nA quick sizing rule follows. For a proportion, `σ` is at most 0.5, so to get within `ε` with about 95 per cent confidence you need roughly `n = (2 × 0.5 / ε)² = 1 / ε²`. Within one point, `ε = 0.01`, gives `n = 10,000`. Within five points, 400. The course `evaluating-ai` turns this into a procedure; the arithmetic is only this.\n\n## A guarantee with no assumptions\n\nThe square-root law says how the spread shrinks. Chebyshev's inequality turns it into a promise that needs no assumption about the shape of the distribution at all:\n\n```\nP(|average − μ| ≥ k × σ/√n) ≤ 1 / k²\n```\n\nFor 400 coin flips, `σ/√n = 0.025`. The chance the average is off by 0.125 or more, five spreads, is at most `1/25 = 4` per cent. The true chance is far smaller, under one in a million, because the bell curve of the next lesson has much thinner tails than Chebyshev allows for. But Chebyshev holds for *any* distribution with finite variance, and \"at most four per cent, whatever the shape\" is sometimes the sentence you need.\n\n## When the law fails: infinite variance\n\nThe derivation assumed `σ²` exists. Some distributions have none. The Cauchy distribution, which is what you get from the ratio of two normal variables, has a bell-shaped middle and tails so heavy that its variance, and even its mean, are undefined.\n\n```python\nimport numpy as np\nrng = np.random.default_rng(0)\nfor _ in range(4):\n    print(rng.standard_cauchy(200_000).mean())\n# 2.67   0.24   -0.01   -1.66\n```\n\nFour averages of two hundred thousand draws each, and they disagree by more than four units. The average of a million Cauchy draws is exactly as spread out as a single draw. Every so often a single value of a hundred thousand arrives and drags the whole average with it. The law of large numbers does not fail slowly here; it does not apply.\n\nReal quantities are never exactly Cauchy, but the heavy-tailed ones from module 4, response times, incomes, file sizes, the length of the longest document, live near that edge. Their averages converge, if at all, far more slowly than `1/√n` promises, and the estimate keeps jumping as rarer extremes turn up. That is the mechanism behind the advice to report percentiles: a percentile has a finite variance even when the data do not.\n\n## When the law fails: correlated draws\n\nThe second assumption was independence. Suppose an evaluation set has 2,000 answers, but they come from 80 users with 25 answers each, and answers from the same user tend to agree: a correlation of `ρ = 0.5` within a user. The variance of the average is inflated by the **design effect**:\n\n```\ndesign effect = 1 + (m − 1) ρ = 1 + 24 × 0.5 = 13\neffective n   = 2,000 / 13 ≈ 154\n```\n\nTwo thousand rows carry the information of 154 independent ones. An interval computed as if `n = 2000` is 3.6 times too narrow. This is the most common way a confident number turns out to be wrong: not a bad formula, but a sample that was less independent than it was counted as. Sessions, documents, days, batches, and anything generated by the same prompt are the usual culprits.\n\n## The third failure: the thing moved\n\nAveraging assumes there is one fixed quantity to converge to. An average of a model's accuracy across six months of traffic converges to the average of a changing thing, which describes no month in particular. The law of large numbers is exact about a stationary world and silent about any other.\n\n## The rule to keep\n\nSpread falls as `σ/√n`, provided the variance is finite and the draws are independent. Check both before trusting the `n`. When the variance is not finite, average something else. When the draws are clustered, count the clusters."},"check":{"question":"An evaluation set has 2,000 answers from 80 users, 25 each, and answers from the same user correlate at 0.5 on the metric. Roughly how many independent answers is that worth?","options":[{"text":"2,000: each answer is a separate row, and the formula uses the row count.","correct":false,"tempting":"Ignores the correlation entirely; variances of correlated draws do not simply add, and the σ/√n formula assumes they do."},{"text":"80, since only one answer per user can be trusted as independent.","correct":false,"tempting":"Too pessimistic: a correlation of 0.5 leaves half of each extra answer's information intact, so the effective n sits well above the user count."},{"text":"About 150.","correct":true},{"text":"1,000, because a correlation of 0.5 halves the information in the set.","correct":false,"tempting":"Applies the correlation as a simple discount; the inflation grows with cluster size, 1 + (m − 1)ρ, and with 25 per cluster it is 13, not 2."}]},"prev":{"slug":"estimators-and-why-n-minus-one","title":"An estimator is a recipe, and why the variance divides by n − 1","url":"https://addaly.com/learn/maths-you-need/estimators-and-why-n-minus-one"},"next":{"slug":"central-limit-theorem-by-simulation","title":"Why averages look normal, and when they refuse to","url":"https://addaly.com/learn/maths-you-need/central-limit-theorem-by-simulation"},"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) 'The law of large numbers, and how fast it works', in The Maths You Actually Need. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/maths-you-need/law-of-large-numbers-and-its-speed (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":"The law of large numbers, and how fast it works","courseTitle":"The Maths You Actually Need","module":{"index":6,"slug":"estimation-from-samples","title":"Estimation: from a sample to a number you can trust"},"answer":null,"keyIdea":"Because variances of independent draws add, the spread of an average falls as σ/√n, which is slow, and the law stops applying when the variance is infinite or when correlated rows are counted as independent, in which case the effective n is the row count divided by 1 + (m − 1)ρ.","hero":{"kind":"plate","image":null,"alt":null,"caption":null},"blocks":[{"t":"h2","id":"the-law-and-the-mechanism-behind-it","runs":[{"text":"The law, and the mechanism behind it"}]},{"t":"p","runs":[{"text":"The average of many independent draws settles toward the expected value. Everyone knows this; fewer people know how fast, and fewer still know when it stops being true. Both come from three lines of algebra."}]},{"t":"p","runs":[{"text":"Each draw has some variance "},{"text":"σ²","code":true},{"text":". For independent draws, variances add, so the sum of "},{"text":"n","code":true},{"text":" of them has variance "},{"text":"n σ²","code":true},{"text":". The average is the sum divided by "},{"text":"n","code":true},{"text":", and dividing a quantity by "},{"text":"n","code":true},{"text":" divides its variance by "},{"text":"n²","code":true},{"text":". So"}]},{"t":"code","lang":"","label":"Text","text":"Var(average) = n σ² / n² = σ² / n\nSD(average)  = σ / √n"},{"t":"p","runs":[{"text":"The spread of the average shrinks with the square root of the sample size, and the word doing the work is "},{"text":"independent","i":true},{"text":". If the draws were correlated, the covariances would add too, and the "},{"text":"n","code":true},{"text":" in the denominator would be smaller than it looks."}]},{"t":"h2","id":"how-slow-the-square-root-is","runs":[{"text":"How slow the square root is"}]},{"t":"p","runs":[{"text":"A coin flip has "},{"text":"σ = 0.5","code":true},{"text":". The average of 100 flips has spread 0.05; of 10,000 flips, 0.005. Ten times the precision costs a hundred times the samples. Module 4 stated this; here it is derived, and it is worth feeling the weight of it. An accuracy estimate you want to sharpen from ±3 points to ±1 point needs nine times the test items. There is no cleverness that changes the exponent for a plain average."}]},{"t":"p","runs":[{"text":"A quick sizing rule follows. For a proportion, "},{"text":"σ","code":true},{"text":" is at most 0.5, so to get within "},{"text":"ε","code":true},{"text":" with about 95 per cent confidence you need roughly "},{"text":"n = (2 × 0.5 / ε)² = 1 / ε²","code":true},{"text":". Within one point, "},{"text":"ε = 0.01","code":true},{"text":", gives "},{"text":"n = 10,000","code":true},{"text":". Within five points, 400. The course "},{"text":"evaluating-ai","code":true},{"text":" turns this into a procedure; the arithmetic is only this."}]},{"t":"h2","id":"a-guarantee-with-no-assumptions","runs":[{"text":"A guarantee with no assumptions"}]},{"t":"p","runs":[{"text":"The square-root law says how the spread shrinks. Chebyshev’s inequality turns it into a promise that needs no assumption about the shape of the distribution at all:"}]},{"t":"code","lang":"","label":"Text","text":"P(|average − μ| ≥ k × σ/√n) ≤ 1 / k²"},{"t":"p","runs":[{"text":"For 400 coin flips, "},{"text":"σ/√n = 0.025","code":true},{"text":". The chance the average is off by 0.125 or more, five spreads, is at most "},{"text":"1/25 = 4","code":true},{"text":" per cent. The true chance is far smaller, under one in a million, because the bell curve of the next lesson has much thinner tails than Chebyshev allows for. But Chebyshev holds for "},{"text":"any","i":true},{"text":" distribution with finite variance, and “at most four per cent, whatever the shape” is sometimes the sentence you need."}]},{"t":"h2","id":"when-the-law-fails-infinite-variance","runs":[{"text":"When the law fails: infinite variance"}]},{"t":"p","runs":[{"text":"The derivation assumed "},{"text":"σ²","code":true},{"text":" exists. Some distributions have none. The Cauchy distribution, which is what you get from the ratio of two normal variables, has a bell-shaped middle and tails so heavy that its variance, and even its mean, are undefined."}]},{"t":"code","lang":"python","label":"Python","text":"import numpy as np\nrng = np.random.default_rng(0)\nfor _ in range(4):\n    print(rng.standard_cauchy(200_000).mean())\n# 2.67   0.24   -0.01   -1.66"},{"t":"p","runs":[{"text":"Four averages of two hundred thousand draws each, and they disagree by more than four units. The average of a million Cauchy draws is exactly as spread out as a single draw. Every so often a single value of a hundred thousand arrives and drags the whole average with it. The law of large numbers does not fail slowly here; it does not apply."}]},{"t":"p","runs":[{"text":"Real quantities are never exactly Cauchy, but the heavy-tailed ones from module 4, response times, incomes, file sizes, the length of the longest document, live near that edge. Their averages converge, if at all, far more slowly than "},{"text":"1/√n","code":true},{"text":" promises, and the estimate keeps jumping as rarer extremes turn up. That is the mechanism behind the advice to report percentiles: a percentile has a finite variance even when the data do not."}]},{"t":"h2","id":"when-the-law-fails-correlated-draws","runs":[{"text":"When the law fails: correlated draws"}]},{"t":"p","runs":[{"text":"The second assumption was independence. Suppose an evaluation set has 2,000 answers, but they come from 80 users with 25 answers each, and answers from the same user tend to agree: a correlation of "},{"text":"ρ = 0.5","code":true},{"text":" within a user. The variance of the average is inflated by the "},{"text":"design effect","b":true},{"text":":"}]},{"t":"code","lang":"","label":"Text","text":"design effect = 1 + (m − 1) ρ = 1 + 24 × 0.5 = 13\neffective n   = 2,000 / 13 ≈ 154"},{"t":"p","runs":[{"text":"Two thousand rows carry the information of 154 independent ones. An interval computed as if "},{"text":"n = 2000","code":true},{"text":" is 3.6 times too narrow. This is the most common way a confident number turns out to be wrong: not a bad formula, but a sample that was less independent than it was counted as. Sessions, documents, days, batches, and anything generated by the same prompt are the usual culprits."}]},{"t":"h2","id":"the-third-failure-the-thing-moved","runs":[{"text":"The third failure: the thing moved"}]},{"t":"p","runs":[{"text":"Averaging assumes there is one fixed quantity to converge to. An average of a model’s accuracy across six months of traffic converges to the average of a changing thing, which describes no month in particular. The law of large numbers is exact about a stationary world and silent about any other."}]},{"t":"h2","id":"the-rule-to-keep","runs":[{"text":"The rule to keep"}]},{"t":"p","runs":[{"text":"Spread falls as "},{"text":"σ/√n","code":true},{"text":", provided the variance is finite and the draws are independent. Check both before trusting the "},{"text":"n","code":true},{"text":". When the variance is not finite, average something else. When the draws are clustered, count the clusters."}]}],"check":{"question":[{"text":"An evaluation set has 2,000 answers from 80 users, 25 each, and answers from the same user correlate at 0.5 on the metric. Roughly how many independent answers is that worth?"}],"options":[{"text":[{"text":"2,000: each answer is a separate row, and the formula uses the row count."}],"correct":false,"tempting":[{"text":"Ignores the correlation entirely; variances of correlated draws do not simply add, and the σ/√n formula assumes they do."}]},{"text":[{"text":"80, since only one answer per user can be trusted as independent."}],"correct":false,"tempting":[{"text":"Too pessimistic: a correlation of 0.5 leaves half of each extra answer’s information intact, so the effective n sits well above the user count."}]},{"text":[{"text":"About 150."}],"correct":true,"tempting":null},{"text":[{"text":"1,000, because a correlation of 0.5 halves the information in the set."}],"correct":false,"tempting":[{"text":"Applies the correlation as a simple discount; the inflation grows with cluster size, 1 + (m − 1)ρ, and with 25 per cluster it is 13, not 2."}]}],"order":[3,2,0,1],"why":null},"prev":{"slug":"estimators-and-why-n-minus-one","title":"An estimator is a recipe, and why the variance divides by n − 1","minutes":9},"next":{"slug":"central-limit-theorem-by-simulation","title":"Why averages look normal, and when they refuse to","minutes":9}}}