FAILURE MAP
← Case archive

FA-6226 / Statistics / Open access

Trimmed mean drop each tail · case 01

Trimming arrival order does not remove the extremes.

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

ROOT CAUSE

Trimming arrival order does not remove the extremes.

THE FAILURE

Trimming arrival order does not remove the extremes.

Unsuccessful approach: Only the lower tail is trimmed.

Case contract

Integer finite observations and equal lengths for paired samples. Counts and weights are nonnegative. Rational results use reduced Fraction strings. Empty or undefined statistics return None where shown. k>=0; sort and remove exactly k values from each tail, returning None if no values remain. Exact operational definition: str(Fraction(sum(sorted(values)[k:len(values)-k]),len(values)-2*k)) if len(values)>2*k else None

Why this case matters

Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Statistical estimators results depend on the stated convention.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(values, k):
    return str(Fraction(sum(values[k:len(values)-k]),len(values)-2*k)) if len(values)>2*k else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([100, 1, 2, 3, 4], 1)', solve(*([100, 1, 2, 3, 4], 1)), '3')
check('fixture 2: ([1, 2, 3], 0)', solve(*([1, 2, 3], 0)), '2')
check('fixture 3: ([1, 2], 1)', solve(*([1, 2], 1)), None)
check('fixture 4: ([5, 5, 5, 5], 1)', solve(*([5, 5, 5, 5], 1)), '5')
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
fixture 1: ([100, 1, 2, 3, 4], 1)23Failed
fixture 2: ([1, 2, 3], 0)22Passed
fixture 3: ([1, 2], 1)NoneNonePassed
fixture 4: ([5, 5, 5, 5], 1)55Passed

SHA-256 / 25cb287b5ffd7f7c0c4ff4b26b3444d370cd084533ced25bae52a1a7d4f06583

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(values, k):
    return str(Fraction(sum(sorted(values)[k:]),len(values)-k)) if len(values)>k else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([100, 1, 2, 3, 4], 1)', solve(*([100, 1, 2, 3, 4], 1)), '3')
check('fixture 2: ([1, 2, 3], 0)', solve(*([1, 2, 3], 0)), '2')
check('fixture 3: ([1, 2], 1)', solve(*([1, 2], 1)), None)
check('fixture 4: ([5, 5, 5, 5], 1)', solve(*([5, 5, 5, 5], 1)), '5')
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
fixture 1: ([100, 1, 2, 3, 4], 1)109/43Failed
fixture 2: ([1, 2, 3], 0)22Passed
fixture 3: ([1, 2], 1)2NoneFailed
fixture 4: ([5, 5, 5, 5], 1)55Passed

SHA-256 / 1a30dd809fa742bb29e66499488911583e2a9130ce537bf2bf8a418a72e446db

HELD IN THE MEMBER ARCHIVE

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

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

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

Case digest / ef4bb3060fc67dc950a66623f8fb96edd3838ee3d7c389ede4c317ad3c06aa65