FA-6346 / Statistics / Open access
Probability union with overlap · case 01
The overlapping event mass is counted twice.
ROOT CAUSE
The overlapping event mass is counted twice.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return str(Fraction(a)+Fraction(b)-Fraction(overlap))
Unsuccessful approach: Independence is assumed despite an explicit overlap probability.
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. a,b,overlap are rational strings for valid probabilities with max(0,a+b-1)<=overlap<=min(a,b); do not assume independence. Exact operational definition: str(Fraction(a)+Fraction(b)-Fraction(overlap))
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(a, b, overlap):
return str(Fraction(a)+Fraction(b))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check("fixture 1: ('1/2', '1/2', '1/4')", solve(*('1/2', '1/2', '1/4')), '3/4')
check("fixture 2: ('1/2', '1/2', '1/2')", solve(*('1/2', '1/2', '1/2')), '1/2')
check("fixture 3: ('0', '1/3', '0')", solve(*('0', '1/3', '0')), '1/3')
check("fixture 4: ('1/3', '1/3', '0')", solve(*('1/3', '1/3', '0')), '2/3')
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/2', '1/2', '1/4') | 1 | 3/4 | Failed |
| fixture 2: ('1/2', '1/2', '1/2') | 1 | 1/2 | Failed |
| fixture 3: ('0', '1/3', '0') | 1/3 | 1/3 | Passed |
| fixture 4: ('1/3', '1/3', '0') | 2/3 | 2/3 | Passed |
SHA-256 / 159265645540e075ebbbf7d357c8f46d13fb0ee3e244399bf4ff26ef49f8b47c
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(a, b, overlap):
return str(Fraction(a)+Fraction(b)-Fraction(a)*Fraction(b))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check("fixture 1: ('1/2', '1/2', '1/4')", solve(*('1/2', '1/2', '1/4')), '3/4')
check("fixture 2: ('1/2', '1/2', '1/2')", solve(*('1/2', '1/2', '1/2')), '1/2')
check("fixture 3: ('0', '1/3', '0')", solve(*('0', '1/3', '0')), '1/3')
check("fixture 4: ('1/3', '1/3', '0')", solve(*('1/3', '1/3', '0')), '2/3')
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/2', '1/2', '1/4') | 3/4 | 3/4 | Passed |
| fixture 2: ('1/2', '1/2', '1/2') | 3/4 | 1/2 | Failed |
| fixture 3: ('0', '1/3', '0') | 1/3 | 1/3 | Passed |
| fixture 4: ('1/3', '1/3', '0') | 5/9 | 2/3 | Failed |
SHA-256 / 4469b751b8bd570c92b675511d169b4b846657b5c858ec84572eee1d0bd97745
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(a, b, overlap):
return str(Fraction(a)+Fraction(b)-Fraction(overlap))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check("fixture 1: ('1/2', '1/2', '1/4')", solve(*('1/2', '1/2', '1/4')), '3/4')
check("fixture 2: ('1/2', '1/2', '1/2')", solve(*('1/2', '1/2', '1/2')), '1/2')
check("fixture 3: ('0', '1/3', '0')", solve(*('0', '1/3', '0')), '1/3')
check("fixture 4: ('1/3', '1/3', '0')", solve(*('1/3', '1/3', '0')), '2/3')
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/2', '1/2', '1/4') | 3/4 | 3/4 | Passed |
| fixture 2: ('1/2', '1/2', '1/2') | 1/2 | 1/2 | Passed |
| fixture 3: ('0', '1/3', '0') | 1/3 | 1/3 | Passed |
| fixture 4: ('1/3', '1/3', '0') | 2/3 | 2/3 | Passed |
SHA-256 / 4d209902992a5e3544817eebb8e6d7bf9e46883351394c7034cdd745cc3e05ab
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:38:00.596790+00:00.
Case digest / 16c87ce3368dfe42d0dbf2a1b0a02cff07297a2e34d32cb0cbd8083339b3a06d