FA-5691 / Combinatorics / Open access
Exact heads coin count · case 01
Outcomes with other head counts are included.
ROOT CAUSE
Outcomes with other head counts are included.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return math.comb(n,heads)
Unsuccessful approach: Multiplying counts does not select head positions.
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. Exact heads coin count. Exact operational definition: math.comb(n,heads)
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, heads):
return 2**n
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 2)', solve(*(4, 2)), 6)
check('fixture 2: (3, 0)', solve(*(3, 0)), 1)
check('fixture 3: (3, 3)', solve(*(3, 3)), 1)
check('fixture 4: (2, 3)', solve(*(2, 3)), 0)
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: (4, 2) | 16 | 6 | Failed |
| fixture 2: (3, 0) | 8 | 1 | Failed |
| fixture 3: (3, 3) | 8 | 1 | Failed |
| fixture 4: (2, 3) | 4 | 0 | Failed |
SHA-256 / 2bb0887d5fe8832d4f82c91042bad05f3d49360bf25cbca744523d95da987be2
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, heads):
return n*heads
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 2)', solve(*(4, 2)), 6)
check('fixture 2: (3, 0)', solve(*(3, 0)), 1)
check('fixture 3: (3, 3)', solve(*(3, 3)), 1)
check('fixture 4: (2, 3)', solve(*(2, 3)), 0)
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: (4, 2) | 8 | 6 | Failed |
| fixture 2: (3, 0) | 0 | 1 | Failed |
| fixture 3: (3, 3) | 9 | 1 | Failed |
| fixture 4: (2, 3) | 6 | 0 | Failed |
SHA-256 / e15d1a913c6ef6ea94281e024c27281622f6f66a79ea907edb661282ecc9fd32
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, heads):
return math.comb(n,heads)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 2)', solve(*(4, 2)), 6)
check('fixture 2: (3, 0)', solve(*(3, 0)), 1)
check('fixture 3: (3, 3)', solve(*(3, 3)), 1)
check('fixture 4: (2, 3)', solve(*(2, 3)), 0)
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: (4, 2) | 6 | 6 | Passed |
| fixture 2: (3, 0) | 1 | 1 | Passed |
| fixture 3: (3, 3) | 1 | 1 | Passed |
| fixture 4: (2, 3) | 0 | 0 | Passed |
SHA-256 / 9ff9d2a8daa17eb864452e413ff785a5d652f92d890c722de75d391cd4fcaab3
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.656795+00:00.
Case digest / f8f3feb8558c618c162363927fdebbcf83dee3f1fce9fed33609a5d775e496a4