关于「双次抽样与平均样本量:先看少数,必要时再多看」,《验收抽样与到货验货》给出的定量结论是什么?
结论:第五章说明双次抽样在同样保护下平均只需检验 103.2 件,比单次方案少 28.8 件。
数据口径:书中批量、不良率与成本均为示意参数;全部计算由书中程序生成;本书属于非个人化经营建议。 书中以标注框区分已发表的证据、可运行的 Python 计算(22 段程序)、原典与作者的假说。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 103.2, 28.8
| n1 | c1 | n2 | c2 | ASN(0.01) | ASN(0.05) | Pa(0.01) | Pa(0.05) |
| 69 | 0 | 69 | 3 | 103.2 | 104.6 | 0.9520 | 0.0949 |
| 88 | 1 | 88 | 4 | 107.2 | 130.9 | 0.9724 | 0.0953 |
| 79 | 1 | 158 | 5 | 108.6 | 190.8 | 0.9772 | 0.0991 |
| 58 | 0 | 116 | 4 | 109.2 | 149.1 | 0.9721 | 0.0967 |
| 82 | 1 | 164 | 6 | 114.5 | 214.0 | 0.9903 | 0.0996 |
| single plan n = 132, c = 3; double saves 28.8 items at p = 0.01 |
查看完整验算程序
# Chapter 5. p51: a double plan with the same two risks, fewer items.
# Model: binomial. Draw n1; accept if d1 <= c1, reject if d1 > c2;
# otherwise draw n2 more and accept if d1 + d2 <= c2. Then
# Pa = P(d1 <= c1) + sum over c1 < k <= c2 of P(d1 = k) P(d2 <= c2-k)
# and ASN = n1 + n2 P(c1 < d1 <= c2). Search n2 = n1 or 2 n1 for the
# plan meeting Pa(0.01) >= 0.95 and Pa(0.05) <= 0.10 with the least
# ASN at p = 0.01 (best n1 kept for each c1, c2, n2 / n1).
# The single plan n = 132, c = 3 comes from p31.
import math
def pmf(n, k, p):
return math.comb(n, k) * p ** k * (1 - p) ** (n - k)
def cdf(n, k, p):
if k < 0:
return 0.0
return math.fsum(pmf(n, j, p) for j in range(min(k, n) + 1))
def double(p, n1, c1, n2, c2):
first = cdf(n1, c1, p)
mid = [pmf(n1, k, p) * cdf(n2, c2 - k, p)
for k in range(c1 + 1, c2 + 1)]
go = math.fsum(pmf(n1, k, p) for k in range(c1 + 1, c2 + 1))
return first + math.fsum(mid), n1 + n2 * go
if __name__ == "__main__":
best = {}
for c1 in range(0, 4):
for c2 in range(c1 + 1, 9):
for k in (1, 2):
for n1 in range(c2 + 1, 140):
a, asn = double(0.01, n1, c1, k * n1, c2)
b, _ = double(0.05, n1, c1, k * n1, c2)
row = (round(asn, 6), n1, c1, k * n1, c2)
key = (c1, c2, k)
if a >= 0.95 and b <= 0.10:
if key not in best or row < best[key]:
best[key] = row
best = sorted(best.values())
print(" n1 c1 n2 c2 ASN(0.01) ASN(0.05) Pa(0.01) Pa(0.05)")
for asn, n1, c1, n2, c2 in best[:5]:
a, _ = double(0.01, n1, c1, n2, c2)
b, asn5 = double(0.05, n1, c1, n2, c2)
print(" {:3d} {} {:3d} {} {:6.1f} {:6.1f} {:.4f}"
" {:.4f}".format(n1, c1, n2, c2, asn, asn5, a, b))
asn, n1, c1, n2, c2 = best[0]
print("single plan n = 132, c = 3; double saves {:.1f} items at "
"p = 0.01".format(132 - asn))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《验收抽样方案与操作特性曲线、买手到货验货抽检件数母典》第 5 章「双次抽样与平均样本量:先看少数,必要时再多看」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-329 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026329,
author = {Fan, Yafu},
title = {Acceptance Sampling Plans and Operating-Characteristic Curves: How Many Items a Buyer Must Inspect on Arrival},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}