FA-13311 / Numerical aggregation / Open access
Frequency symmetric trim mean: Both removed tails are taken from the lower end. · case 01
The reduction disagrees with its explicit aggregation oracle.
ROOT CAUSE
Both removed tails are taken from the lower end.
VERIFIED REPAIR
Preserve the frequency symmetric trim mean contract at the identified reduction decision.
Unsuccessful approach: Removing both tails from the upper end also biases the retained population.
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 None
return str(Fraction(sum(xs[2*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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | 19/3 | 7/3 | Failed |
| regression 2 | 2 | 2 | Passed |
| regression 3 | None | None | Passed |
| regression 4 | None | None | Passed |
| regression 5 | 15/2 | 15/4 | Failed |
| regression 6 | 8 | 8 | Passed |
| regression 7 | 33/4 | 8 | Failed |
| variable weighted trim | 5 | 3 | Failed |
SHA-256 / 325198f4bcbd885a0626b6516ce379217314b07b45214011fdc02540dc2ced0c
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 None
return str(Fraction(sum(xs[:len(xs)-2*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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | 1 | 7/3 | Failed |
| regression 2 | 2 | 2 | Passed |
| regression 3 | None | None | Passed |
| regression 4 | None | None | Passed |
| regression 5 | 0 | 15/4 | Failed |
| regression 6 | 8 | 8 | Passed |
| regression 7 | 25/4 | 8 | Failed |
| variable weighted trim | 1 | 3 | Failed |
SHA-256 / d25b64c4412d073cbff91cb4cf16a6c1b36b723fd38bc68a49400f6e9a4edf15
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(rows, k):
xs=sorted(x for x,w in rows for _ in range(w))
if not xs or 2*k>=len(xs): return None
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | 7/3 | 7/3 | Passed |
| regression 2 | 2 | 2 | Passed |
| regression 3 | None | None | Passed |
| regression 4 | None | None | Passed |
| regression 5 | 15/4 | 15/4 | Passed |
| regression 6 | 8 | 8 | Passed |
| regression 7 | 8 | 8 | Passed |
| variable weighted trim | 3 | 3 | Passed |
SHA-256 / 9ee402af70a2f625a20c7f5ad40164924bd05deaf5e177e5b46ad614402e637d
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:05.780724+00:00.
Case digest / 28de7cb4dcfb3d1ca3b0093b28d1fad3b88a2b32ad8c41c376f7157624fab2bd