FAILURE MAP
← Case archive

FA-72716 / Check-digit algorithms / Open access

Container letter values do not skip multiples of eleven · case 01

Container numbers with owner letters B or later get the wrong check digit.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Letters are numbered consecutively from 10, so B=11, which the scheme skips.

VERIFIED REPAIR

Skip 11, 22 and 33 while assigning letter values.

Unsuccessful approach: Skipping only the value 11 still leaves 22 and 33 assigned.

Case contract

Shipping container identification check digit: three uppercase owner letters, category U, J or Z, six serial digits and a check digit (else "malformed"). Letter values start at A=10 and skip every multiple of 11 (so B=12, L=23, V=34, Z=38). Position i (0-based) has weight 2^i; the check digit is (sum mod 11) mod 10. Return [check, match].

Why this case matters

Terminal gate systems validate container numbers read by OCR cameras before booking moves.

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[:3].isalpha() or not s[:3].isupper():
        return 'malformed'
    if s[3] not in 'UJZ' or not s[4:].isdigit():
        return 'malformed'
    vals = {}
    v = 10
    for ch in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
        vals[ch] = v
        v += 1
    total = 0
    for i, ch in enumerate(s[:10]):
        total += (vals[ch] if ch.isalpha() else int(ch)) * 2 ** i
    check = total % 11 % 10
    return [check, check == int(s[10])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["HRNU7843702"]', ['HRNU7843702'], [9, False]], ['regression ["BYYJ6917585"]', ['BYYJ6917585'], [8, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["GEDJ3497886"]', ['GEDJ3497886'], [3, False]], ['control ["YQEU5793145"]', ['YQEU5793145'], [6, False]]], [['regression ["MUHJ6260452"]', ['MUHJ6260452'], [4, False]], ['regression ["GEDJ3497886"]', ['GEDJ3497886'], [3, False]], ['partial-repair ["YQEU5793145"]', ['YQEU5793145'], [6, False]], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["OQHU9278051"]', ['OQHU9278051'], [8, False]]], [['regression ["CYVU1050697"]', ['CYVU1050697'], [7, True]], ['regression ["FLAU0380833"]', ['FLAU0380833'], [7, False]], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["LBRU3332332"]', ['LBRU3332332'], [4, False]], ['control ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]]], [['regression ["TRVJ4468592"]', ['TRVJ4468592'], [8, False]], ['regression ["LGSU0173454"]', ['LGSU0173454'], [8, False]], ['partial-repair ["VQAJ3159690"]', ['VQAJ3159690'], [0, True]], ['partial-repair ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed']], [['regression ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['regression ["LBRU3332332"]', ['LBRU3332332'], [4, False]], ['partial-repair ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['partial-repair ["QSJZ1716340"]', ['QSJZ1716340'], [4, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed']]]
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 fixtureActualExpectedOutcome
regression ["HRNU7843702"][2, True][9, False]Failed
regression ["BYYJ6917585"][3, False][8, False]Failed
control ["CSQU305438"]malformedmalformedPassed
control ["CSQX3054383"]malformedmalformedPassed
control ["csqu3054383"]malformedmalformedPassed
control ["C1QU3054383"]malformedmalformedPassed
control ["GEDJ3497886"][0, False][3, False]Failed
control ["YQEU5793145"][1, False][6, False]Failed

SHA-256 / a042f9164a814964d7ab14b3ae6a9ac143caa2fcf27f493ded9e0f068715d074

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[:3].isalpha() or not s[:3].isupper():
        return 'malformed'
    if s[3] not in 'UJZ' or not s[4:].isdigit():
        return 'malformed'
    vals = {}
    v = 10
    for ch in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
        if v == 11:
            v += 1
        vals[ch] = v
        v += 1
    total = 0
    for i, ch in enumerate(s[:10]):
        total += (vals[ch] if ch.isalpha() else int(ch)) * 2 ** i
    check = total % 11 % 10
    return [check, check == int(s[10])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["HRNU7843702"]', ['HRNU7843702'], [9, False]], ['regression ["BYYJ6917585"]', ['BYYJ6917585'], [8, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["GEDJ3497886"]', ['GEDJ3497886'], [3, False]], ['control ["YQEU5793145"]', ['YQEU5793145'], [6, False]]], [['regression ["MUHJ6260452"]', ['MUHJ6260452'], [4, False]], ['regression ["GEDJ3497886"]', ['GEDJ3497886'], [3, False]], ['partial-repair ["YQEU5793145"]', ['YQEU5793145'], [6, False]], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["OQHU9278051"]', ['OQHU9278051'], [8, False]]], [['regression ["CYVU1050697"]', ['CYVU1050697'], [7, True]], ['regression ["FLAU0380833"]', ['FLAU0380833'], [7, False]], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["LBRU3332332"]', ['LBRU3332332'], [4, False]], ['control ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]]], [['regression ["TRVJ4468592"]', ['TRVJ4468592'], [8, False]], ['regression ["LGSU0173454"]', ['LGSU0173454'], [8, False]], ['partial-repair ["VQAJ3159690"]', ['VQAJ3159690'], [0, True]], ['partial-repair ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed']], [['regression ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['regression ["LBRU3332332"]', ['LBRU3332332'], [4, False]], ['partial-repair ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['partial-repair ["QSJZ1716340"]', ['QSJZ1716340'], [4, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed']]]
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 fixtureActualExpectedOutcome
regression ["HRNU7843702"][6, False][9, False]Failed
regression ["BYYJ6917585"][7, False][8, False]Failed
control ["CSQU305438"]malformedmalformedPassed
control ["CSQX3054383"]malformedmalformedPassed
control ["csqu3054383"]malformedmalformedPassed
control ["C1QU3054383"]malformedmalformedPassed
control ["GEDJ3497886"][3, False][3, False]Passed
control ["YQEU5793145"][5, True][6, False]Failed

