What does Library Conflicts, Reproducibility and Erasure Codes conclude, in numbers, about “The Sampling Theory of Regression Audits: the Rule of Three and the Finite-Population Correction”?
Answer: Chapter 3 gives the rule of three for clean audits: showing a conflict rate below 0.01 with 95 % confidence takes 299 clean checks, almost regardless of library size.
Scope of the numbers: Library sizes, error rates, hazards and failure rates are illustrative; all calculations are generated by the programs in the book; the book is not legal, financial, procurement or storage-service advice. Chapter 1 draws the library as a knowledge graph and shows that the more volumes there are, the fewer places an error can hide: at 200 volumes, 0.9821 of deviant definitions in the illustrative library sit where another volume can contradict them.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.01, 299, 95
| (a) upper 95 % bound on the conflict rate | |
| n x | 0 x = 1 x = 2 x = 5 |
| 100 | 0.02951 0.04656 0.06162 0.10225 |
| 300 | 0.00994 0.01571 0.02084 0.03472 |
| 1,000 | 0.00299 0.00473 0.00628 0.01048 |
| (b) n needed to certify a rate below 0.01 | |
| x < | 0: n = 299; x <= 1: n = 473; x <= 2: n = 628; x <= 3: n = 773 |
| (c) N | 19,200 claims, D = 192 bad (rate 0.01) |
| n | 100: P(no bad in sample) hypergeometric 0.36508, binomial 0.36603 |
| n | 299: P(no bad in sample) hypergeometric 0.04838, binomial 0.04954 |
| n | 500: P(no bad in sample) hypergeometric 0.00615, binomial 0.00657 |
Show the full program
# Chapter 3. p32: audits that find some conflicts, and finite libraries.
# (a) Exact (Clopper-Pearson) one-sided 95 % upper bound when x of n
# audited claims conflict, found by bisection on the binomial tail.
# (b) Smallest n that certifies a rate below 0.01 if at most x conflicts
# are allowed in the sample (an acceptance-sampling plan).
# (c) Finite population: a library of 19,200 claims (the illustrative
# size of p11) with 192 bad ones; the hypergeometric chance that a
# sample of n contains none, against the binomial approximation.
import math
ALPHA = 0.05
def tail_le(x, n, p):
terms = [math.comb(n, k) * p ** k * (1 - p) ** (n - k)
for k in range(x + 1)]
return math.fsum(terms)
def upper(x, n):
lo, hi = x / n, 1.0
for _ in range(80):
mid = (lo + hi) / 2
if tail_le(x, n, mid) > ALPHA:
lo = mid
else:
hi = mid
return hi
print("(a) upper 95 % bound on the conflict rate")
print("{:>6} {:>10} {:>10} {:>10} {:>10}".format(
"n", "x = 0", "x = 1", "x = 2", "x = 5"))
for n in (100, 300, 1000):
print("{:>6,} {:>10.5f} {:>10.5f} {:>10.5f} {:>10.5f}".format(
n, upper(0, n), upper(1, n), upper(2, n), upper(5, n)))
print("(b) n needed to certify a rate below 0.01")
plan = []
for x in (0, 1, 2, 3):
n = x + 1
while upper(x, n) > 0.01:
n += 1
plan.append("x <= {}: n = {}".format(x, n))
print(" " + "; ".join(plan))
N, D = 19200, 192
print("(c) N = {:,} claims, D = {} bad (rate 0.01)".format(N, D))
for n in (100, 299, 500):
hyper = math.comb(N - D, n) / math.comb(N, n)
print(" n = {:>3}: P(no bad in sample) hypergeometric {:.5f},"
" binomial {:.5f}".format(n, hyper, (1 - D / N) ** n))Single source and citation
Fan, Y. (2026). Cross-Volume Theorem-Conflict Detection in Large Bilingual Monograph Libraries, Anti-Decay of Code Reproducibility and Erasure-Coded Cold Storage (Version 1.0.0), Chapter 3: The Sampling Theory of Regression Audits: the Rule of Three and the Finite-Population Correction. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-182 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026182,
author = {Fan, Yafu},
title = {Cross-Volume Theorem-Conflict Detection in Large Bilingual Monograph Libraries, Anti-Decay of Code Reproducibility and Erasure-Coded Cold Storage},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · The Library as a Graph: Volumes, Chapters, Terms and Numeric Claims as Nodes
- Chapter 2 · Normalization and Hash Indexing: False Alarms and Misses in Cross-Volume Conflict Detection
- Chapter 4 · The Decay of Code Reproducibility: Hazard Rates of Dependency Drift and Byte-Exact Output Regression
- Chapter 5 · Reed-Solomon over GF(2^8): Erasure Coding and Recovery in the Standard Library
- Chapter 6 · The Reliability of Replicas and Erasure Codes: Binomial Windows, Markov Chains and Scrubbing for Bit Rot
- Chapter 7 · Classical Sources: Siku Collation, the Fate of the Seven Pavilions and Lachmann's Stemmatics
- Chapter 8 · Practice and Falsification: a Publisher's Checklists for Consistency, Reproducibility and Cold Storage