FAILURE MAP
← Case archive

FA-13341 / Numerical aggregation / Open access

Empirical distinct draw collision: The collision numerator includes drawing an observation with itself. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

The collision numerator includes drawing an observation with itself.

VERIFIED REPAIR

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

Unsuccessful approach: Subtracting one self-pair per label fails to remove one per observation.

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 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 15/61/3Failed
regression 21/20Failed
regression 3NoneNonePassed
regression 4NoneNonePassed
regression 54/31Failed
regression 67/154/15Failed
regression 72/31/3Failed
variable collision multiplicity10Failed

SHA-256 / d9559a0b36c7e001071a1837565d1a74c182842a7a3ff45b5cce2ed104979417

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(sum(max(0,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/21/3Failed
regression 200Passed
regression 3NoneNonePassed
regression 4NoneNonePassed
regression 55/41Failed
regression 611/304/15Failed
regression 71/21/3Failed
variable collision multiplicity00Passed

SHA-256 / 9a5cd71114095d59af32b779b91105b88eadd70214529453896916ab75bf634f

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

Case digest / 19215920582b8d5f9118e23933810d68fb2ad59cba50775c1c81d36e26de61e6