{"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":"the-rule-of-three","title":"Zero failures in 300 tries, and what that does not prove","url":"https://addaly.com/learn/maths-you-need/the-rule-of-three","position":54,"of":76,"minutes":8,"answer":"Zero failures in n independent trials bounds the failure rate at roughly 3/n with 95 per cent confidence, so 300 clean runs are consistent with a one-per-cent failure rate.","keyIdea":"Zero failures in n independent trials bounds the failure rate at roughly 3/n with 95 per cent confidence, so 300 clean runs are consistent with a one-per-cent failure rate, and observing a failure of rate p reliably needs about 3/p trials."},"body":{"format":"markdown","text":"## The most common wrong sentence in a release note\n\n\"We ran it 300 times and it never failed.\" The sentence is true, and the conclusion people draw from it, that the failure rate is zero or near enough, is not. Zero observed failures is evidence, and the question is how much. The answer fits on one line.\n\n## Deriving the rule\n\nSuppose the true failure rate is `p` and the trials are independent. The chance of seeing no failures in `n` trials is `(1 − p)^n`. Ask: what is the largest `p` for which zero failures would still be unsurprising, say at least 5 per cent likely?\n\n```\n(1 − p)^n = 0.05\nn × ln(1 − p) = ln 0.05 = −3.0\nn × (−p) ≈ −3.0          (since ln(1 − p) ≈ −p for small p)\np ≈ 3 / n\n```\n\nThat is the **rule of three**: after `n` trials with no failures, the 95 per cent upper bound on the failure rate is about `3/n`.\n\n```\n0 failures in     30  →  rate could be up to 10%\n0 failures in    300  →  up to 1%\n0 failures in  3,000  →  up to 0.1%\n0 failures in 30,000  →  up to 0.01%\n```\n\nThree hundred clean runs are consistent with a one-in-a-hundred failure rate. If the system will handle a thousand requests a day, that is ten failures a day the test could not have seen. Fifty clean runs, which is what a demo usually amounts to, are consistent with six per cent.\n\n## The other direction: how many trials to see one\n\nThe same algebra answers the planning question. To have a 95 per cent chance of observing at least one failure of rate `p`, you need `n ≈ 3/p` trials. A failure that happens once in a thousand requests needs three thousand trials to show up reliably. One that happens once in a hundred thousand needs three hundred thousand. If your test budget is a thousand runs, you are blind to anything rarer than about one in three hundred, and you should say so rather than report a zero.\n\n## Seeing a few failures\n\nOnce failures do appear, the count over many trials is approximately Poisson, and the 95 per cent upper bounds on the expected count are:\n\n```\nobserved 0  →  at most 3.0\nobserved 1  →  at most 4.7\nobserved 2  →  at most 6.3\nobserved 3  →  at most 7.8\n```\n\nDivide by `n` for the rate. Two failures in 1,000 runs means the rate is 0.2 per cent as a point estimate but could be as high as 0.63 per cent. Note how slowly the bound tightens: the upper bound for three observed failures is not much more than double that for zero. A handful of failures is a handful of information.\n\n## Estimating a rare rate to a given precision\n\nSeeing a failure is one thing; measuring its rate is another. The standard error of a proportion, relative to the proportion itself, is about `1/√(np)` when `p` is small. To pin a rate to within ±50 per cent of itself, two standard errors, you need `1/√(np) = 0.25`, so `np = 16`: sixteen observed failures, whatever the rate. To within ±10 per cent you need `np = 400`, four hundred failures. A failure rate of 0.1 per cent therefore needs 16,000 trials to estimate coarsely and 400,000 to estimate well. This is why rare-event rates in published evaluations are so often quoted with one decimal place and no interval: the interval would swallow the number.\n\n## Where the rule is used, and misused\n\n- **Safety evaluations.** \"No jailbreak in 200 attempts\" bounds the success rate for *attacks of that kind* at about 1.5 per cent. It says nothing about attacks the red team did not think of, which is a different limitation, covered in `evaluating-ai`.\n- **Clinical trials.** A drug tested on 1,500 patients with no case of a side effect cannot rule out that it strikes one patient in 500. This is the standard textbook example, and it is why rare side effects are found after approval.\n- **Hardware and infrastructure.** A component with no failures across 10,000 hours of testing may fail once per 3,300 hours.\n\nThe misuse is always the same: treating the point estimate of zero as the answer, when the honest answer is a bound.\n\n## Two assumptions to check\n\nThe trials must be **independent**, and they must be **drawn from the deployment distribution**. Three hundred test prompts written by one engineer in one afternoon are neither: they share that engineer's blind spots, and they were not sampled from what users will send. The rule of three then bounds the failure rate on prompts like those, which is a smaller claim than it sounds. The arithmetic is exact; the sample is where the honesty goes.\n\n## The sentence to write instead\n\nNot \"it never failed\", but \"in 300 independent trials we saw no failures, which bounds the rate below about 1 per cent at 95 per cent confidence for inputs of this kind.\" Longer, and true."},"check":{"question":"A red team runs 200 attack prompts and none succeed. What can be concluded about the attack success rate?","options":[{"text":"It is zero, since no attack got through.","correct":false,"tempting":"Treats the point estimate as the truth; zero observed failures is consistent with any rate small enough that 200 trials would likely miss it."},{"text":"Probably under about 1.5 per cent, for attacks like these.","correct":true},{"text":"It is below 0.5 per cent, because one failure in 200 would be 0.5 per cent and none was seen.","correct":false,"tempting":"Uses 1/n as the bound; the 95 per cent bound is about 3/n, because rates up to that level still leave a reasonable chance of a clean run."},{"text":"Nothing at all can be concluded until at least one attack succeeds.","correct":false,"tempting":"Zero is informative: it rules out high rates, and the rule of three says exactly how high."}]},"prev":{"slug":"confidence-intervals-mechanics","title":"What a 95 per cent interval promises, and where the textbook one breaks","url":"https://addaly.com/learn/maths-you-need/confidence-intervals-mechanics"},"next":{"slug":"beta-distributions-and-updating-a-rate","title":"Updating a rate as evidence arrives: the Beta distribution","url":"https://addaly.com/learn/maths-you-need/beta-distributions-and-updating-a-rate"},"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) 'Zero failures in 300 tries, and what that does not prove', in The Maths You Actually Need. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/maths-you-need/the-rule-of-three (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":"Zero failures in 300 tries, and what that does not prove","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":"Zero failures in n independent trials bounds the failure rate at roughly 3/n with 95 per cent confidence, so 300 clean runs are consistent with a one-per-cent failure rate, and observing a failure of rate p reliably needs about 3/p trials.","hero":{"kind":"plate","image":null,"alt":null,"caption":null},"blocks":[{"t":"h2","id":"the-most-common-wrong-sentence-in-a-release-note","runs":[{"text":"The most common wrong sentence in a release note"}]},{"t":"p","runs":[{"text":"“We ran it 300 times and it never failed.” The sentence is true, and the conclusion people draw from it, that the failure rate is zero or near enough, is not. Zero observed failures is evidence, and the question is how much. The answer fits on one line."}]},{"t":"h2","id":"deriving-the-rule","runs":[{"text":"Deriving the rule"}]},{"t":"p","runs":[{"text":"Suppose the true failure rate is "},{"text":"p","code":true},{"text":" and the trials are independent. The chance of seeing no failures in "},{"text":"n","code":true},{"text":" trials is "},{"text":"(1 − p)^n","code":true},{"text":". Ask: what is the largest "},{"text":"p","code":true},{"text":" for which zero failures would still be unsurprising, say at least 5 per cent likely?"}]},{"t":"code","lang":"","label":"Text","text":"(1 − p)^n = 0.05\nn × ln(1 − p) = ln 0.05 = −3.0\nn × (−p) ≈ −3.0          (since ln(1 − p) ≈ −p for small p)\np ≈ 3 / n"},{"t":"p","runs":[{"text":"That is the "},{"text":"rule of three","b":true},{"text":": after "},{"text":"n","code":true},{"text":" trials with no failures, the 95 per cent upper bound on the failure rate is about "},{"text":"3/n","code":true},{"text":"."}]},{"t":"code","lang":"","label":"Text","text":"0 failures in     30  →  rate could be up to 10%\n0 failures in    300  →  up to 1%\n0 failures in  3,000  →  up to 0.1%\n0 failures in 30,000  →  up to 0.01%"},{"t":"p","runs":[{"text":"Three hundred clean runs are consistent with a one-in-a-hundred failure rate. If the system will handle a thousand requests a day, that is ten failures a day the test could not have seen. Fifty clean runs, which is what a demo usually amounts to, are consistent with six per cent."}]},{"t":"h2","id":"the-other-direction-how-many-trials-to-see-one","runs":[{"text":"The other direction: how many trials to see one"}]},{"t":"p","runs":[{"text":"The same algebra answers the planning question. To have a 95 per cent chance of observing at least one failure of rate "},{"text":"p","code":true},{"text":", you need "},{"text":"n ≈ 3/p","code":true},{"text":" trials. A failure that happens once in a thousand requests needs three thousand trials to show up reliably. One that happens once in a hundred thousand needs three hundred thousand. If your test budget is a thousand runs, you are blind to anything rarer than about one in three hundred, and you should say so rather than report a zero."}]},{"t":"h2","id":"seeing-a-few-failures","runs":[{"text":"Seeing a few failures"}]},{"t":"p","runs":[{"text":"Once failures do appear, the count over many trials is approximately Poisson, and the 95 per cent upper bounds on the expected count are:"}]},{"t":"code","lang":"","label":"Text","text":"observed 0  →  at most 3.0\nobserved 1  →  at most 4.7\nobserved 2  →  at most 6.3\nobserved 3  →  at most 7.8"},{"t":"p","runs":[{"text":"Divide by "},{"text":"n","code":true},{"text":" for the rate. Two failures in 1,000 runs means the rate is 0.2 per cent as a point estimate but could be as high as 0.63 per cent. Note how slowly the bound tightens: the upper bound for three observed failures is not much more than double that for zero. A handful of failures is a handful of information."}]},{"t":"h2","id":"estimating-a-rare-rate-to-a-given-precision","runs":[{"text":"Estimating a rare rate to a given precision"}]},{"t":"p","runs":[{"text":"Seeing a failure is one thing; measuring its rate is another. The standard error of a proportion, relative to the proportion itself, is about "},{"text":"1/√(np)","code":true},{"text":" when "},{"text":"p","code":true},{"text":" is small. To pin a rate to within ±50 per cent of itself, two standard errors, you need "},{"text":"1/√(np) = 0.25","code":true},{"text":", so "},{"text":"np = 16","code":true},{"text":": sixteen observed failures, whatever the rate. To within ±10 per cent you need "},{"text":"np = 400","code":true},{"text":", four hundred failures. A failure rate of 0.1 per cent therefore needs 16,000 trials to estimate coarsely and 400,000 to estimate well. This is why rare-event rates in published evaluations are so often quoted with one decimal place and no interval: the interval would swallow the number."}]},{"t":"h2","id":"where-the-rule-is-used-and-misused","runs":[{"text":"Where the rule is used, and misused"}]},{"t":"ul","items":[[{"text":"Safety evaluations.","b":true},{"text":" “No jailbreak in 200 attempts” bounds the success rate for "},{"text":"attacks of that kind","i":true},{"text":" at about 1.5 per cent. It says nothing about attacks the red team did not think of, which is a different limitation, covered in "},{"text":"evaluating-ai","code":true},{"text":"."}],[{"text":"Clinical trials.","b":true},{"text":" A drug tested on 1,500 patients with no case of a side effect cannot rule out that it strikes one patient in 500. This is the standard textbook example, and it is why rare side effects are found after approval."}],[{"text":"Hardware and infrastructure.","b":true},{"text":" A component with no failures across 10,000 hours of testing may fail once per 3,300 hours."}]]},{"t":"p","runs":[{"text":"The misuse is always the same: treating the point estimate of zero as the answer, when the honest answer is a bound."}]},{"t":"h2","id":"two-assumptions-to-check","runs":[{"text":"Two assumptions to check"}]},{"t":"p","runs":[{"text":"The trials must be "},{"text":"independent","b":true},{"text":", and they must be "},{"text":"drawn from the deployment distribution","b":true},{"text":". Three hundred test prompts written by one engineer in one afternoon are neither: they share that engineer’s blind spots, and they were not sampled from what users will send. The rule of three then bounds the failure rate on prompts like those, which is a smaller claim than it sounds. The arithmetic is exact; the sample is where the honesty goes."}]},{"t":"h2","id":"the-sentence-to-write-instead","runs":[{"text":"The sentence to write instead"}]},{"t":"p","runs":[{"text":"Not “it never failed”, but “in 300 independent trials we saw no failures, which bounds the rate below about 1 per cent at 95 per cent confidence for inputs of this kind.” Longer, and true."}]}],"check":{"question":[{"text":"A red team runs 200 attack prompts and none succeed. What can be concluded about the attack success rate?"}],"options":[{"text":[{"text":"It is zero, since no attack got through."}],"correct":false,"tempting":[{"text":"Treats the point estimate as the truth; zero observed failures is consistent with any rate small enough that 200 trials would likely miss it."}]},{"text":[{"text":"Probably under about 1.5 per cent, for attacks like these."}],"correct":true,"tempting":null},{"text":[{"text":"It is below 0.5 per cent, because one failure in 200 would be 0.5 per cent and none was seen."}],"correct":false,"tempting":[{"text":"Uses 1/n as the bound; the 95 per cent bound is about 3/n, because rates up to that level still leave a reasonable chance of a clean run."}]},{"text":[{"text":"Nothing at all can be concluded until at least one attack succeeds."}],"correct":false,"tempting":[{"text":"Zero is informative: it rules out high rates, and the rule of three says exactly how high."}]}],"order":[2,0,3,1],"why":null},"prev":{"slug":"confidence-intervals-mechanics","title":"What a 95 per cent interval promises, and where the textbook one breaks","minutes":10},"next":{"slug":"beta-distributions-and-updating-a-rate","title":"Updating a rate as evidence arrives: the Beta distribution","minutes":10}}}