FAILURE MAP
← Case archive

FA-5651 / Combinatorics / Open access

Lattice monotone path count · case 01

The path count is confused with grid area.

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

ROOT CAUSE

The path count is confused with grid area.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return math.comb(right+down,right)

Unsuccessful approach: Identical steps are treated as distinguishable permutations.

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. Lattice monotone path count. Exact operational definition: math.comb(right+down,right)

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(right, down):
    return right*down
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3)', solve(*(2, 3)), 10)
check('fixture 2: (0, 4)', solve(*(0, 4)), 1)
check('fixture 3: (0, 0)', solve(*(0, 0)), 1)
check('fixture 4: (3, 3)', solve(*(3, 3)), 20)
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
fixture 1: (2, 3)610Failed
fixture 2: (0, 4)01Failed
fixture 3: (0, 0)01Failed
fixture 4: (3, 3)920Failed

SHA-256 / 5138fa3757b29e81882d520b48c216adef528d2503a1b89a0fb7c5a74454a780

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(right, down):
    return math.factorial(right+down)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3)', solve(*(2, 3)), 10)
check('fixture 2: (0, 4)', solve(*(0, 4)), 1)
check('fixture 3: (0, 0)', solve(*(0, 0)), 1)
check('fixture 4: (3, 3)', solve(*(3, 3)), 20)
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
fixture 1: (2, 3)12010Failed
fixture 2: (0, 4)241Failed
fixture 3: (0, 0)11Passed
fixture 4: (3, 3)72020Failed

SHA-256 / 89d4a54bc73276574df0391e379b8994dfa6cf1c73b3164043c598737b8dca9f

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(right, down):
    return math.comb(right+down,right)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (2, 3)', solve(*(2, 3)), 10)
check('fixture 2: (0, 4)', solve(*(0, 4)), 1)
check('fixture 3: (0, 0)', solve(*(0, 0)), 1)
check('fixture 4: (3, 3)', solve(*(3, 3)), 20)
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
fixture 1: (2, 3)1010Passed
fixture 2: (0, 4)11Passed
fixture 3: (0, 0)11Passed
fixture 4: (3, 3)2020Passed

SHA-256 / 131fc19df89d4b47b3768faa0d7b64e04219c773654773e18e7f5ac385333266

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:51.864885+00:00.

Case digest / 44adde683e1906e0d32f5bc1f8b491abf0fbe6319987a23c599c778a7d74af03