FAILURE MAP
← Case archive

FA-5621 / Combinatorics / Open access

Unordered pair count · case 01

Self pairs and symmetric copies are included.

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

ROOT CAUSE

Self pairs and symmetric copies are included.

THE FAILURE

Self pairs and symmetric copies are included.

Unsuccessful approach: Removing self pairs still keeps both orders.

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. Unordered pair count. Exact operational definition: n*(n-1)//2

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):
    return n*n
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (1,)', solve(*(1,)), 0)
check('fixture 3: (2,)', solve(*(2,)), 1)
check('fixture 4: (5,)', solve(*(5,)), 10)
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: (0,)00Passed
fixture 2: (1,)10Failed
fixture 3: (2,)41Failed
fixture 4: (5,)2510Failed

SHA-256 / 14d42d4218050332654c1bbff8ce3aca5cd73e9ac39d5a0994f3af6d529cb21d

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):
    return n*(n-1)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0,)', solve(*(0,)), 0)
check('fixture 2: (1,)', solve(*(1,)), 0)
check('fixture 3: (2,)', solve(*(2,)), 1)
check('fixture 4: (5,)', solve(*(5,)), 10)
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: (0,)00Passed
fixture 2: (1,)00Passed
fixture 3: (2,)21Failed
fixture 4: (5,)2010Failed

SHA-256 / 26d64b5b95d9ad439a8bdf6778d48697522f4e899b6984220a12c640409a09c1

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 4 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / adc0a977b09df25460047da51795d07bbedd3883f3190e503e3099ea9b8eae02