FAILURE MAP
← Case archive

FA-5756 / Combinatorics / Open access

Factoradic digit value · case 01

Decimal positional weights replace factorial weights.

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

ROOT CAUSE

Decimal positional weights replace factorial weights.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return sum(d*math.factorial(i) for i,d in enumerate(digits))

Unsuccessful approach: The factorial position begins one place too high.

Case contract

Nonnegative integer counts. Permutation and combination counts are zero when a requested selection exceeds the available objects. Shape sizes satisfy the preconditions stated below. digits is least-significant-first with 0<=digits[i]<=i; return the factorial-place-value integer. Exact operational definition: sum(d*math.factorial(i) for i,d in enumerate(digits))

Why this case matters

Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Combinatorics results depend on the stated convention.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(digits):
    return sum(d*10**i for i,d in enumerate(digits))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([0, 1, 2],)', solve(*([0, 1, 2],)), 5)
check('fixture 2: ([0, 0, 0, 1],)', solve(*([0, 0, 0, 1],)), 6)
check('fixture 3: ([0],)', solve(*([0],)), 0)
check('fixture 4: ([0, 1, 0, 3],)', solve(*([0, 1, 0, 3],)), 19)
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
fixture 1: ([0, 1, 2],)2105Failed
fixture 2: ([0, 0, 0, 1],)10006Failed
fixture 3: ([0],)00Passed
fixture 4: ([0, 1, 0, 3],)301019Failed

SHA-256 / a0ccd0b4ab98f02c8d6b9abd81389f615c61c055a1a8033f4e8e7e5e1e97fa1b

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(digits):
    return sum(d*math.factorial(i+1) for i,d in enumerate(digits))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([0, 1, 2],)', solve(*([0, 1, 2],)), 5)
check('fixture 2: ([0, 0, 0, 1],)', solve(*([0, 0, 0, 1],)), 6)
check('fixture 3: ([0],)', solve(*([0],)), 0)
check('fixture 4: ([0, 1, 0, 3],)', solve(*([0, 1, 0, 3],)), 19)
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
fixture 1: ([0, 1, 2],)145Failed
fixture 2: ([0, 0, 0, 1],)246Failed
fixture 3: ([0],)00Passed
fixture 4: ([0, 1, 0, 3],)7419Failed

SHA-256 / 8a09b984a9b52d86210bc7693016c810c14c43b1d5ab14937ccecce12c3c42b3

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(digits):
    return sum(d*math.factorial(i) for i,d in enumerate(digits))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([0, 1, 2],)', solve(*([0, 1, 2],)), 5)
check('fixture 2: ([0, 0, 0, 1],)', solve(*([0, 0, 0, 1],)), 6)
check('fixture 3: ([0],)', solve(*([0],)), 0)
check('fixture 4: ([0, 1, 0, 3],)', solve(*([0, 1, 0, 3],)), 19)
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
fixture 1: ([0, 1, 2],)55Passed
fixture 2: ([0, 0, 0, 1],)66Passed
fixture 3: ([0],)00Passed
fixture 4: ([0, 1, 0, 3],)1919Passed

SHA-256 / e551b2c46d8080687ec0afdb15ec4dac1eca09d6ca2d0ca7e406c4d16031b708

Verification & scope

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

Case digest / 5a20b61b61d4012f5f6ada4cd3ee92ab65eda73798881745b36be6ba2d62bfcf