关于「证伪门禁:序贯检验的边界、样本量与漏网率」,《人机互哺与证伪棘轮》给出的定量结论是什么?

结论:第四章写证伪门禁:序贯检验在同样错误率下平均只要 98 到 118 个案例,固定样本要 211 个,并按候选来源算出漏网率。

数据口径:书中参数为示意,全部计算由书中程序生成。 本书不是软件工程意见,也不是投资意见,不对任何具体商业模型的内部机制下断言。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 118, 211, 98

SPRT boundaries for alpha = 0.05, beta = 0.10:
ln A = 2.8904 (A = 18.0), ln B = -2.2513 (B = 0.1053)
p0p1alphabetaE0[N]E1[N]fixed nsaving
0.50.60.050.10981182110.441
0.50.60.010.051432073880.465
0.50.70.050.102329500.422
0.50.70.010.053351920.448
0.30.40.050.10921051910.449
0.30.40.010.051351853510.473
0.70.80.050.1071921610.426
0.70.80.010.051031622980.455
查看完整验算程序
# Chapter 4. p41: Wald's SPRT for a candidate rule, exact formulas.
# A rule claims that a check passes with rate p1 instead of the base
# rate p0. Each back-filled case is a Bernoulli trial. Wald (1945):
#   upper boundary ln A = ln((1 - beta) / alpha)  -> accept the rule
#   lower boundary ln B = ln(beta / (1 - alpha))  -> reject the rule
# Average sample numbers, ignoring overshoot:
#   E0[N] = ((1 - alpha) ln B + alpha ln A) / E0[z]
#   E1[N] = (beta ln B + (1 - beta) ln A) / E1[z]
# with z = x ln(p1/p0) + (1 - x) ln((1 - p1)/(1 - p0)). The fixed
# sample size with the same errors is
#   n = ((z_a sqrt(p0 q0) + z_b sqrt(p1 q1)) / (p1 - p0))^2.
import math
from statistics import NormalDist

Z = NormalDist()


def wald(p0, p1, a, b):
    la = math.log((1.0 - b) / a)
    lb = math.log(b / (1.0 - a))
    up = math.log(p1 / p0)
    dn = math.log((1.0 - p1) / (1.0 - p0))
    e0 = p0 * up + (1.0 - p0) * dn
    e1 = p1 * up + (1.0 - p1) * dn
    n0 = ((1.0 - a) * lb + a * la) / e0
    n1 = (b * lb + (1.0 - b) * la) / e1
    return la, lb, n0, n1


def fixed_n(p0, p1, a, b):
    za, zb = Z.inv_cdf(1.0 - a), Z.inv_cdf(1.0 - b)
    num = za * math.sqrt(p0 * (1 - p0)) + zb * math.sqrt(p1 * (1 - p1))
    return math.ceil((num / (p1 - p0)) ** 2)


if __name__ == "__main__":
    print("SPRT boundaries for alpha = 0.05, beta = 0.10:")
    la, lb, _, _ = wald(0.5, 0.6, 0.05, 0.10)
    print("  ln A = {:.4f} (A = {:.1f}), ln B = {:.4f} (B = {:.4f})".format(
        la, math.exp(la), lb, math.exp(lb)))
    print("   p0    p1   alpha  beta  E0[N]  E1[N]  fixed n  saving")
    for p0, p1 in ((0.5, 0.6), (0.5, 0.7), (0.3, 0.4), (0.7, 0.8)):
        for a, b in ((0.05, 0.10), (0.01, 0.05)):
            _, _, n0, n1 = wald(p0, p1, a, b)
            nf = fixed_n(p0, p1, a, b)
            sav = 1.0 - max(n0, n1) / nf
            print("  {:.1f}  {:.1f}  {:>5.2f}  {:>4.2f}  {:>5.0f}  {:>5.0f}"
                  "  {:>7}  {:>6.3f}".format(p0, p1, a, b, n0, n1, nf,
                                             sav))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《人机互哺双螺旋进化、实证门禁稳健棘轮与共生创作复利母典》第 4 章「证伪门禁:序贯检验的边界、样本量与漏网率」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-374 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026374,
  author    = {Fan, Yafu},
  title     = {Co-Evolutionary Human-AI Writing Spirals, Falsification-Gated Ratchets and Symbiotic Capability Compounding},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论