FAILURE MAP
← Case archive

FA-13356 / Numerical aggregation / Open access

Empirical distinct draw collision: Only the numerator is converted to unordered pairs. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

Only the numerator is converted to unordered pairs.

VERIFIED REPAIR

Preserve the empirical distinct draw collision contract at the identified reduction decision.

Unsuccessful approach: Doubling the ordered numerator creates the opposite normalization error.

Case contract

Return probability that two distinct uniformly chosen observation indices carry equal integer labels, as an exact Fraction string. Fewer than two observations returns None. Labels themselves are nominal; repeated indices are excluded.

Why this case matters

Exact bounded examples isolate a reduction defect without floating-point or external-service effects.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
from collections import Counter, defaultdict
import math
import itertools
N = 1
observations = []
def solve(xs):
    counts=Counter(xs)
    n=len(xs)
    if n<2: return None
    return str(Fraction(sum(v*(v-1)//2 for v in counts.values()),n*(n-1)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2],)), '1/3')
check('regression 2', solve(*([1, 2, 3],)), '0')
check('regression 3', solve(*([],)), None)
check('regression 4', solve(*([9],)), None)
check('regression 5', solve(*([2, 2, 2, 2],)), '1')
check('regression 6', solve(*([0, 0, 1, 1, 1, 2],)), '4/15')
check('regression 7', solve(*([-1, -1, 0, 0],)), '1/3')
check("variable collision multiplicity",solve([0]*N+[1]),str(Fraction(N*(N-1),(N+1)*N)))
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
regression 11/61/3Failed
regression 200Passed
regression 3NoneNonePassed
regression 4NoneNonePassed
regression 51/21Failed
regression 62/154/15Failed
regression 71/61/3Failed
variable collision multiplicity00Passed

SHA-256 / f512cd83653137d0fc9cf4f205e6dbeda7dc01f03caa614a54cf70a76c3f0c27

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
from collections import Counter, defaultdict
import math
import itertools
N = 1
observations = []
def solve(xs):
    counts=Counter(xs)
    n=len(xs)
    if n<2: return None
    return str(Fraction(2*sum(v*(v-1) for v in counts.values()),n*(n-1)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2],)), '1/3')
check('regression 2', solve(*([1, 2, 3],)), '0')
check('regression 3', solve(*([],)), None)
check('regression 4', solve(*([9],)), None)
check('regression 5', solve(*([2, 2, 2, 2],)), '1')
check('regression 6', solve(*([0, 0, 1, 1, 1, 2],)), '4/15')
check('regression 7', solve(*([-1, -1, 0, 0],)), '1/3')
check("variable collision multiplicity",solve([0]*N+[1]),str(Fraction(N*(N-1),(N+1)*N)))
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
regression 12/31/3Failed
regression 200Passed
regression 3NoneNonePassed
regression 4NoneNonePassed
regression 521Failed
regression 68/154/15Failed
regression 72/31/3Failed
variable collision multiplicity00Passed

SHA-256 / 01c5762b296f4297ab672311383f18b90865a6aedb2aa49b13163c896838fd64

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
from collections import Counter, defaultdict
import math
import itertools
N = 1
observations = []
def solve(xs):
    counts=Counter(xs)
    n=len(xs)
    if n<2: return None
    return str(Fraction(sum(v*(v-1) for v in counts.values()),n*(n-1)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2],)), '1/3')
check('regression 2', solve(*([1, 2, 3],)), '0')
check('regression 3', solve(*([],)), None)
check('regression 4', solve(*([9],)), None)
check('regression 5', solve(*([2, 2, 2, 2],)), '1')
check('regression 6', solve(*([0, 0, 1, 1, 1, 2],)), '4/15')
check('regression 7', solve(*([-1, -1, 0, 0],)), '1/3')
check("variable collision multiplicity",solve([0]*N+[1]),str(Fraction(N*(N-1),(N+1)*N)))
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
regression 11/31/3Passed
regression 200Passed
regression 3NoneNonePassed
regression 4NoneNonePassed
regression 511Passed
regression 64/154/15Passed
regression 71/31/3Passed
variable collision multiplicity00Passed

SHA-256 / 1a4fae3a590539025dd4b2a652d158dbbd99f79868cffa8a0ba14904108f78f5

Verification & scope

Small offline integer/rational inputs only; no performance, statistical inference, or production-library conformance claim. 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:39:06.057496+00:00.

Case digest / 744af57f8712debe60b9eed8de61715cbf77215de281ce63a33fbcb3a2cf09ae