SHA-256 / 08cc52c3db2c40020820b7d81af36b82b644e90e4d91751878fff51a99641181

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[:3].isalpha() or not s[:3].isupper():
        return 'malformed'
    if s[3] not in 'UJZ' or not s[4:].isdigit():
        return 'malformed'
    vals = {}
    v = 10
    for ch in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
        if v % 11 == 0:
            v += 1
        vals[ch] = v
        v += 1
    total = 0
    for i, ch in enumerate(s[:10]):
        total += (vals[ch] if ch.isalpha() else int(ch)) * 2 ** i
    check = total % 11 % 10
    return [check, check == int(s[10])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["HRNU7843702"]', ['HRNU7843702'], [9, False]], ['regression ["BYYJ6917585"]', ['BYYJ6917585'], [8, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["GEDJ3497886"]', ['GEDJ3497886'], [3, False]], ['control ["YQEU5793145"]', ['YQEU5793145'], [6, False]]], [['regression ["MUHJ6260452"]', ['MUHJ6260452'], [4, False]], ['regression ["GEDJ3497886"]', ['GEDJ3497886'], [3, False]], ['partial-repair ["YQEU5793145"]', ['YQEU5793145'], [6, False]], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["OQHU9278051"]', ['OQHU9278051'], [8, False]]], [['regression ["CYVU1050697"]', ['CYVU1050697'], [7, True]], ['regression ["FLAU0380833"]', ['FLAU0380833'], [7, False]], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["LBRU3332332"]', ['LBRU3332332'], [4, False]], ['control ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]]], [['regression ["TRVJ4468592"]', ['TRVJ4468592'], [8, False]], ['regression ["LGSU0173454"]', ['LGSU0173454'], [8, False]], ['partial-repair ["VQAJ3159690"]', ['VQAJ3159690'], [0, True]], ['partial-repair ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed'], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed']], [['regression ["RGOU0215685"]', ['RGOU0215685'], [3, False]], ['regression ["LBRU3332332"]', ['LBRU3332332'], [4, False]], ['partial-repair ["TSAZ4635083"]', ['TSAZ4635083'], [9, False]], ['partial-repair ["QSJZ1716340"]', ['QSJZ1716340'], [4, False]], ['control ["CSQU305438"]', ['CSQU305438'], 'malformed'], ['control ["CSQX3054383"]', ['CSQX3054383'], 'malformed'], ['control ["csqu3054383"]', ['csqu3054383'], 'malformed'], ['control ["C1QU3054383"]', ['C1QU3054383'], 'malformed']]]
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 fixtureActualExpectedOutcome
regression ["HRNU7843702"][9, False][9, False]Passed
regression ["BYYJ6917585"][8, False][8, False]Passed
control ["CSQU305438"]malformedmalformedPassed
control ["CSQX3054383"]malformedmalformedPassed
control ["csqu3054383"]malformedmalformedPassed
control ["C1QU3054383"]malformedmalformedPassed
control ["GEDJ3497886"][3, False][3, False]Passed
control ["YQEU5793145"][6, False][6, False]Passed

SHA-256 / f9d41b3d921d79a27f144b5cff2eb383098faa4975a8de56ad075587d221996b

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:40.970232+00:00.

Case digest / 6f145a0aa973c5ed0355256e440c666d91857340265f80467eb1350b6874fc00