FA-72816 / Check-digit algorithms / Open access
Bank-slip mod 11 maps 10 and 11 to zero · case 01
Slips whose remainder is 0 or 1 get verifying digit 0, which is reserved.
ROOT CAUSE
The substitution for 10 and 11 uses 0 instead of 1.
VERIFIED REPAIR
Replace both 10 and 11 by 1.
Unsuccessful approach: Using r % 10 sends 10 to 0 and 11 to 1, fixing only one case.
Case contract
Bank-slip style mod-11 verifying digit: nonempty ASCII digits (else None); weights 2,3,...,9 cycle from the rightmost digit; r = 11 - sum mod 11; results 10 and 11 are replaced by 1.
Why this case matters
Payment slip barcodes carry a general verifying digit that banks recompute on capture.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
if not s or not s.isascii() or not s.isdigit():
return None
total = 0
for i, ch in enumerate(reversed(s)):
total += int(ch) * (2 + i % 8)
r = 11 - total % 11
return 0 if r in (10, 11) else r
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["19275955179485910051680234501004684803"]', ['19275955179485910051680234501004684803'], 1], ['regression ["067817050276532142767980812420339104011"]', ['067817050276532142767980812420339104011'], 1], ['partial-repair ["54"]', ['54'], 1], ['control ["81787654"]', ['81787654'], 5], ['control ["4216186312776190006424731500839778176090"]', ['4216186312776190006424731500839778176090'], 9], ['control ["0154413110088423"]', ['0154413110088423'], 4], ['control ["2265387292381697"]', ['2265387292381697'], 4], ['control ["157141363073674774805"]', ['157141363073674774805'], 2]], [['regression ["883588303"]', ['883588303'], 1], ['regression ["54"]', ['54'], 1], ['partial-repair ["19275955179485910051680234501004684803"]', ['19275955179485910051680234501004684803'], 1], ['control ["32390980174642183951992567"]', ['32390980174642183951992567'], 6], ['control ["31028572572652095"]', ['31028572572652095'], 8], ['control ["1013803677685407598527336083735651"]', ['1013803677685407598527336083735651'], 1], ['control ["541856920526325212396079880824962283"]', ['541856920526325212396079880824962283'], 9], ['control ["90636853841379"]', ['90636853841379'], 8]], [['regression ["27981996326643088365414819731338534"]', ['27981996326643088365414819731338534'], 1], ['regression ["0"]', ['0'], 1], ['partial-repair ["19275955179485910051680234501004684803"]', ['19275955179485910051680234501004684803'], 1], ['partial-repair ["54"]', ['54'], 1], ['control ["815243122823727656729727617889"]', ['815243122823727656729727617889'], 4], ['control ["866534787261435696309320"]', ['866534787261435696309320'], 1], ['control ["59608070035358359099925603574938148494060"]', ['59608070035358359099925603574938148494060'], 2], ['control ["2567041842604142121509116255"]', ['2567041842604142121509116255'], 9]], [['regression ["19275955179485910051680234501004684803"]', ['19275955179485910051680234501004684803'], 1], ['regression ["067817050276532142767980812420339104011"]', ['067817050276532142767980812420339104011'], 1], ['partial-repair ["54"]', ['54'], 1], ['control ["666316543903176040"]', ['666316543903176040'], 7], ['control ["221858430508251943268773964844902173"]', ['221858430508251943268773964844902173'], 8], ['control ["26064317433322755425"]', ['26064317433322755425'], 2], ['control ["635756761654188"]', ['635756761654188'], 1], ['control ["1"]', ['1'], 9]], [['regression ["883588303"]', ['883588303'], 1], ['regression ["54"]', ['54'], 1], ['partial-repair ["19275955179485910051680234501004684803"]', ['19275955179485910051680234501004684803'], 1], ['control [""]', [''], None], ['control ["12x"]', ['12x'], None], ['control ["9999999999999999999999999999999999999999999"]', ['9999999999999999999999999999999999999999999'], 7], ['control ["81787654"]', ['81787654'], 5], ['control ["4216186312776190006424731500839778176090"]', ['4216186312776190006424731500839778176090'], 9]]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression ["19275955179485910051680234501004684803"] | 0 | 1 | Failed |
| regression ["067817050276532142767980812420339104011"] | 0 | 1 | Failed |
| partial-repair ["54"] | 0 | 1 | Failed |
| control ["81787654"] | 5 | 5 | Passed |
| control ["4216186312776190006424731500839778176090"] | 9 | 9 | Passed |
| control ["0154413110088423"] | 4 | 4 | Passed |
| control ["2265387292381697"] | 4 | 4 | Passed |
| control ["157141363073674774805"] | 2 | 2 | Passed |
SHA-256 / 5a1f9f7bfe22f491a6ffb5c74a6545b32394fd01c4806c9684e54f28c3dc1350
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
if not s or not s.isascii() or not s.isdigit():
return None
total = 0
for i, ch in enumerate(reversed(s)):
total += int(ch) * (2 + i % 8)
r = 11 - total % 11
return r % 10
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["19275955179485910051680234501004684803"]', ['19275955179485910051680234501004684803'], 1], ['regression ["067817050276532142767980812420339104011"]', ['067817050276532142767980812420339104011'], 1], ['partial-repair ["54"]', ['54'], 1], ['control ["81787654"]', ['81787654'], 5], ['control ["4216186312776190006424731500839778176090"]', ['4216186312776190006424731500839778176090'], 9], ['control ["0154413110088423"]', ['0154413110088423'], 4], ['control ["2265387292381697"]', ['2265387292381697'], 4], ['control ["157141363073674774805"]', ['157141363073674774805'], 2]], [['regression ["883588303"]', ['883588303'], 1], ['regression ["54"]', ['54'], 1], ['partial-repair ["19275955179485910051680234501004684803"]', ['19275955179485910051680234501004684803'], 1], ['control ["32390980174642183951992567"]', ['32390980174642183951992567'], 6], ['control ["31028572572652095"]', ['31028572572652095'], 8], ['control ["1013803677685407598527336083735651"]', ['1013803677685407598527336083735651'], 1], ['control ["541856920526325212396079880824962283"]', ['541856920526325212396079880824962283'], 9], ['control ["90636853841379"]', ['90636853841379'], 8]], [['regression ["27981996326643088365414819731338534"]', ['27981996326643088365414819731338534'], 1], ['regression ["0"]', ['0'], 1], ['partial-repair ["19275955179485910051680234501004684803"]', ['19275955179485910051680234501004684803'], 1], ['partial-repair ["54"]', ['54'], 1], ['control ["815243122823727656729727617889"]', ['815243122823727656729727617889'], 4], ['control ["866534787261435696309320"]', ['866534787261435696309320'], 1], ['control ["59608070035358359099925603574938148494060"]', ['59608070035358359099925603574938148494060'], 2], ['control ["2567041842604142121509116255"]', ['2567041842604142121509116255'], 9]], [['regression ["19275955179485910051680234501004684803"]', ['19275955179485910051680234501004684803'], 1], ['regression ["067817050276532142767980812420339104011"]', ['067817050276532142767980812420339104011'], 1], ['partial-repair ["54"]', ['54'], 1], ['control ["666316543903176040"]', ['666316543903176040'], 7], ['control ["221858430508251943268773964844902173"]', ['221858430508251943268773964844902173'], 8], ['control ["26064317433322755425"]', ['26064317433322755425'], 2], ['control ["635756761654188"]', ['635756761654188'], 1], ['control ["1"]', ['1'], 9]], [['regression ["883588303"]', ['883588303'], 1], ['regression ["54"]', ['54'], 1], ['partial-repair ["19275955179485910051680234501004684803"]', ['19275955179485910051680234501004684803'], 1], ['control [""]', [''], None], ['control ["12x"]', ['12x'], None], ['control ["9999999999999999999999999999999999999999999"]', ['9999999999999999999999999999999999999999999'], 7], ['control ["81787654"]', ['81787654'], 5], ['control ["4216186312776190006424731500839778176090"]', ['4216186312776190006424731500839778176090'], 9]]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression ["19275955179485910051680234501004684803"] | 0 | 1 | Failed |
| regression ["067817050276532142767980812420339104011"] | 1 | 1 | Passed |
| partial-repair ["54"] | 0 | 1 | Failed |
| control ["81787654"] | 5 | 5 | Passed |
| control ["4216186312776190006424731500839778176090"] | 9 | 9 | Passed |
| control ["0154413110088423"] | 4 | 4 | Passed |
| control ["2265387292381697"] | 4 | 4 | Passed |
| control ["157141363073674774805"] | 2 | 2 | Passed |
SHA-256 / 0dce811cd98225d3de6b48195686391dc8e42c67e9bf7204c28912cd3ebdb6b0
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
if not s or not s.isascii() or not s.isdigit():
return None
total = 0
for i, ch in enumerate(reversed(s)):
total += int(ch) * (2 + i % 8)
r = 11 - total % 11
return 1 if r in (10, 11) else r
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["19275955179485910051680234501004684803"]', ['19275955179485910051680234501004684803'], 1], ['regression ["067817050276532142767980812420339104011"]', ['067817050276532142767980812420339104011'], 1], ['partial-repair ["54"]', ['54'], 1], ['control ["81787654"]', ['81787654'], 5], ['control ["4216186312776190006424731500839778176090"]', ['4216186312776190006424731500839778176090'], 9], ['control ["0154413110088423"]', ['0154413110088423'], 4], ['control ["2265387292381697"]', ['2265387292381697'], 4], ['control ["157141363073674774805"]', ['157141363073674774805'], 2]], [['regression ["883588303"]', ['883588303'], 1], ['regression ["54"]', ['54'], 1], ['partial-repair ["19275955179485910051680234501004684803"]', ['19275955179485910051680234501004684803'], 1], ['control ["32390980174642183951992567"]', ['32390980174642183951992567'], 6], ['control ["31028572572652095"]', ['31028572572652095'], 8], ['control ["1013803677685407598527336083735651"]', ['1013803677685407598527336083735651'], 1], ['control ["541856920526325212396079880824962283"]', ['541856920526325212396079880824962283'], 9], ['control ["90636853841379"]', ['90636853841379'], 8]], [['regression ["27981996326643088365414819731338534"]', ['27981996326643088365414819731338534'], 1], ['regression ["0"]', ['0'], 1], ['partial-repair ["19275955179485910051680234501004684803"]', ['19275955179485910051680234501004684803'], 1], ['partial-repair ["54"]', ['54'], 1], ['control ["815243122823727656729727617889"]', ['815243122823727656729727617889'], 4], ['control ["866534787261435696309320"]', ['866534787261435696309320'], 1], ['control ["59608070035358359099925603574938148494060"]', ['59608070035358359099925603574938148494060'], 2], ['control ["2567041842604142121509116255"]', ['2567041842604142121509116255'], 9]], [['regression ["19275955179485910051680234501004684803"]', ['19275955179485910051680234501004684803'], 1], ['regression ["067817050276532142767980812420339104011"]', ['067817050276532142767980812420339104011'], 1], ['partial-repair ["54"]', ['54'], 1], ['control ["666316543903176040"]', ['666316543903176040'], 7], ['control ["221858430508251943268773964844902173"]', ['221858430508251943268773964844902173'], 8], ['control ["26064317433322755425"]', ['26064317433322755425'], 2], ['control ["635756761654188"]', ['635756761654188'], 1], ['control ["1"]', ['1'], 9]], [['regression ["883588303"]', ['883588303'], 1], ['regression ["54"]', ['54'], 1], ['partial-repair ["19275955179485910051680234501004684803"]', ['19275955179485910051680234501004684803'], 1], ['control [""]', [''], None], ['control ["12x"]', ['12x'], None], ['control ["9999999999999999999999999999999999999999999"]', ['9999999999999999999999999999999999999999999'], 7], ['control ["81787654"]', ['81787654'], 5], ['control ["4216186312776190006424731500839778176090"]', ['4216186312776190006424731500839778176090'], 9]]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression ["19275955179485910051680234501004684803"] | 1 | 1 | Passed |
| regression ["067817050276532142767980812420339104011"] | 1 | 1 | Passed |
| partial-repair ["54"] | 1 | 1 | Passed |
| control ["81787654"] | 5 | 5 | Passed |
| control ["4216186312776190006424731500839778176090"] | 9 | 9 | Passed |
| control ["0154413110088423"] | 4 | 4 | Passed |
| control ["2265387292381697"] | 4 | 4 | Passed |
| control ["157141363073674774805"] | 2 | 2 | Passed |
SHA-256 / e646eca0c8b25da3491b44694c7f740e682661020b2c23159de30be4d6e9e421
Verification & scope
A deterministic, bounded teaching model of the named scheme under the stated contract; not a certified validator. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:48:41.807199+00:00.
Case digest / e9bd2c71d56ed0a35c130e95c2332a41dfe15ea025ed7e445b24fdd4a1680d2e