What does The Algebra of Check Digits conclude, in numbers, about “Order Numbers, Remittance References and Internal Book Numbers: A Month's Accounts”?
Answer: With illustrative parameters of 20,000 manual entries a month, an error rate of 0.00625, 2 yuan per stopped slip and 150 yuan per missed one, a shop with no check loses 18750 yuan a month; EAN-style weights cost 794, Luhn 633, Verhoeff 448, Damm 446 and two-character MOD 97-10 263. As the share of transpositions rises from 0.05 to 0.30, EAN's misses rise from 236.4 to 514.2 while Verhoeff stays at 107.1. The simulated clerk agrees with enumeration; all 1000 of a forger's invented numbers are valid, and blind guesses pass at 0.0995, so a check digit guards only against miscopying and is no security credential. Order numbers, remittance references and internal book numbers use one Verhoeff digit, two MOD 97-10 characters and one Damm digit respectively. The next chapter returns to the classics: the Rites of Zhou put great contracts on ritual bronzes and small ones on red tablets, Gauss wrote down congruence, and each got something right.
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: -10, 0.05, 0.30, 107.1, 18750, 20000
| entries 20000, slips 125 a month (illustrative) | |||
| scheme | missed/month | caught/month | cost (yuan) |
| none | 125.00 | 0.00 | 18750 |
| Luhn | 2.59 | 122.41 | 633 |
| EAN 1,3 | 3.68 | 121.32 | 794 |
| Verhoeff | 1.34 | 123.66 | 448 |
| Damm | 1.32 | 123.67 | 446 |
| MOD 97-10 | 0.09 | 124.92 | 263 |
| adjacent-swap share Luhn EAN 1,3 Verhoeff (misses/10,000) | |||
| 0.05 | 195.6 | 236.4 | 107.1 |
| 0.10 | 206.7 | 291.9 | 107.1 |
| 0.15 | 217.8 | 347.5 | 107.1 |
| 0.20 | 228.9 | 403.0 | 107.1 |
| 0.30 | 251.2 | 514.2 | 107.1 |
Show the full program
# Chapter 6. p61: what a check digit is worth in a month of manual entry.
# Illustrative shop: 20,000 references typed by hand per month, one in
# 160 typed wrongly (0.00625), Verhoeff's error spectrum. A slip caught
# at entry costs a re-type (2 yuan of time); a slip that slips through
# costs a mis-posted remittance or order (150 yuan of tracing and
# refunds). Misses per 10,000 errors are the full-spectrum totals of
# p52. Part two moves weight between single errors and adjacent swaps,
# holding the other classes fixed, to see when the choice matters.
import math
ENTRIES, ERR_RATE = 20000, 0.00625
COST_CAUGHT, COST_MISSED = 2, 150
P52 = [("none", 10000.0), ("Luhn", 207.2), ("EAN 1,3", 294.3),
("Verhoeff", 107.1), ("Damm", 106.0), ("MOD 97-10", 6.8)]
errors = ENTRIES * ERR_RATE
print("entries %d, slips %d a month (illustrative)" % (ENTRIES, errors))
print("scheme missed/month caught/month cost (yuan)")
for name, per in P52:
miss = errors * per / 10000
caught = errors - miss
cost = math.fsum([miss * COST_MISSED, caught * COST_CAUGHT])
print("%-10s %12.2f %13.2f %12.0f" % (name, miss, caught, cost))
# 第二部分:单字错与相邻换位此消彼长(其余类别计数不变)
SINGLE, ADJ, REST = 9574, 1237, 12112 - 9574 - 1237
# 各方案对相邻换位的检出率(p12),以及其余类别的漏检数(p52 推得)
ADJ_RATE = {"Luhn": 88 / 90, "EAN 1,3": 80 / 90, "Verhoeff": 1.0}
REST_MISS = {"Luhn": 207.2 * 12112 / 10000 - ADJ * (1 - 88 / 90),
"EAN 1,3": 294.3 * 12112 / 10000 - ADJ * (1 - 80 / 90),
"Verhoeff": 107.1 * 12112 / 10000}
print("adjacent-swap share Luhn EAN 1,3 Verhoeff (misses/10,000)")
for share in (0.05, 0.10, 0.15, 0.20, 0.30):
adj = share * 12112
row = []
for name in ("Luhn", "EAN 1,3", "Verhoeff"):
m = math.fsum([adj * (1 - ADJ_RATE[name]), REST_MISS[name]])
row.append(m / 12112 * 10000)
print(" %.2f %6.1f %7.1f %8.1f" % (share, *row))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 6: Order Numbers, Remittance References and Internal Book Numbers: A Month's Accounts. 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 3 · Prime Moduli and Weights: The X of ISBN-10 and the Blind Spot of EAN-13
- 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 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