FA-6231 / Statistics / Open access
Winsorized sample · case 01
Trimming removes observations instead of replacing extreme values.
ROOT CAUSE
Trimming removes observations instead of replacing extreme values.
THE FAILURE
Trimming removes observations instead of replacing extreme values.
Unsuccessful approach: Only the lower clipping bound is applied.
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. 0<=2*k<len(values); replace extremes by kth and (n-k-1)th sorted observations, preserving input order and length. Exact operational definition: [max(sorted(values)[k],min(sorted(values)[-k-1],v)) for v in values]
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 sorted(values)[k:len(values)-k]
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)), [4, 2, 2, 3, 4])
check('fixture 2: ([1, 2, 3], 0)', solve(*([1, 2, 3], 0)), [1, 2, 3])
check('fixture 3: ([5, 5, 5], 1)', solve(*([5, 5, 5], 1)), [5, 5, 5])
check('fixture 4: ([0, 10, 20, 30, 40], 1)', solve(*([0, 10, 20, 30, 40], 1)), [10, 10, 20, 30, 30])
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 |
|---|---|---|---|
| fixture 1: ([100, 1, 2, 3, 4], 1) | [2, 3, 4] | [4, 2, 2, 3, 4] | Failed |
| fixture 2: ([1, 2, 3], 0) | [1, 2, 3] | [1, 2, 3] | Passed |
| fixture 3: ([5, 5, 5], 1) | [5] | [5, 5, 5] | Failed |
| fixture 4: ([0, 10, 20, 30, 40], 1) | [10, 20, 30] | [10, 10, 20, 30, 30] | Failed |
SHA-256 / 76833e0a10142b557ddbbbe0e45d30157a430fa901e0775b091b1808e60170ee
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 [max(sorted(values)[k],v) for v in values]
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)), [4, 2, 2, 3, 4])
check('fixture 2: ([1, 2, 3], 0)', solve(*([1, 2, 3], 0)), [1, 2, 3])
check('fixture 3: ([5, 5, 5], 1)', solve(*([5, 5, 5], 1)), [5, 5, 5])
check('fixture 4: ([0, 10, 20, 30, 40], 1)', solve(*([0, 10, 20, 30, 40], 1)), [10, 10, 20, 30, 30])
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 |
|---|---|---|---|
| fixture 1: ([100, 1, 2, 3, 4], 1) | [100, 2, 2, 3, 4] | [4, 2, 2, 3, 4] | Failed |
| fixture 2: ([1, 2, 3], 0) | [1, 2, 3] | [1, 2, 3] | Passed |
| fixture 3: ([5, 5, 5], 1) | [5, 5, 5] | [5, 5, 5] | Passed |
| fixture 4: ([0, 10, 20, 30, 40], 1) | [10, 10, 20, 30, 40] | [10, 10, 20, 30, 30] | Failed |
SHA-256 / cccaf87d0de9e6f32b255f5b734b11534ef67d3c249b3766c0657ccffe99bd5c
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.065713+00:00.
Case digest / b9208d7a9388a2c043c81af07639e8450d1eb9a0d162963fb35dd140c746bc2a