FAILURE MAP
← Case archive

FA-15146 / Numerics / Open access

Colex combination rank: binomial top index · case 01

The exact colex combination rank result violates the stated contract at binomial top index.

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

ROOT CAUSE

The binomial top index step uses a[i]+1 instead of a[i].

VERIFIED REPAIR

Use a[i] at the binomial top index step.

Unsuccessful approach: The partial repair a[i]-1 still violates the binomial top index invariant.

Case contract

Input strictly increasing selected nonnegative integers; zero-based colex rank=sum choose(a_i,i+1).

Why this case matters

Exact discrete arithmetic with observable algorithmic state; no floating point approximation is used.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
    a=x;rank=0
    for i in range(len(a)):
     top=a[i]+1;bottom=i+1
     term=math.comb(top,bottom) if 0<=bottom<=top else 0
     rank=rank+term
    return rank
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([0], 0), ([1], 1), ([4, 5, 6, 7, 8], 125), ([0], 0), ([0, 1], 0), ([0], 0), ([1], 1), ([2], 2)], [([0], 0), ([0, 2], 1), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 3], 3), ([1, 2], 2), ([1, 3], 4), ([2, 3], 5)], [([1], 1), ([2], 2), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 4], 6), ([1, 2], 2), ([1, 3], 4), ([1, 4], 7)], [([0, 1], 0), ([0, 3], 3), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 1, 2, 3], 0), ([0, 1, 2, 4], 1), ([0, 1, 3, 4], 2), ([0, 2, 3, 4], 3)], [([0], 0), ([2, 3], 5), ([0], 0), ([4, 5, 6, 7, 8], 125), ([1, 2], 2), ([1, 3], 4), ([1, 4], 7), ([1, 5], 11)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("explicit oracle %d" % i, 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
explicit oracle 010Failed
explicit oracle 121Failed
explicit oracle 2251125Failed
explicit oracle 310Failed
explicit oracle 420Failed
explicit oracle 510Failed
explicit oracle 621Failed
explicit oracle 732Failed

SHA-256 / 34e64ab8040f19cba3d329ec1dee627792851460b03f6c4fe8009d8ac7825908

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
    a=x;rank=0
    for i in range(len(a)):
     top=a[i]-1;bottom=i+1
     term=math.comb(top,bottom) if 0<=bottom<=top else 0
     rank=rank+term
    return rank
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([0], 0), ([1], 1), ([4, 5, 6, 7, 8], 125), ([0], 0), ([0, 1], 0), ([0], 0), ([1], 1), ([2], 2)], [([0], 0), ([0, 2], 1), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 3], 3), ([1, 2], 2), ([1, 3], 4), ([2, 3], 5)], [([1], 1), ([2], 2), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 4], 6), ([1, 2], 2), ([1, 3], 4), ([1, 4], 7)], [([0, 1], 0), ([0, 3], 3), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 1, 2, 3], 0), ([0, 1, 2, 4], 1), ([0, 1, 3, 4], 2), ([0, 2, 3, 4], 3)], [([0], 0), ([2, 3], 5), ([0], 0), ([4, 5, 6, 7, 8], 125), ([1, 2], 2), ([1, 3], 4), ([1, 4], 7), ([1, 5], 11)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("explicit oracle %d" % i, 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
explicit oracle 000Passed
explicit oracle 101Failed
explicit oracle 255125Failed
explicit oracle 300Passed
explicit oracle 400Passed
explicit oracle 500Passed
explicit oracle 601Failed
explicit oracle 712Failed

SHA-256 / feb7c2bde42829359ccadca7337b0d81576b5c0d37fa929328354d867087c45c

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
    a=x;rank=0
    for i in range(len(a)):
     top=a[i];bottom=i+1
     term=math.comb(top,bottom) if 0<=bottom<=top else 0
     rank=rank+term
    return rank
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([0], 0), ([1], 1), ([4, 5, 6, 7, 8], 125), ([0], 0), ([0, 1], 0), ([0], 0), ([1], 1), ([2], 2)], [([0], 0), ([0, 2], 1), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 3], 3), ([1, 2], 2), ([1, 3], 4), ([2, 3], 5)], [([1], 1), ([2], 2), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 4], 6), ([1, 2], 2), ([1, 3], 4), ([1, 4], 7)], [([0, 1], 0), ([0, 3], 3), ([0], 0), ([4, 5, 6, 7, 8], 125), ([0, 1, 2, 3], 0), ([0, 1, 2, 4], 1), ([0, 1, 3, 4], 2), ([0, 2, 3, 4], 3)], [([0], 0), ([2, 3], 5), ([0], 0), ([4, 5, 6, 7, 8], 125), ([1, 2], 2), ([1, 3], 4), ([1, 4], 7), ([1, 5], 11)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("explicit oracle %d" % i, 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
explicit oracle 000Passed
explicit oracle 111Passed
explicit oracle 2125125Passed
explicit oracle 300Passed
explicit oracle 400Passed
explicit oracle 500Passed
explicit oracle 611Passed
explicit oracle 722Passed

SHA-256 / 0c2ae4845e6dbf9e82042ac37b0cd915c3593647bc697c4d98d15c3417095503

Verification & scope

A deterministic bounded teaching model. Inputs are restricted to the explicit contract; this is not a production algebra library. 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:39:23.871805+00:00.

Case digest / 7a5acca786b55326e13a747047812e0c99b847de9de650d58fa3b1e53a4822fe