关于「回归审计的抽样理论:零失败时的三法则与有限总体修正」,《书库冲突检测、可复现与纠删码》给出的定量结论是什么?
结论:第三章给出零失败审计的三法则,要以 95 % 的置信度证明冲突率低于 0.01,需要 299 条全部合格的抽查,且几乎与书库大小无关。
数据口径:书中的书库规模、错误率、风险率与故障率均为示意参数;全部计算由书中程序生成;本书不是法律、财务、采购或存储服务建议。 第一章把书库画成知识图谱,说明卷数越多错误越难藏身:示意书库到 200 卷时,0.9821 的偏差定义处在可以被另一卷反驳的位置。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 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 |
查看完整验算程序
# 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))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《超大规模双语专著库跨卷定理冲突检测、代码可复现性衰减防腐与冷存储纠删码》第 3 章「回归审计的抽样理论:零失败时的三法则与有限总体修正」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 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}
}