FA-5731 / Combinatorics / Open access
Binary strings no adjacent ones · case 01
All bit strings are counted despite the adjacency constraint.
ROOT CAUSE
All bit strings are counted despite the adjacency constraint.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return sum(math.comb(n-k+1,k) for k in range((n+1)//2+1))
Unsuccessful approach: Subtracting the length does not count overlapping forbidden patterns.
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. Binary strings no adjacent ones. Exact operational definition: sum(math.comb(n-k+1,k) for k in range((n+1)//2+1))
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(n):
return 2**n
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 2)
check('fixture 3: (3,)', solve(*(3,)), 5)
check('fixture 4: (4,)', solve(*(4,)), 8)
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 |
|---|---|---|---|
| fixture 1: (0,) | 1 | 1 | Passed |
| fixture 2: (1,) | 2 | 2 | Passed |
| fixture 3: (3,) | 8 | 5 | Failed |
| fixture 4: (4,) | 16 | 8 | Failed |
SHA-256 / 11143ce4ff9d37818d9a04fb3411fb94720c24fceb68a64374df95fede4d63c7
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(n):
return 2**n-n
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 2)
check('fixture 3: (3,)', solve(*(3,)), 5)
check('fixture 4: (4,)', solve(*(4,)), 8)
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 |
|---|---|---|---|
| fixture 1: (0,) | 1 | 1 | Passed |
| fixture 2: (1,) | 1 | 2 | Failed |
| fixture 3: (3,) | 5 | 5 | Passed |
| fixture 4: (4,) | 12 | 8 | Failed |
SHA-256 / 0930d7ab26f5918e130b13f29c1006469c87ba31424aa9d34e8e0fca7d976aa4
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(n):
return sum(math.comb(n-k+1,k) for k in range((n+1)//2+1))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 1)
check('fixture 2: (1,)', solve(*(1,)), 2)
check('fixture 3: (3,)', solve(*(3,)), 5)
check('fixture 4: (4,)', solve(*(4,)), 8)
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 |
|---|---|---|---|
| fixture 1: (0,) | 1 | 1 | Passed |
| fixture 2: (1,) | 2 | 2 | Passed |
| fixture 3: (3,) | 5 | 5 | Passed |
| fixture 4: (4,) | 8 | 8 | Passed |
SHA-256 / ab9f052b152f516f423d5522974821e4aa2d1af446be5dafee8205b4e0e1f90c
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:52.871468+00:00.
Case digest / f4348514714eb6ba10e1d572ab7bbef576594e2e2d2711889559f8eee68a7259