FA-72566 / Check-digit algorithms / Open access
MOD 11,10 keeps a zero intermediate sum · case 01
Payloads whose running sum hits a multiple of ten get the wrong check digit.
ROOT CAUSE
The substitution of 10 for a zero remainder is missing, so the product collapses to 0.
VERIFIED REPAIR
Replace a zero (p + d) mod 10 by 10 before doubling.
Unsuccessful approach: Substituting after reducing mod 11 instead of mod 10 misses the zero case entirely.
Case contract
ISO 7064 MOD 11,10 hybrid check digit generation for a nonempty ASCII digit payload (else None). Start with p = 10; for each digit p = ((p + d) mod 10, with 0 replaced by 10) * 2 mod 11; the check digit is (11 - p) mod 10.
Why this case matters
Tax and personal identification numbers (for example OIB-style identifiers) use the hybrid MOD 11,10 system.
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
p = 10
for ch in s:
p = ((p + int(ch)) % 10) * 2 % 11
return (11 - p) % 10
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["072"]', ['072'], 5], ['regression ["98772300"]', ['98772300'], 4], ['partial-repair ["9"]', ['9'], 4], ['partial-repair ["12"]', ['12'], 3], ['control ["9795751"]', ['9795751'], 6], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["36073"]', ['36073'], 5]], [['regression ["6279939841"]', ['6279939841'], 2], ['regression ["2638206592"]', ['2638206592'], 8], ['partial-repair ["36073"]', ['36073'], 5], ['partial-repair ["3370345686"]', ['3370345686'], 4], ['control ["12a"]', ['12a'], None], ['control ["9795751"]', ['9795751'], 6], ['control [""]', [''], None], ['control ["412595035658"]', ['412595035658'], 9]], [['regression ["166069"]', ['166069'], 6], ['regression ["6943515153"]', ['6943515153'], 0], ['partial-repair ["412595035658"]', ['412595035658'], 9], ['partial-repair ["9477"]', ['9477'], 3], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["9795751"]', ['9795751'], 6], ['control ["0"]', ['0'], 2]], [['regression ["00000"]', ['00000'], 0], ['regression ["072"]', ['072'], 5], ['partial-repair ["6943515153"]', ['6943515153'], 0], ['partial-repair ["1"]', ['1'], 9], ['control ["9795751"]', ['9795751'], 6], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["3"]', ['3'], 5]], [['regression ["3370345686"]', ['3370345686'], 4], ['regression ["6279939841"]', ['6279939841'], 2], ['partial-repair ["95"]', ['95'], 7], ['partial-repair ["55555"]', ['55555'], 1], ['control ["12a"]', ['12a'], None], ['control ["9795751"]', ['9795751'], 6], ['control [""]', [''], None], ['control ["12"]', ['12'], 3]]]
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 ["072"] | 1 | 5 | Failed |
| regression ["98772300"] | 0 | 4 | Failed |
| partial-repair ["9"] | 4 | 4 | Passed |
| partial-repair ["12"] | 3 | 3 | Passed |
| control ["9795751"] | 6 | 6 | Passed |
| control [""] | None | None | Passed |
| control ["12a"] | None | None | Passed |
| control ["36073"] | 5 | 5 | Passed |
SHA-256 / 9d1a91fc2d6ba54f608de1e24de37e7f8e8b2ecba1f65a231e858079a98ac390
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
p = 10
for ch in s:
p = ((p + int(ch)) % 11 or 10) * 2 % 11
return (11 - p) % 10
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["072"]', ['072'], 5], ['regression ["98772300"]', ['98772300'], 4], ['partial-repair ["9"]', ['9'], 4], ['partial-repair ["12"]', ['12'], 3], ['control ["9795751"]', ['9795751'], 6], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["36073"]', ['36073'], 5]], [['regression ["6279939841"]', ['6279939841'], 2], ['regression ["2638206592"]', ['2638206592'], 8], ['partial-repair ["36073"]', ['36073'], 5], ['partial-repair ["3370345686"]', ['3370345686'], 4], ['control ["12a"]', ['12a'], None], ['control ["9795751"]', ['9795751'], 6], ['control [""]', [''], None], ['control ["412595035658"]', ['412595035658'], 9]], [['regression ["166069"]', ['166069'], 6], ['regression ["6943515153"]', ['6943515153'], 0], ['partial-repair ["412595035658"]', ['412595035658'], 9], ['partial-repair ["9477"]', ['9477'], 3], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["9795751"]', ['9795751'], 6], ['control ["0"]', ['0'], 2]], [['regression ["00000"]', ['00000'], 0], ['regression ["072"]', ['072'], 5], ['partial-repair ["6943515153"]', ['6943515153'], 0], ['partial-repair ["1"]', ['1'], 9], ['control ["9795751"]', ['9795751'], 6], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["3"]', ['3'], 5]], [['regression ["3370345686"]', ['3370345686'], 4], ['regression ["6279939841"]', ['6279939841'], 2], ['partial-repair ["95"]', ['95'], 7], ['partial-repair ["55555"]', ['55555'], 1], ['control ["12a"]', ['12a'], None], ['control ["9795751"]', ['9795751'], 6], ['control [""]', [''], None], ['control ["12"]', ['12'], 3]]]
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 ["072"] | 9 | 5 | Failed |
| regression ["98772300"] | 4 | 4 | Passed |
| partial-repair ["9"] | 6 | 4 | Failed |
| partial-repair ["12"] | 2 | 3 | Failed |
| control ["9795751"] | 6 | 6 | Passed |
| control [""] | None | None | Passed |
| control ["12a"] | None | None | Passed |
| control ["36073"] | 4 | 5 | Failed |
SHA-256 / 3d4a89d6116c98b316bbeddfe6b9bb6e58a84f0aae6ee3245c3d2fd72a67e526
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
p = 10
for ch in s:
p = ((p + int(ch)) % 10 or 10) * 2 % 11
return (11 - p) % 10
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["072"]', ['072'], 5], ['regression ["98772300"]', ['98772300'], 4], ['partial-repair ["9"]', ['9'], 4], ['partial-repair ["12"]', ['12'], 3], ['control ["9795751"]', ['9795751'], 6], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["36073"]', ['36073'], 5]], [['regression ["6279939841"]', ['6279939841'], 2], ['regression ["2638206592"]', ['2638206592'], 8], ['partial-repair ["36073"]', ['36073'], 5], ['partial-repair ["3370345686"]', ['3370345686'], 4], ['control ["12a"]', ['12a'], None], ['control ["9795751"]', ['9795751'], 6], ['control [""]', [''], None], ['control ["412595035658"]', ['412595035658'], 9]], [['regression ["166069"]', ['166069'], 6], ['regression ["6943515153"]', ['6943515153'], 0], ['partial-repair ["412595035658"]', ['412595035658'], 9], ['partial-repair ["9477"]', ['9477'], 3], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["9795751"]', ['9795751'], 6], ['control ["0"]', ['0'], 2]], [['regression ["00000"]', ['00000'], 0], ['regression ["072"]', ['072'], 5], ['partial-repair ["6943515153"]', ['6943515153'], 0], ['partial-repair ["1"]', ['1'], 9], ['control ["9795751"]', ['9795751'], 6], ['control [""]', [''], None], ['control ["12a"]', ['12a'], None], ['control ["3"]', ['3'], 5]], [['regression ["3370345686"]', ['3370345686'], 4], ['regression ["6279939841"]', ['6279939841'], 2], ['partial-repair ["95"]', ['95'], 7], ['partial-repair ["55555"]', ['55555'], 1], ['control ["12a"]', ['12a'], None], ['control ["9795751"]', ['9795751'], 6], ['control [""]', [''], None], ['control ["12"]', ['12'], 3]]]
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 ["072"] | 5 | 5 | Passed |
| regression ["98772300"] | 4 | 4 | Passed |
| partial-repair ["9"] | 4 | 4 | Passed |
| partial-repair ["12"] | 3 | 3 | Passed |
| control ["9795751"] | 6 | 6 | Passed |
| control [""] | None | None | Passed |
| control ["12a"] | None | None | Passed |
| control ["36073"] | 5 | 5 | Passed |
SHA-256 / 3ba5347d6760694ede65516193000b47804d8d133a8a5822917830fb149ffde3
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:39.649074+00:00.
Case digest / adaa57154eab9b4e13110857e6ff963cd3af04c8ae529dd5da877e0b3c847028