FAILURE MAP
← Case archive

FA-5711 / Combinatorics / Open access

Tournament round robin games · case 01

Each game is counted from both participating teams.

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

ROOT CAUSE

Each game is counted from both participating teams.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return math.comb(teams,2)*meetings

Unsuccessful approach: Repeated meetings multiply the schedule rather than add a constant.

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. Tournament round robin games. Exact operational definition: math.comb(teams,2)*meetings

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(teams, meetings):
    return teams*(teams-1)*meetings
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 2)', solve(*(4, 2)), 12)
check('fixture 2: (1, 2)', solve(*(1, 2)), 0)
check('fixture 3: (3, 1)', solve(*(3, 1)), 3)
check('fixture 4: (5, 0)', solve(*(5, 0)), 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 fixtureActualExpectedOutcome
fixture 1: (4, 2)2412Failed
fixture 2: (1, 2)00Passed
fixture 3: (3, 1)63Failed
fixture 4: (5, 0)00Passed

SHA-256 / 6267a6e5f2d3ba02fe023b2113bf15fbda8f32f27e9f63353e4899e45219140e

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(teams, meetings):
    return math.comb(teams,2)+meetings
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 2)', solve(*(4, 2)), 12)
check('fixture 2: (1, 2)', solve(*(1, 2)), 0)
check('fixture 3: (3, 1)', solve(*(3, 1)), 3)
check('fixture 4: (5, 0)', solve(*(5, 0)), 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 fixtureActualExpectedOutcome
fixture 1: (4, 2)812Failed
fixture 2: (1, 2)20Failed
fixture 3: (3, 1)43Failed
fixture 4: (5, 0)100Failed

SHA-256 / 3596a723b6ece8cf232b300d0e00e01b23a61e5a11f81abc67894d6d63514806

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(teams, meetings):
    return math.comb(teams,2)*meetings
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (4, 2)', solve(*(4, 2)), 12)
check('fixture 2: (1, 2)', solve(*(1, 2)), 0)
check('fixture 3: (3, 1)', solve(*(3, 1)), 3)
check('fixture 4: (5, 0)', solve(*(5, 0)), 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 fixtureActualExpectedOutcome
fixture 1: (4, 2)1212Passed
fixture 2: (1, 2)00Passed
fixture 3: (3, 1)33Passed
fixture 4: (5, 0)00Passed

SHA-256 / d3a74312943d0aec35f80ee4c70eac45a40ee847900efd749fabfe036c252c73

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

Case digest / 6c0f8a8ff74cbb5bdc4ef7077407c0d288a92cc2c5f342f97ae85e9404f4a509