关于「到货验货的期望成本:验多少件才划算」,《验收抽样与到货验货》给出的定量结论是什么?

结论:第六章把验货写成期望成本,最优方案每批 327.82,比抽一成省 71.32,并说明批量通过成本而非比例进入方案。

数据口径:书中批量、不良率与成本均为示意参数;全部计算由书中程序生成;本书属于非个人化经营建议。 书中以标注框区分已发表的证据、可运行的 Python 计算(22 段程序)、原典与作者的假说。

English version

对照数据表

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

rank n c cost/lot
124 1 327.82
225 1 327.89
323 1 327.89
426 1 328.09
522 1 328.12
optimum saves 32.18 per lot on no inspection
optimum saves 71.32 per lot on the tenth rule
supplier state p0.01: P(accept) = 0.9824
supplier state p0.04: P(accept) = 0.7523
supplier state p0.12: P(accept) = 0.1867
查看完整验算程序
# Chapter 6. p62: the plan that minimises expected cost per lot.
# Model: the cost model and supplier mix of p61 (N = 300, K1 = 2,
# K2 = 60; 0.80 at 0.01, 0.15 at 0.04, 0.05 at 0.12). Exhaustive
# search over n = 0 to 150 and c = 0 to 5, exact hypergeometric
# with Fraction arithmetic. Parameters are illustrative.
import math
from fractions import Fraction

MIX = ((Fraction(80, 100), "0.01"), (Fraction(15, 100), "0.04"),
       (Fraction(5, 100), "0.12"))


def defects(N, p):
    return int(Fraction(p) * N + Fraction(1, 2))


def lot_cost(N, D, n, c, k1, k2):
    if n == 0:
        return Fraction(k2 * D)
    tot = math.comb(N, n)
    esc = 0
    pa = 0
    for d in range(0, min(c, D, n) + 1):
        w = math.comb(D, d) * math.comb(N - D, n - d)
        esc += w * (D - d)
        pa += w
    pa = Fraction(pa, tot)
    return k1 * n + (1 - pa) * k1 * (N - n) + k2 * Fraction(esc, tot)


def mix_cost(N, n, c, k1, k2, mix=MIX):
    acc = Fraction(0)
    for w, p in mix:
        acc += w * lot_cost(N, defects(N, p), n, c, k1, k2)
    return acc


if __name__ == "__main__":
    N, k1, k2 = 300, 2, 60
    rows = []
    for c in range(0, 6):
        for n in range(c + 1, 151):
            rows.append((mix_cost(N, n, c, k1, k2), n, c))
    rows.sort()
    print("  rank    n   c   cost/lot")
    for i, (cost, n, c) in enumerate(rows[:5], 1):
        print("  {:4d}  {:3d}  {:2d}   {:7.2f}".format(i, n, c, float(cost)))
    best, n, c = rows[0]
    none = mix_cost(N, 0, 0, k1, k2)
    tenth = mix_cost(N, 30, 0, k1, k2)
    print("optimum saves {:.2f} per lot on no inspection".format(
        float(none - best)))
    print("optimum saves {:.2f} per lot on the tenth rule".format(
        float(tenth - best)))
    for w, p in MIX:
        D = defects(N, p)
        tot = math.comb(N, n)
        pa = Fraction(0)
        for d in range(0, min(c, D) + 1):
            pa += Fraction(math.comb(D, d) * math.comb(N - D, n - d), tot)
        print("  supplier state p = {}: P(accept) = {:.4f}".format(
            p, float(pa)))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《验收抽样方案与操作特性曲线、买手到货验货抽检件数母典》第 6 章「到货验货的期望成本:验多少件才划算」(版本 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}
}

本书其他章节结论