FA-72606 / Check-digit algorithms / Open access
Second control digit value ten is emitted · case 01
Base numbers whose second control digit would be 10 are reported as ordinary mismatches.
ROOT CAUSE
Only k1 is checked for the unassignable value 10.
VERIFIED REPAIR
Also return "unassignable" when k2 is 10.
Unsuccessful approach: Testing k2 > 10 can never trigger because ctrl returns at most 10.
Case contract
Norwegian-style 11-digit national identity number with two mod-11 control digits. k1 uses weights 3,7,6,1,8,9,4,5,2 on digits 1-9; k2 uses 5,4,3,2,7,6,5,4,3,2 on digits 1-9 followed by the computed k1. Each is 11 - (sum mod 11) with 11 mapped to 0; a value of 10 means the base number is "unassignable". Non-11-digit input is "malformed". Return [k1, k2, whether digits 10 and 11 equal k1 and k2].
Why this case matters
Population registers validate national identity numbers and report which control digit disagrees.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
if len(s) != 11 or not s.isascii() or not s.isdigit():
return 'malformed'
d = [int(ch) for ch in s]
def ctrl(ws, ds):
r = 11 - sum(w * x for w, x in zip(ws, ds)) % 11
return 0 if r == 11 else r
k1 = ctrl([3, 7, 6, 1, 8, 9, 4, 5, 2], d[:9])
if k1 == 10:
return 'unassignable'
k2 = ctrl([5, 4, 3, 2, 7, 6, 5, 4, 3, 2], d[:9] + [k1])
return [k1, k2, d[9] == k1 and d[10] == k2]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["28098179001"]', ['28098179001'], 'unassignable'], ['regression ["13128514961"]', ['13128514961'], 'unassignable'], ['control ["15068218891"]', ['15068218891'], [1, 8, False]], ['control ["12026119886"]', ['12026119886'], [2, 9, False]], ['control ["05077807892"]', ['05077807892'], 'unassignable'], ['control ["03060130066"]', ['03060130066'], [7, 7, False]], ['control ["26096688213"]', ['26096688213'], [7, 9, False]], ['control ["08042619712"]', ['08042619712'], [5, 3, False]]], [['regression ["13128514961"]', ['13128514961'], 'unassignable'], ['regression ["28098179001"]', ['28098179001'], 'unassignable'], ['control ["08042619712"]', ['08042619712'], [5, 3, False]], ['control ["12060326049"]', ['12060326049'], [0, 0, False]], ['control ["20127609775"]', ['20127609775'], [4, 9, False]], ['control ["09117682532"]', ['09117682532'], 'unassignable'], ['control ["07030971548"]', ['07030971548'], [0, 1, False]], ['control ["23057551053"]', ['23057551053'], [7, 0, False]]], [['regression ["28098179001"]', ['28098179001'], 'unassignable'], ['regression ["13128514961"]', ['13128514961'], 'unassignable'], ['control ["23057551053"]', ['23057551053'], [7, 0, False]], ['control ["13094093660"]', ['13094093660'], [4, 8, False]], ['control ["15013338686"]', ['15013338686'], [0, 1, False]], ['control ["27043193556"]', ['27043193556'], [1, 7, False]], ['control ["18117616591"]', ['18117616591'], [0, 5, False]], ['control ["13114336351"]', ['13114336351'], [5, 6, False]]], [['regression ["13128514961"]', ['13128514961'], 'unassignable'], ['regression ["28098179001"]', ['28098179001'], 'unassignable'], ['control ["13114336351"]', ['13114336351'], [5, 6, False]], ['control ["10122564665"]', ['10122564665'], [4, 4, False]], ['control ["23021493559"]', ['23021493559'], [9, 7, False]], ['control ["01117093517"]', ['01117093517'], [1, 0, False]], ['control ["18115340042"]', ['18115340042'], [5, 7, False]], ['control ["23030552606"]', ['23030552606'], [4, 4, False]]], [['regression ["28098179001"]', ['28098179001'], 'unassignable'], ['regression ["13128514961"]', ['13128514961'], 'unassignable'], ['control ["23030552606"]', ['23030552606'], [4, 4, False]], ['control ["26042158718"]', ['26042158718'], [3, 8, False]], ['control ["23056929360"]', ['23056929360'], [0, 4, False]], ['control ["20063518913"]', ['20063518913'], [0, 6, False]], ['control ["01010012356"]', ['01010012356'], [5, 6, True]], ['control ["15076500565"]', ['15076500565'], [6, 5, True]]]]
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 ["28098179001"] | [3, 10, False] | unassignable | Failed |
| regression ["13128514961"] | [4, 10, False] | unassignable | Failed |
| control ["15068218891"] | [1, 8, False] | [1, 8, False] | Passed |
| control ["12026119886"] | [2, 9, False] | [2, 9, False] | Passed |
| control ["05077807892"] | unassignable | unassignable | Passed |
| control ["03060130066"] | [7, 7, False] | [7, 7, False] | Passed |
| control ["26096688213"] | [7, 9, False] | [7, 9, False] | Passed |
| control ["08042619712"] | [5, 3, False] | [5, 3, False] | Passed |
SHA-256 / 3efe14f520274ff4beec4085bf1a71b4fb770d77cdb5b2767ae968c6b55ace7a
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
if len(s) != 11 or not s.isascii() or not s.isdigit():
return 'malformed'
d = [int(ch) for ch in s]
def ctrl(ws, ds):
r = 11 - sum(w * x for w, x in zip(ws, ds)) % 11
return 0 if r == 11 else r
k1 = ctrl([3, 7, 6, 1, 8, 9, 4, 5, 2], d[:9])
if k1 == 10:
return 'unassignable'
k2 = ctrl([5, 4, 3, 2, 7, 6, 5, 4, 3, 2], d[:9] + [k1])
if k2 > 10:
return 'unassignable'
return [k1, k2, d[9] == k1 and d[10] == k2]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["28098179001"]', ['28098179001'], 'unassignable'], ['regression ["13128514961"]', ['13128514961'], 'unassignable'], ['control ["15068218891"]', ['15068218891'], [1, 8, False]], ['control ["12026119886"]', ['12026119886'], [2, 9, False]], ['control ["05077807892"]', ['05077807892'], 'unassignable'], ['control ["03060130066"]', ['03060130066'], [7, 7, False]], ['control ["26096688213"]', ['26096688213'], [7, 9, False]], ['control ["08042619712"]', ['08042619712'], [5, 3, False]]], [['regression ["13128514961"]', ['13128514961'], 'unassignable'], ['regression ["28098179001"]', ['28098179001'], 'unassignable'], ['control ["08042619712"]', ['08042619712'], [5, 3, False]], ['control ["12060326049"]', ['12060326049'], [0, 0, False]], ['control ["20127609775"]', ['20127609775'], [4, 9, False]], ['control ["09117682532"]', ['09117682532'], 'unassignable'], ['control ["07030971548"]', ['07030971548'], [0, 1, False]], ['control ["23057551053"]', ['23057551053'], [7, 0, False]]], [['regression ["28098179001"]', ['28098179001'], 'unassignable'], ['regression ["13128514961"]', ['13128514961'], 'unassignable'], ['control ["23057551053"]', ['23057551053'], [7, 0, False]], ['control ["13094093660"]', ['13094093660'], [4, 8, False]], ['control ["15013338686"]', ['15013338686'], [0, 1, False]], ['control ["27043193556"]', ['27043193556'], [1, 7, False]], ['control ["18117616591"]', ['18117616591'], [0, 5, False]], ['control ["13114336351"]', ['13114336351'], [5, 6, False]]], [['regression ["13128514961"]', ['13128514961'], 'unassignable'], ['regression ["28098179001"]', ['28098179001'], 'unassignable'], ['control ["13114336351"]', ['13114336351'], [5, 6, False]], ['control ["10122564665"]', ['10122564665'], [4, 4, False]], ['control ["23021493559"]', ['23021493559'], [9, 7, False]], ['control ["01117093517"]', ['01117093517'], [1, 0, False]], ['control ["18115340042"]', ['18115340042'], [5, 7, False]], ['control ["23030552606"]', ['23030552606'], [4, 4, False]]], [['regression ["28098179001"]', ['28098179001'], 'unassignable'], ['regression ["13128514961"]', ['13128514961'], 'unassignable'], ['control ["23030552606"]', ['23030552606'], [4, 4, False]], ['control ["26042158718"]', ['26042158718'], [3, 8, False]], ['control ["23056929360"]', ['23056929360'], [0, 4, False]], ['control ["20063518913"]', ['20063518913'], [0, 6, False]], ['control ["01010012356"]', ['01010012356'], [5, 6, True]], ['control ["15076500565"]', ['15076500565'], [6, 5, True]]]]
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 ["28098179001"] | [3, 10, False] | unassignable | Failed |
| regression ["13128514961"] | [4, 10, False] | unassignable | Failed |
| control ["15068218891"] | [1, 8, False] | [1, 8, False] | Passed |
| control ["12026119886"] | [2, 9, False] | [2, 9, False] | Passed |
| control ["05077807892"] | unassignable | unassignable | Passed |
| control ["03060130066"] | [7, 7, False] | [7, 7, False] | Passed |
| control ["26096688213"] | [7, 9, False] | [7, 9, False] | Passed |
| control ["08042619712"] | [5, 3, False] | [5, 3, False] | Passed |
SHA-256 / 133e7826f49c36c7c6ccc547c8c652bea67c102a7d3806798b331379147ac4f6
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
if len(s) != 11 or not s.isascii() or not s.isdigit():
return 'malformed'
d = [int(ch) for ch in s]
def ctrl(ws, ds):
r = 11 - sum(w * x for w, x in zip(ws, ds)) % 11
return 0 if r == 11 else r
k1 = ctrl([3, 7, 6, 1, 8, 9, 4, 5, 2], d[:9])
if k1 == 10:
return 'unassignable'
k2 = ctrl([5, 4, 3, 2, 7, 6, 5, 4, 3, 2], d[:9] + [k1])
if k2 == 10:
return 'unassignable'
return [k1, k2, d[9] == k1 and d[10] == k2]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["28098179001"]', ['28098179001'], 'unassignable'], ['regression ["13128514961"]', ['13128514961'], 'unassignable'], ['control ["15068218891"]', ['15068218891'], [1, 8, False]], ['control ["12026119886"]', ['12026119886'], [2, 9, False]], ['control ["05077807892"]', ['05077807892'], 'unassignable'], ['control ["03060130066"]', ['03060130066'], [7, 7, False]], ['control ["26096688213"]', ['26096688213'], [7, 9, False]], ['control ["08042619712"]', ['08042619712'], [5, 3, False]]], [['regression ["13128514961"]', ['13128514961'], 'unassignable'], ['regression ["28098179001"]', ['28098179001'], 'unassignable'], ['control ["08042619712"]', ['08042619712'], [5, 3, False]], ['control ["12060326049"]', ['12060326049'], [0, 0, False]], ['control ["20127609775"]', ['20127609775'], [4, 9, False]], ['control ["09117682532"]', ['09117682532'], 'unassignable'], ['control ["07030971548"]', ['07030971548'], [0, 1, False]], ['control ["23057551053"]', ['23057551053'], [7, 0, False]]], [['regression ["28098179001"]', ['28098179001'], 'unassignable'], ['regression ["13128514961"]', ['13128514961'], 'unassignable'], ['control ["23057551053"]', ['23057551053'], [7, 0, False]], ['control ["13094093660"]', ['13094093660'], [4, 8, False]], ['control ["15013338686"]', ['15013338686'], [0, 1, False]], ['control ["27043193556"]', ['27043193556'], [1, 7, False]], ['control ["18117616591"]', ['18117616591'], [0, 5, False]], ['control ["13114336351"]', ['13114336351'], [5, 6, False]]], [['regression ["13128514961"]', ['13128514961'], 'unassignable'], ['regression ["28098179001"]', ['28098179001'], 'unassignable'], ['control ["13114336351"]', ['13114336351'], [5, 6, False]], ['control ["10122564665"]', ['10122564665'], [4, 4, False]], ['control ["23021493559"]', ['23021493559'], [9, 7, False]], ['control ["01117093517"]', ['01117093517'], [1, 0, False]], ['control ["18115340042"]', ['18115340042'], [5, 7, False]], ['control ["23030552606"]', ['23030552606'], [4, 4, False]]], [['regression ["28098179001"]', ['28098179001'], 'unassignable'], ['regression ["13128514961"]', ['13128514961'], 'unassignable'], ['control ["23030552606"]', ['23030552606'], [4, 4, False]], ['control ["26042158718"]', ['26042158718'], [3, 8, False]], ['control ["23056929360"]', ['23056929360'], [0, 4, False]], ['control ["20063518913"]', ['20063518913'], [0, 6, False]], ['control ["01010012356"]', ['01010012356'], [5, 6, True]], ['control ["15076500565"]', ['15076500565'], [6, 5, True]]]]
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 ["28098179001"] | unassignable | unassignable | Passed |
| regression ["13128514961"] | unassignable | unassignable | Passed |
| control ["15068218891"] | [1, 8, False] | [1, 8, False] | Passed |
| control ["12026119886"] | [2, 9, False] | [2, 9, False] | Passed |
| control ["05077807892"] | unassignable | unassignable | Passed |
| control ["03060130066"] | [7, 7, False] | [7, 7, False] | Passed |
| control ["26096688213"] | [7, 9, False] | [7, 9, False] | Passed |
| control ["08042619712"] | [5, 3, False] | [5, 3, False] | Passed |
SHA-256 / dd30fd96ecb5816a62d3721652af2af603f8f736f3f206bcb03b5f8fe4918bc3
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.942694+00:00.
Case digest / 6e09294106f4ea89e6d09107df2944fe2641375ecfc96a861cd01a36f585561f