FA-5716 / Combinatorics / Open access
Full binary tree leaf identity · case 01
Outgoing child links are confused with leaves.
ROOT CAUSE
Outgoing child links are confused with leaves.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return internal+1
Unsuccessful approach: Total node count is confused with leaf count.
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. Every internal vertex has exactly two children; return the leaf count from the nonnegative internal-vertex count. Exact operational definition: internal+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(internal):
return 2*internal
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,)), 4)
check('fixture 4: (7,)', solve(*(7,)), 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,) | 0 | 1 | Failed |
| fixture 2: (1,) | 2 | 2 | Passed |
| fixture 3: (3,) | 6 | 4 | Failed |
| fixture 4: (7,) | 14 | 8 | Failed |
SHA-256 / af6aa280238e6ff569c54882e7b7228a8b1942e958d7327da8fe21c178a2c39f
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(internal):
return 2*internal+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,)), 4)
check('fixture 4: (7,)', solve(*(7,)), 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,) | 3 | 2 | Failed |
| fixture 3: (3,) | 7 | 4 | Failed |
| fixture 4: (7,) | 15 | 8 | Failed |
SHA-256 / c80b6d7ed1c188dfaf71c30133d9e443887018239794e96ed4512deb191bdd01
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(internal):
return internal+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,)), 4)
check('fixture 4: (7,)', solve(*(7,)), 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,) | 4 | 4 | Passed |
| fixture 4: (7,) | 8 | 8 | Passed |
SHA-256 / f872bc74d508563f4ead7264029b9537343045124382df41ce13a082271a2d58
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.777799+00:00.
Case digest / 3dbdfd8762d5615440a4872faa3f00307449ddbec552d83a11e11934a6855617