FAILURE MAP
← Case archive

FA-6301 / Statistics / Open access

Empirical cdf inclusive · case 01

Strict comparison excludes atoms at the query point.

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

ROOT CAUSE

Strict comparison excludes atoms at the query point.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return str(Fraction(sum(v<=x for v in values),len(values))) if values else None

Unsuccessful approach: Deduplication discards empirical probability mass.

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. Empirical cdf inclusive. Exact operational definition: str(Fraction(sum(v<=x for v in values),len(values))) if values 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, x):
    return str(Fraction(sum(v<x for v in values),len(values))) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 1, 2], 1)', solve(*([1, 1, 2], 1)), '2/3')
check('fixture 2: ([1, 2, 3], 0)', solve(*([1, 2, 3], 0)), '0')
check('fixture 3: ([1, 2, 3], 3)', solve(*([1, 2, 3], 3)), '1')
check('fixture 4: ([], 2)', solve(*([], 2)), None)
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: ([1, 1, 2], 1)02/3Failed
fixture 2: ([1, 2, 3], 0)00Passed
fixture 3: ([1, 2, 3], 3)2/31Failed
fixture 4: ([], 2)NoneNonePassed

SHA-256 / bc15e466ca3b605505c6f20312b3651f26cf204a71ceb6aaa3152aec98fb5384

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, x):
    return str(Fraction(sum(v<=x for v in set(values)),len(set(values)))) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 1, 2], 1)', solve(*([1, 1, 2], 1)), '2/3')
check('fixture 2: ([1, 2, 3], 0)', solve(*([1, 2, 3], 0)), '0')
check('fixture 3: ([1, 2, 3], 3)', solve(*([1, 2, 3], 3)), '1')
check('fixture 4: ([], 2)', solve(*([], 2)), None)
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: ([1, 1, 2], 1)1/22/3Failed
fixture 2: ([1, 2, 3], 0)00Passed
fixture 3: ([1, 2, 3], 3)11Passed
fixture 4: ([], 2)NoneNonePassed

SHA-256 / 0effa8255f27676675d8b4c1ab33452082616d61ae824e61fff0959346cbad6c

3 / The verified repair

Exit 0
"""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, x):
    return str(Fraction(sum(v<=x for v in values),len(values))) if values else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 1, 2], 1)', solve(*([1, 1, 2], 1)), '2/3')
check('fixture 2: ([1, 2, 3], 0)', solve(*([1, 2, 3], 0)), '0')
check('fixture 3: ([1, 2, 3], 3)', solve(*([1, 2, 3], 3)), '1')
check('fixture 4: ([], 2)', solve(*([], 2)), None)
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: ([1, 1, 2], 1)2/32/3Passed
fixture 2: ([1, 2, 3], 0)00Passed
fixture 3: ([1, 2, 3], 3)11Passed
fixture 4: ([], 2)NoneNonePassed

SHA-256 / 850e13f6019049fe773aabd1692cc490d8b77b12eab3087b5478184d6dbb7d4c

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

Case digest / b32866b9d903fe169d23f3cd20f4e4a0fbeb072beacf78d6d6215696a15712aa