关于「素数模与权重:ISBN-10 的 X 与 EAN-13 的盲点」,《校验码代数与韦尔霍夫算法》给出的定量结论是什么?
结论:第三章说明模 11 的威力与 X 的代价(0.0909 的号码需要 X),以及 13 位书号漏掉相差 5 的 0.1111 换位。
数据口径:书中录入量、出错率与成本均为示意参数;全部计算由书中程序生成;本书是非个人化经营建议。 书中以标注框区分已发表的证据、可运行的 Python 计算(19 段程序)、原典与作者的假说。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.0909, 11
| transpositions at any distance checked | 4050, unseen: 0 |
| single errors unseen | 0 |
| twin errors unseen only at weight pair(s): [(6, 5)] | |
| payloads 000000000-000009999 needing X | 909 of 10000 = 0.0909 |
| exact share of check value 10 | 1/11 = 0.0909 |
| refusing X keeps 0.9091 of the numbering space | |
| test payload 123456789 | 123456789X |
| test payload 000000027 | 0000000272 |
查看完整验算程序
# Chapter 3. p31: ISBN-10 modulo 11, what the prime buys and what X costs.
# Weights 10 down to 1 from the left; the weighted sum must be 0 mod 11;
# a check value of 10 is written X. Because 11 is prime and the weights
# are distinct and nonzero, every single error and every transposition
# of two digits at any distance changes the sum. Twins aa > bb go unseen
# only where two neighbouring weights add to 11. The second half counts
# how much of the payload space needs X, and what refusing X costs.
from fractions import Fraction
W = list(range(10, 0, -1))
R = range(10)
def isbn10_check(payload9):
s = 0
for w, ch in zip(W, payload9):
s += w * int(ch) # step
c = (11 - s % 11) % 11
return "X" if c == 10 else str(c)
bad_swap = 0
pairs = 0
for i in range(10):
for j in range(i + 1, 10):
for a in R:
for b in R:
if a != b:
pairs += 1
if (W[i] - W[j]) * (a - b) % 11 == 0:
bad_swap += 1
print("transpositions at any distance checked: %d, unseen: %d"
% (pairs, bad_swap))
bad_single = [(i, a, b) for i in range(10) for a in R for b in R
if a != b and W[i] * (a - b) % 11 == 0]
print("single errors unseen: %d" % len(bad_single))
twin_pos = [(W[i], W[i + 1]) for i in range(9) if W[i] + W[i + 1] == 11]
print("twin errors unseen only at weight pair(s): %s" % twin_pos)
# 需要 X 的载荷占比:校验值 0-10 均匀
need_x = 0
for n in range(10 ** 4):
if isbn10_check("%09d" % n) == "X":
need_x += 1
print("payloads 000000000-000009999 needing X: %d of 10000 = %.4f"
% (need_x, need_x / 10000))
print("exact share of check value 10: %s = %.4f"
% (Fraction(1, 11), 1 / 11))
print("refusing X keeps %.4f of the numbering space"
% (1 - 1 / 11))
print("test payload 123456789 -> 123456789%s" % isbn10_check("123456789"))
print("test payload 000000027 -> 000000027%s" % isbn10_check("000000027"))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《校验码代数与二面体群韦尔霍夫算法、订单号汇款码书号单字误抄与相邻换位检出率母典》第 3 章「素数模与权重:ISBN-10 的 X 与 EAN-13 的盲点」(版本 1.0.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-297 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026297,
author = {Fan, Yafu},
title = {The Algebra of Check Digits and Verhoeff's Dihedral-Group Code: Detection Rates for Single-Digit Slips and Adjacent Transpositions in Order, Remittance and Book Numbers},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}