FAILURE MAP
← Case archive

FA-13371 / Numerical aggregation / Open access

Empirical distinct draw collision: All label frequencies are summed before squaring. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

All label frequencies are summed before squaring.

THE FAILURE

All label frequencies are summed before squaring.

Unsuccessful approach: Subtracting label count rather than observation count retains self-pairs.

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(counts.values())*(sum(counts.values())-1),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 111/3Failed
regression 210Failed
regression 3NoneNonePassed
regression 4NoneNonePassed
regression 511Passed
regression 614/15Failed
regression 711/3Failed
variable collision multiplicity10Failed

SHA-256 / 712eb75eca110cd9a1e7e4da52d1b7ff7093b2b1f40724cfd9839e881c9e2d8f

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(v*v for v in counts.values())-len(counts),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 / 9b7a41fd230fc124575bf51cee4aa22c657a641ff1b409edb73a0d800ff441bd

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 8 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

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

Case digest / 09d556cdb1f54225e6978136e50655ebed97d9a6c5f5e5e6f7dffd0ab8af4ceb