FA-6306 / Statistics / Open access
Survival function strict · case 01
Including equal observations mismatches the strict survival convention.
ROOT CAUSE
Including equal observations mismatches the strict survival convention.
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: The lower tail is selected instead of the upper tail.
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. Survival function strict. 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)), '1/3')
check('fixture 2: ([1, 2, 3], 0)', solve(*([1, 2, 3], 0)), '1')
check('fixture 3: ([1, 2, 3], 3)', solve(*([1, 2, 3], 3)), '0')
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1: ([1, 1, 2], 1) | 1 | 1/3 | Failed |
| fixture 2: ([1, 2, 3], 0) | 1 | 1 | Passed |
| fixture 3: ([1, 2, 3], 3) | 1/3 | 0 | Failed |
| fixture 4: ([], 2) | None | None | Passed |
SHA-256 / cf20b8ef7dc1cfe1e0808bef9b22e99a4cadac6f7147bcddf98b0837e008c562
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 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)), '1/3')
check('fixture 2: ([1, 2, 3], 0)', solve(*([1, 2, 3], 0)), '1')
check('fixture 3: ([1, 2, 3], 3)', solve(*([1, 2, 3], 3)), '0')
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1: ([1, 1, 2], 1) | 0 | 1/3 | Failed |
| fixture 2: ([1, 2, 3], 0) | 0 | 1 | Failed |
| fixture 3: ([1, 2, 3], 3) | 2/3 | 0 | Failed |
| fixture 4: ([], 2) | None | None | Passed |
SHA-256 / 156e52d95682230fef2cc0905d91898a1c5ae259580fad2b5d8ea15ed44bb988
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)), '1/3')
check('fixture 2: ([1, 2, 3], 0)', solve(*([1, 2, 3], 0)), '1')
check('fixture 3: ([1, 2, 3], 3)', solve(*([1, 2, 3], 3)), '0')
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1: ([1, 1, 2], 1) | 1/3 | 1/3 | Passed |
| fixture 2: ([1, 2, 3], 0) | 1 | 1 | Passed |
| fixture 3: ([1, 2, 3], 3) | 0 | 0 | Passed |
| fixture 4: ([], 2) | None | None | Passed |
SHA-256 / b7656237f589fa26d3ad8b77f0c8ea9366d1b59305de73a99c7477df115907fe
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.989149+00:00.
Case digest / 4507303bdf0281e513112341f3055b499e5bdbed2deab4d839867ec17c8f3f75