FAILURE MAP
← Case archive

FA-13331 / Numerical aggregation / Open access

Frequency symmetric trim mean: An exhausted trim is reported as a measured zero mean. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

An exhausted trim is reported as a measured zero mean.

THE FAILURE

An exhausted trim is reported as a measured zero mean.

Unsuccessful approach: A textual fraction with zero denominator is not the no-observation sentinel.

Case contract

Expand nonnegative integer frequencies. Remove exactly k lowest and k highest observations by multiplicity. Return the exact mean as a Fraction string, or None when no observations survive.

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(rows, k):
    xs=sorted(x for x,w in rows for _ in range(w))
    if not xs or 2*k>=len(xs): return "0"
    return str(Fraction(sum(xs[k:len(xs)-k]),len(xs)-2*k))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(9, 1), (1, 4), (5, 2)], 2)), '7/3')
check('regression 2', solve(*([(2, 4)], 1)), '2')
check('regression 3', solve(*([], 0)), None)
check('regression 4', solve(*([(1, 2), (4, 2)], 2)), None)
check('regression 5', solve(*([(0, 1), (10, 3), (-5, 2)], 1)), '15/4')
check('regression 6', solve(*([(3, 0), (8, 1)], 0)), '8')
check('regression 7', solve(*([(1, 1), (8, 4), (9, 1)], 1)), '8')
check("variable weighted trim",solve([(N,3),(N+6,2)],1),str(Fraction(3*N+6,3)))
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 17/37/3Passed
regression 222Passed
regression 30NoneFailed
regression 40NoneFailed
regression 515/415/4Passed
regression 688Passed
regression 788Passed
variable weighted trim33Passed

SHA-256 / b0348bc0456e085a37f267e6569a6873d2000fb02047b11e1c3d2c5c844c7d16

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(rows, k):
    xs=sorted(x for x,w in rows for _ in range(w))
    if not xs or 2*k>=len(xs): return "0/0"
    return str(Fraction(sum(xs[k:len(xs)-k]),len(xs)-2*k))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(9, 1), (1, 4), (5, 2)], 2)), '7/3')
check('regression 2', solve(*([(2, 4)], 1)), '2')
check('regression 3', solve(*([], 0)), None)
check('regression 4', solve(*([(1, 2), (4, 2)], 2)), None)
check('regression 5', solve(*([(0, 1), (10, 3), (-5, 2)], 1)), '15/4')
check('regression 6', solve(*([(3, 0), (8, 1)], 0)), '8')
check('regression 7', solve(*([(1, 1), (8, 4), (9, 1)], 1)), '8')
check("variable weighted trim",solve([(N,3),(N+6,2)],1),str(Fraction(3*N+6,3)))
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 17/37/3Passed
regression 222Passed
regression 30/0NoneFailed
regression 40/0NoneFailed
regression 515/415/4Passed
regression 688Passed
regression 788Passed
variable weighted trim33Passed

SHA-256 / 7617ad18548325b249b110f604c790388133cebe3b3564e35af4f3865ac6a8ed

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

Case digest / 1f1930188a0783f0e557ad42659be9a536ddac23086433daab6cb8eaf4b8cce7