FA-046 / Numerics / Open access
Missing measurements bias a mean · case 01
Absent measurements change the mean even though no observation was recorded.
ROOT CAUSE
Missing records remain in the denominator after being removed from the numerator.
VERIFIED REPAIR
Use the same set of present observations for both numerator and denominator.
Unsuccessful approach: Filtering by truthiness also removes legitimate zero measurements.
Case contract
Use the same set of present observations for both numerator and denominator.
Why this case matters
A compact reasoning and repair task with executable evidence.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(values):
return sum(x for x in values if x is not None) / len(values) if values else None
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing and zero', solve([None, 0, 2*N]), N)
check('all missing', solve([None, None]), None)
check('no measurements', solve([]), 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 |
|---|---|---|---|
| missing and zero | 0.6666666666666666 | 1 | Failed |
| all missing | 0.0 | None | Failed |
| no measurements | None | None | Passed |
SHA-256 / 7b773fcc45d5dfc955d7eb3c972a6d5de0acea4f65662967122e78159d745a54
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(values):
present = [x for x in values if x]
return sum(present) / len(present) if present else None
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing and zero', solve([None, 0, 2*N]), N)
check('all missing', solve([None, None]), None)
check('no measurements', solve([]), 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 |
|---|---|---|---|
| missing and zero | 2.0 | 1 | Failed |
| all missing | None | None | Passed |
| no measurements | None | None | Passed |
SHA-256 / 5bfd2a3c39f9291f46c18c614f157a9cbe2bd86d2036795f7f8cf2c702acbe3f
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(values):
present = [x for x in values if x is not None]
return sum(present) / len(present) if present else None
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing and zero', solve([None, 0, 2*N]), N)
check('all missing', solve([None, None]), None)
check('no measurements', solve([]), 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 |
|---|---|---|---|
| missing and zero | 1.0 | 1 | Passed |
| all missing | None | None | Passed |
| no measurements | None | None | Passed |
SHA-256 / 3b984da2099f96b65e1eddc34cf92cc07bd3c909635a51246b1207c1d9c8f06f
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:36:49.880640+00:00.
Case digest / 8a8e014b55285512649397e413207249f25999ca4f64072cebf460212fbb3c71