What does The Algebra of Check Digits conclude, in numbers, about “Prime Moduli and Weights: The X of ISBN-10 and the Blind Spot of EAN-13”?
Answer: Chapter 3 shows the power of modulus 11 and the cost of its X (0.0909 of numbers need one), and that 13-digit book numbers miss the 0.1111 of swaps differing by 5.
Scope of the numbers: Entry volumes, error rates and costs are illustrative; all calculations are generated by the book's programs; the book is not individual business advice. Marked boxes separate published evidence, runnable Python calculations (19 programs), classical sources and the author's hypotheses.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 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 |
Show the full program
# 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"))Single source and citation
Fan, Y. (2026). 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 (Version 1.0.0), Chapter 3: Prime Moduli and Weights: The X of ISBN-10 and the Blind Spot of EAN-13. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 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}
}Other chapter answers in this book
- Chapter 1 · The Spectrum of Slips: Two Classes in Twelve Thousand Errors
- Chapter 2 · Luhn's Doubling: Why Mod 10 Misses 09 and 90
- Chapter 4 · The Symmetries of a Pentagon: The Dihedral Group D5 and Anti-Symmetric Permutations
- Chapter 5 · Verhoeff's Algorithm Dissected: Positions, Twins, Jumps and the Errors with No Name
- Chapter 6 · Order Numbers, Remittance References and Internal Book Numbers: A Month's Accounts
- Chapter 7 · Classics East and West: Ritual Bronzes, Red Tablets and Gauss's Congruences
- Chapter 8 · Closing the Loop: An Order Desk Procedure, the Order Check-Digit Generator and a Pre-Registered Test