FA-5676 / Combinatorics / Open access
Weak composition count · case 01
A positive-composition formula excludes zero components.
ROOT CAUSE
A positive-composition formula excludes zero components.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return math.comb(n+parts-1,parts-1)
Unsuccessful approach: Labelled balls are counted when only component totals matter.
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. parts>=1; count ordered vectors of parts nonnegative integers summing to n. Exact operational definition: math.comb(n+parts-1,parts-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, parts):
return math.comb(n-1,parts-1) if n>=parts else 0
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 2)', solve(*(3, 2)), 4)
check('fixture 2: (0, 3)', solve(*(0, 3)), 1)
check('fixture 3: (4, 3)', solve(*(4, 3)), 15)
check('fixture 4: (5, 1)', solve(*(5, 1)), 1)
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: (3, 2) | 2 | 4 | Failed |
| fixture 2: (0, 3) | 0 | 1 | Failed |
| fixture 3: (4, 3) | 3 | 15 | Failed |
| fixture 4: (5, 1) | 1 | 1 | Passed |
SHA-256 / 8db369a235476290cb63cac250e1b397361f3ba5a0c701ad40a2e0651f366612
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, parts):
return parts**n
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 2)', solve(*(3, 2)), 4)
check('fixture 2: (0, 3)', solve(*(0, 3)), 1)
check('fixture 3: (4, 3)', solve(*(4, 3)), 15)
check('fixture 4: (5, 1)', solve(*(5, 1)), 1)
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: (3, 2) | 8 | 4 | Failed |
| fixture 2: (0, 3) | 1 | 1 | Passed |
| fixture 3: (4, 3) | 81 | 15 | Failed |
| fixture 4: (5, 1) | 1 | 1 | Passed |
SHA-256 / ad214f2d1cfaf45410258fb6df4deb5438377f4949b663b4f8ed754aea8a951a
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, parts):
return math.comb(n+parts-1,parts-1)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 2)', solve(*(3, 2)), 4)
check('fixture 2: (0, 3)', solve(*(0, 3)), 1)
check('fixture 3: (4, 3)', solve(*(4, 3)), 15)
check('fixture 4: (5, 1)', solve(*(5, 1)), 1)
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: (3, 2) | 4 | 4 | Passed |
| fixture 2: (0, 3) | 1 | 1 | Passed |
| fixture 3: (4, 3) | 15 | 15 | Passed |
| fixture 4: (5, 1) | 1 | 1 | Passed |
SHA-256 / e276dcdf81dfb63fa65f4037b0b53b42017143f07b05f022a60a7fa790130085
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.300948+00:00.
Case digest / db230d54a8cd0eeba52172ebe0db98a1a64d9b7ca40c772f51571531327db959