FA-63621 / Actuarial life tables / Open access
Exposure to risk by age band: Actuarial exposure is truncated at the study end · case 01
Deaths near the end of the study get too little exposure.
ROOT CAUSE
The extension stops at the study end.
VERIFIED REPAIR
Extend counted deaths to the end of the age band.
Unsuccessful approach: Extending to the study end is also wrong for deaths early in the band.
Case contract
Input study [s, e) days, age a, method exact|actuarial, records [[birth, entry, exit, died]] with 365-day years. Age band [birth+365a, +365). Observation [max(s,entry,band start), min(e,exit,band end)); a death at exit counts if lo<=exit<min(e, band end). Actuarial exposure extends a counted death to the band end. Return [total exposure days, deaths].
Why this case matters
Life-table arithmetic compounds across ages, so one misplaced index or assumption shifts every downstream value.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(x):
s,e=x['study']; a=x['age']; tot=0; deaths=0
for b,en,ex,died in x['records']:
bs=b+365*a; be=bs+365
lo=max(s,en,bs); hi=min(e,ex,be)
counted=died and lo<=ex<min(e,be)
if counted: deaths+=1
if x['method']=='actuarial' and counted: hi=min(e,be)
tot+=max(0,hi-lo)
return [tot,deaths]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['exact mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1646, 20187, 20406, False], [-1852, 20095, 20577, False], [-1617, 20154, 20514, False], [-1795, 19880, 20864, False], [-2031, 19846, 20364, True]], 'method': 'exact'}, [1300, 0]], ['exact death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1795, 20149, 20843, False]], 'method': 'exact'}, [686, 0]], ['exact late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'exact'}, [50, 1]], ['exact death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'exact'}, [230, 0]], ['exact death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'exact'}, [0, 0]], ['actuarial mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1640, 19886, 20758, False], [-2010, 20199, 20626, False], [-2086, 19856, 20816, False], [-2011, 20172, 20892, False], [-1704, 19877, 20272, True]], 'method': 'actuarial'}, [1047, 1]], ['actuarial death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1976, 19813, 20729, False]], 'method': 'actuarial'}, [654, 0]], ['actuarial late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'actuarial'}, [215, 1]], ['actuarial death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'actuarial'}, [230, 0]], ['actuarial death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'actuarial'}, [0, 0]], ['exact survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1717, 19878, 20681, False], [-1678, 20196, 20770, False], [-2186, 20016, 20415, False]], 'method': 'exact'}, [793, 0]], ['actuarial survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-2064, 19900, 20737, False], [-2068, 19900, 20448, False], [-2155, 19900, 20867, False]], 'method': 'actuarial'}, [508, 0]], ['death on first observed day', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20150, 20150, True]], 'method': 'exact'}, [0, 1]], ['death near study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1270, 20000, 20727, True]], 'method': 'actuarial'}, [365, 1]]], [['exact mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-2070, 19840, 20456, False], [-1999, 20154, 20680, False], [-2193, 19855, 20494, False], [-2156, 19996, 20689, False], [-1701, 20077, 20310, True]], 'method': 'exact'}, [599, 1]], ['exact death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1711, 19808, 20863, False]], 'method': 'exact'}, [730, 0]], ['exact late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'exact'}, [50, 1]], ['exact death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'exact'}, [230, 0]], ['exact death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'exact'}, [0, 0]], ['actuarial mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1665, 19831, 20488, False], [-1673, 19955, 20442, False], [-1850, 20050, 20697, False], [-2078, 19804, 20804, False], [-1601, 20194, 20313, True]], 'method': 'actuarial'}, [1385, 1]], ['actuarial death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1605, 19948, 20570, False]], 'method': 'actuarial'}, [640, 0]], ['actuarial late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'actuarial'}, [215, 1]], ['actuarial death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'actuarial'}, [230, 0]], ['actuarial death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'actuarial'}, [0, 0]], ['exact survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1889, 19936, 20521, False], [-1640, 20120, 20507, False], [-1778, 20160, 20852, False]], 'method': 'exact'}, [939, 0]], ['actuarial survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1890, 19900, 20544, False], [-1719, 19900, 20802, False], [-2117, 19900, 20531, False]], 'method': 'actuarial'}, [878, 0]], ['death on first observed day', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20150, 20150, True]], 'method': 'exact'}, [0, 1]], ['death near study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1270, 20000, 20727, True]], 'method': 'actuarial'}, [365, 1]]], [['exact mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1741, 20077, 20701, False], [-1769, 20197, 20455, False], [-2071, 19974, 20741, False], [-1918, 19823, 20436, False], [-2098, 20169, 20358, True]], 'method': 'exact'}, [1164, 0]], ['exact death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1954, 20112, 20568, False]], 'method': 'exact'}, [564, 0]], ['exact late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'exact'}, [50, 1]], ['exact death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'exact'}, [230, 0]], ['exact death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'exact'}, [0, 0]], ['actuarial mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1887, 19974, 20561, False], [-2071, 20133, 20760, False], [-1820, 20134, 20483, False], [-1975, 20119, 20850, False], [-1795, 20071, 20207, True]], 'method': 'actuarial'}, [1273, 1]], ['actuarial death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-2147, 19920, 20609, False]], 'method': 'actuarial'}, [483, 0]], ['actuarial late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'actuarial'}, [215, 1]], ['actuarial death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'actuarial'}, [230, 0]], ['actuarial death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'actuarial'}, [0, 0]], ['exact survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1894, 20110, 20820, False], [-1682, 19889, 20808, False], [-2155, 19896, 20593, False]], 'method': 'exact'}, [736, 0]], ['actuarial survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-2018, 19900, 20548, False], [-1644, 19900, 20877, False], [-2200, 19900, 20475, False]], 'method': 'actuarial'}, [677, 0]], ['death on first observed day', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20150, 20150, True]], 'method': 'exact'}, [0, 1]], ['death near study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1270, 20000, 20727, True]], 'method': 'actuarial'}, [365, 1]]], [['exact mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1863, 20066, 20531, False], [-2075, 19963, 20495, False], [-1993, 19890, 20763, False], [-1827, 19962, 20674, False], [-2180, 20079, 20226, True]], 'method': 'exact'}, [1169, 0]], ['exact death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1679, 20195, 20683, False]], 'method': 'exact'}, [730, 0]], ['exact late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'exact'}, [50, 1]], ['exact death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'exact'}, [230, 0]], ['exact death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'exact'}, [0, 0]], ['actuarial mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-2025, 19978, 20453, False], [-2178, 19958, 20450, False], [-2000, 19923, 20448, False], [-2144, 19842, 20894, False], [-2062, 19838, 20339, True]], 'method': 'actuarial'}, [916, 0]], ['actuarial death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1658, 20133, 20633, False]], 'method': 'actuarial'}, [730, 0]], ['actuarial late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'actuarial'}, [215, 1]], ['actuarial death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'actuarial'}, [230, 0]], ['actuarial death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'actuarial'}, [0, 0]], ['exact survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-2119, 19951, 20507, False], [-1690, 20001, 20675, False], [-1814, 19802, 20650, False]], 'method': 'exact'}, [876, 0]], ['actuarial survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1893, 19900, 20703, False], [-2022, 19900, 20661, False], [-1898, 19900, 20856, False]], 'method': 'actuarial'}, [973, 0]], ['death on first observed day', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20150, 20150, True]], 'method': 'exact'}, [0, 1]], ['death near study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1270, 20000, 20727, True]], 'method': 'actuarial'}, [365, 1]]], [['exact mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1825, 20155, 20608, False], [-1632, 20145, 20432, False], [-1827, 20020, 20829, False], [-2080, 19871, 20894, False], [-2071, 20138, 20394, True]], 'method': 'exact'}, [1055, 0]], ['exact death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1652, 20173, 20716, False]], 'method': 'exact'}, [730, 0]], ['exact late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'exact'}, [50, 1]], ['exact death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'exact'}, [230, 0]], ['exact death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'exact'}, [0, 0]], ['actuarial mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-2038, 19972, 20521, False], [-1836, 19923, 20435, False], [-2081, 20049, 20457, False], [-1816, 19815, 20798, False], [-1964, 19855, 20159, True]], 'method': 'actuarial'}, [1393, 1]], ['actuarial death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1744, 19944, 20873, False]], 'method': 'actuarial'}, [730, 0]], ['actuarial late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'actuarial'}, [215, 1]], ['actuarial death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'actuarial'}, [230, 0]], ['actuarial death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'actuarial'}, [0, 0]], ['exact survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1879, 19856, 20519, False], [-1807, 19835, 20774, False], [-2006, 19972, 20562, False]], 'method': 'exact'}, [989, 0]], ['actuarial survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1878, 19900, 20430, False], [-2072, 19900, 20760, False], [-1895, 19900, 20822, False]], 'method': 'actuarial'}, [923, 0]], ['death on first observed day', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20150, 20150, True]], 'method': 'exact'}, [0, 1]], ['death near study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1270, 20000, 20727, True]], 'method': 'actuarial'}, [365, 1]]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(args), expected)
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 |
|---|---|---|---|
| exact mixed cohort | [1300, 0] | [1300, 0] | Passed |
| exact death on next birthday | [686, 0] | [686, 0] | Passed |
| exact late entrant death | [50, 1] | [50, 1] | Passed |
| exact death after study end | [230, 0] | [230, 0] | Passed |
| exact death before age band | [0, 0] | [0, 0] | Passed |
| actuarial mixed cohort | [1047, 1] | [1047, 1] | Passed |
| actuarial death on next birthday | [654, 0] | [654, 0] | Passed |
| actuarial late entrant death | [215, 1] | [215, 1] | Passed |
| actuarial death after study end | [230, 0] | [230, 0] | Passed |
| actuarial death before age band | [0, 0] | [0, 0] | Passed |
| exact survivors only | [793, 0] | [793, 0] | Passed |
| actuarial survivors only | [508, 0] | [508, 0] | Passed |
| death on first observed day | [0, 1] | [0, 1] | Passed |
| death near study end | [100, 1] | [365, 1] | Failed |
SHA-256 / d58fc28e8ef754672457d0e1e278a06a9a67b3d4ca1629b631a31d886234b74d
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(x):
s,e=x['study']; a=x['age']; tot=0; deaths=0
for b,en,ex,died in x['records']:
bs=b+365*a; be=bs+365
lo=max(s,en,bs); hi=min(e,ex,be)
counted=died and lo<=ex<min(e,be)
if counted: deaths+=1
if x['method']=='actuarial' and counted: hi=e
tot+=max(0,hi-lo)
return [tot,deaths]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['exact mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1646, 20187, 20406, False], [-1852, 20095, 20577, False], [-1617, 20154, 20514, False], [-1795, 19880, 20864, False], [-2031, 19846, 20364, True]], 'method': 'exact'}, [1300, 0]], ['exact death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1795, 20149, 20843, False]], 'method': 'exact'}, [686, 0]], ['exact late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'exact'}, [50, 1]], ['exact death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'exact'}, [230, 0]], ['exact death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'exact'}, [0, 0]], ['actuarial mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1640, 19886, 20758, False], [-2010, 20199, 20626, False], [-2086, 19856, 20816, False], [-2011, 20172, 20892, False], [-1704, 19877, 20272, True]], 'method': 'actuarial'}, [1047, 1]], ['actuarial death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1976, 19813, 20729, False]], 'method': 'actuarial'}, [654, 0]], ['actuarial late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'actuarial'}, [215, 1]], ['actuarial death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'actuarial'}, [230, 0]], ['actuarial death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'actuarial'}, [0, 0]], ['exact survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1717, 19878, 20681, False], [-1678, 20196, 20770, False], [-2186, 20016, 20415, False]], 'method': 'exact'}, [793, 0]], ['actuarial survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-2064, 19900, 20737, False], [-2068, 19900, 20448, False], [-2155, 19900, 20867, False]], 'method': 'actuarial'}, [508, 0]], ['death on first observed day', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20150, 20150, True]], 'method': 'exact'}, [0, 1]], ['death near study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1270, 20000, 20727, True]], 'method': 'actuarial'}, [365, 1]]], [['exact mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-2070, 19840, 20456, False], [-1999, 20154, 20680, False], [-2193, 19855, 20494, False], [-2156, 19996, 20689, False], [-1701, 20077, 20310, True]], 'method': 'exact'}, [599, 1]], ['exact death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1711, 19808, 20863, False]], 'method': 'exact'}, [730, 0]], ['exact late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'exact'}, [50, 1]], ['exact death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'exact'}, [230, 0]], ['exact death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'exact'}, [0, 0]], ['actuarial mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1665, 19831, 20488, False], [-1673, 19955, 20442, False], [-1850, 20050, 20697, False], [-2078, 19804, 20804, False], [-1601, 20194, 20313, True]], 'method': 'actuarial'}, [1385, 1]], ['actuarial death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1605, 19948, 20570, False]], 'method': 'actuarial'}, [640, 0]], ['actuarial late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'actuarial'}, [215, 1]], ['actuarial death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'actuarial'}, [230, 0]], ['actuarial death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'actuarial'}, [0, 0]], ['exact survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1889, 19936, 20521, False], [-1640, 20120, 20507, False], [-1778, 20160, 20852, False]], 'method': 'exact'}, [939, 0]], ['actuarial survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1890, 19900, 20544, False], [-1719, 19900, 20802, False], [-2117, 19900, 20531, False]], 'method': 'actuarial'}, [878, 0]], ['death on first observed day', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20150, 20150, True]], 'method': 'exact'}, [0, 1]], ['death near study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1270, 20000, 20727, True]], 'method': 'actuarial'}, [365, 1]]], [['exact mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1741, 20077, 20701, False], [-1769, 20197, 20455, False], [-2071, 19974, 20741, False], [-1918, 19823, 20436, False], [-2098, 20169, 20358, True]], 'method': 'exact'}, [1164, 0]], ['exact death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1954, 20112, 20568, False]], 'method': 'exact'}, [564, 0]], ['exact late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'exact'}, [50, 1]], ['exact death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'exact'}, [230, 0]], ['exact death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'exact'}, [0, 0]], ['actuarial mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1887, 19974, 20561, False], [-2071, 20133, 20760, False], [-1820, 20134, 20483, False], [-1975, 20119, 20850, False], [-1795, 20071, 20207, True]], 'method': 'actuarial'}, [1273, 1]], ['actuarial death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-2147, 19920, 20609, False]], 'method': 'actuarial'}, [483, 0]], ['actuarial late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'actuarial'}, [215, 1]], ['actuarial death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'actuarial'}, [230, 0]], ['actuarial death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'actuarial'}, [0, 0]], ['exact survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1894, 20110, 20820, False], [-1682, 19889, 20808, False], [-2155, 19896, 20593, False]], 'method': 'exact'}, [736, 0]], ['actuarial survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-2018, 19900, 20548, False], [-1644, 19900, 20877, False], [-2200, 19900, 20475, False]], 'method': 'actuarial'}, [677, 0]], ['death on first observed day', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20150, 20150, True]], 'method': 'exact'}, [0, 1]], ['death near study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1270, 20000, 20727, True]], 'method': 'actuarial'}, [365, 1]]], [['exact mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1863, 20066, 20531, False], [-2075, 19963, 20495, False], [-1993, 19890, 20763, False], [-1827, 19962, 20674, False], [-2180, 20079, 20226, True]], 'method': 'exact'}, [1169, 0]], ['exact death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1679, 20195, 20683, False]], 'method': 'exact'}, [730, 0]], ['exact late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'exact'}, [50, 1]], ['exact death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'exact'}, [230, 0]], ['exact death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'exact'}, [0, 0]], ['actuarial mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-2025, 19978, 20453, False], [-2178, 19958, 20450, False], [-2000, 19923, 20448, False], [-2144, 19842, 20894, False], [-2062, 19838, 20339, True]], 'method': 'actuarial'}, [916, 0]], ['actuarial death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1658, 20133, 20633, False]], 'method': 'actuarial'}, [730, 0]], ['actuarial late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'actuarial'}, [215, 1]], ['actuarial death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'actuarial'}, [230, 0]], ['actuarial death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'actuarial'}, [0, 0]], ['exact survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-2119, 19951, 20507, False], [-1690, 20001, 20675, False], [-1814, 19802, 20650, False]], 'method': 'exact'}, [876, 0]], ['actuarial survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1893, 19900, 20703, False], [-2022, 19900, 20661, False], [-1898, 19900, 20856, False]], 'method': 'actuarial'}, [973, 0]], ['death on first observed day', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20150, 20150, True]], 'method': 'exact'}, [0, 1]], ['death near study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1270, 20000, 20727, True]], 'method': 'actuarial'}, [365, 1]]], [['exact mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1825, 20155, 20608, False], [-1632, 20145, 20432, False], [-1827, 20020, 20829, False], [-2080, 19871, 20894, False], [-2071, 20138, 20394, True]], 'method': 'exact'}, [1055, 0]], ['exact death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1652, 20173, 20716, False]], 'method': 'exact'}, [730, 0]], ['exact late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'exact'}, [50, 1]], ['exact death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'exact'}, [230, 0]], ['exact death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'exact'}, [0, 0]], ['actuarial mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-2038, 19972, 20521, False], [-1836, 19923, 20435, False], [-2081, 20049, 20457, False], [-1816, 19815, 20798, False], [-1964, 19855, 20159, True]], 'method': 'actuarial'}, [1393, 1]], ['actuarial death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1744, 19944, 20873, False]], 'method': 'actuarial'}, [730, 0]], ['actuarial late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'actuarial'}, [215, 1]], ['actuarial death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'actuarial'}, [230, 0]], ['actuarial death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'actuarial'}, [0, 0]], ['exact survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1879, 19856, 20519, False], [-1807, 19835, 20774, False], [-2006, 19972, 20562, False]], 'method': 'exact'}, [989, 0]], ['actuarial survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1878, 19900, 20430, False], [-2072, 19900, 20760, False], [-1895, 19900, 20822, False]], 'method': 'actuarial'}, [923, 0]], ['death on first observed day', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20150, 20150, True]], 'method': 'exact'}, [0, 1]], ['death near study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1270, 20000, 20727, True]], 'method': 'actuarial'}, [365, 1]]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(args), expected)
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 |
|---|---|---|---|
| exact mixed cohort | [1300, 0] | [1300, 0] | Passed |
| exact death on next birthday | [686, 0] | [686, 0] | Passed |
| exact late entrant death | [50, 1] | [50, 1] | Passed |
| exact death after study end | [230, 0] | [230, 0] | Passed |
| exact death before age band | [0, 0] | [0, 0] | Passed |
| actuarial mixed cohort | [1216, 1] | [1047, 1] | Failed |
| actuarial death on next birthday | [654, 0] | [654, 0] | Passed |
| actuarial late entrant death | [480, 1] | [215, 1] | Failed |
| actuarial death after study end | [230, 0] | [230, 0] | Passed |
| actuarial death before age band | [0, 0] | [0, 0] | Passed |
| exact survivors only | [793, 0] | [793, 0] | Passed |
| actuarial survivors only | [508, 0] | [508, 0] | Passed |
| death on first observed day | [0, 1] | [0, 1] | Passed |
| death near study end | [100, 1] | [365, 1] | Failed |
SHA-256 / 92de295f77a38c8725a93fb2b26b46e5b5960a7492dd641be819170fcc24c8bf
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(x):
s,e=x['study']; a=x['age']; tot=0; deaths=0
for b,en,ex,died in x['records']:
bs=b+365*a; be=bs+365
lo=max(s,en,bs); hi=min(e,ex,be)
counted=died and lo<=ex<min(e,be)
if counted: deaths+=1
if x['method']=='actuarial' and counted: hi=be
tot+=max(0,hi-lo)
return [tot,deaths]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['exact mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1646, 20187, 20406, False], [-1852, 20095, 20577, False], [-1617, 20154, 20514, False], [-1795, 19880, 20864, False], [-2031, 19846, 20364, True]], 'method': 'exact'}, [1300, 0]], ['exact death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1795, 20149, 20843, False]], 'method': 'exact'}, [686, 0]], ['exact late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'exact'}, [50, 1]], ['exact death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'exact'}, [230, 0]], ['exact death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'exact'}, [0, 0]], ['actuarial mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1640, 19886, 20758, False], [-2010, 20199, 20626, False], [-2086, 19856, 20816, False], [-2011, 20172, 20892, False], [-1704, 19877, 20272, True]], 'method': 'actuarial'}, [1047, 1]], ['actuarial death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1976, 19813, 20729, False]], 'method': 'actuarial'}, [654, 0]], ['actuarial late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'actuarial'}, [215, 1]], ['actuarial death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'actuarial'}, [230, 0]], ['actuarial death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'actuarial'}, [0, 0]], ['exact survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1717, 19878, 20681, False], [-1678, 20196, 20770, False], [-2186, 20016, 20415, False]], 'method': 'exact'}, [793, 0]], ['actuarial survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-2064, 19900, 20737, False], [-2068, 19900, 20448, False], [-2155, 19900, 20867, False]], 'method': 'actuarial'}, [508, 0]], ['death on first observed day', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20150, 20150, True]], 'method': 'exact'}, [0, 1]], ['death near study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1270, 20000, 20727, True]], 'method': 'actuarial'}, [365, 1]]], [['exact mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-2070, 19840, 20456, False], [-1999, 20154, 20680, False], [-2193, 19855, 20494, False], [-2156, 19996, 20689, False], [-1701, 20077, 20310, True]], 'method': 'exact'}, [599, 1]], ['exact death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1711, 19808, 20863, False]], 'method': 'exact'}, [730, 0]], ['exact late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'exact'}, [50, 1]], ['exact death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'exact'}, [230, 0]], ['exact death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'exact'}, [0, 0]], ['actuarial mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1665, 19831, 20488, False], [-1673, 19955, 20442, False], [-1850, 20050, 20697, False], [-2078, 19804, 20804, False], [-1601, 20194, 20313, True]], 'method': 'actuarial'}, [1385, 1]], ['actuarial death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1605, 19948, 20570, False]], 'method': 'actuarial'}, [640, 0]], ['actuarial late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'actuarial'}, [215, 1]], ['actuarial death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'actuarial'}, [230, 0]], ['actuarial death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'actuarial'}, [0, 0]], ['exact survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1889, 19936, 20521, False], [-1640, 20120, 20507, False], [-1778, 20160, 20852, False]], 'method': 'exact'}, [939, 0]], ['actuarial survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1890, 19900, 20544, False], [-1719, 19900, 20802, False], [-2117, 19900, 20531, False]], 'method': 'actuarial'}, [878, 0]], ['death on first observed day', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20150, 20150, True]], 'method': 'exact'}, [0, 1]], ['death near study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1270, 20000, 20727, True]], 'method': 'actuarial'}, [365, 1]]], [['exact mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1741, 20077, 20701, False], [-1769, 20197, 20455, False], [-2071, 19974, 20741, False], [-1918, 19823, 20436, False], [-2098, 20169, 20358, True]], 'method': 'exact'}, [1164, 0]], ['exact death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1954, 20112, 20568, False]], 'method': 'exact'}, [564, 0]], ['exact late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'exact'}, [50, 1]], ['exact death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'exact'}, [230, 0]], ['exact death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'exact'}, [0, 0]], ['actuarial mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1887, 19974, 20561, False], [-2071, 20133, 20760, False], [-1820, 20134, 20483, False], [-1975, 20119, 20850, False], [-1795, 20071, 20207, True]], 'method': 'actuarial'}, [1273, 1]], ['actuarial death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-2147, 19920, 20609, False]], 'method': 'actuarial'}, [483, 0]], ['actuarial late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'actuarial'}, [215, 1]], ['actuarial death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'actuarial'}, [230, 0]], ['actuarial death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'actuarial'}, [0, 0]], ['exact survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1894, 20110, 20820, False], [-1682, 19889, 20808, False], [-2155, 19896, 20593, False]], 'method': 'exact'}, [736, 0]], ['actuarial survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-2018, 19900, 20548, False], [-1644, 19900, 20877, False], [-2200, 19900, 20475, False]], 'method': 'actuarial'}, [677, 0]], ['death on first observed day', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20150, 20150, True]], 'method': 'exact'}, [0, 1]], ['death near study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1270, 20000, 20727, True]], 'method': 'actuarial'}, [365, 1]]], [['exact mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1863, 20066, 20531, False], [-2075, 19963, 20495, False], [-1993, 19890, 20763, False], [-1827, 19962, 20674, False], [-2180, 20079, 20226, True]], 'method': 'exact'}, [1169, 0]], ['exact death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1679, 20195, 20683, False]], 'method': 'exact'}, [730, 0]], ['exact late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'exact'}, [50, 1]], ['exact death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'exact'}, [230, 0]], ['exact death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'exact'}, [0, 0]], ['actuarial mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-2025, 19978, 20453, False], [-2178, 19958, 20450, False], [-2000, 19923, 20448, False], [-2144, 19842, 20894, False], [-2062, 19838, 20339, True]], 'method': 'actuarial'}, [916, 0]], ['actuarial death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1658, 20133, 20633, False]], 'method': 'actuarial'}, [730, 0]], ['actuarial late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'actuarial'}, [215, 1]], ['actuarial death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'actuarial'}, [230, 0]], ['actuarial death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'actuarial'}, [0, 0]], ['exact survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-2119, 19951, 20507, False], [-1690, 20001, 20675, False], [-1814, 19802, 20650, False]], 'method': 'exact'}, [876, 0]], ['actuarial survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1893, 19900, 20703, False], [-2022, 19900, 20661, False], [-1898, 19900, 20856, False]], 'method': 'actuarial'}, [973, 0]], ['death on first observed day', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20150, 20150, True]], 'method': 'exact'}, [0, 1]], ['death near study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1270, 20000, 20727, True]], 'method': 'actuarial'}, [365, 1]]], [['exact mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-1825, 20155, 20608, False], [-1632, 20145, 20432, False], [-1827, 20020, 20829, False], [-2080, 19871, 20894, False], [-2071, 20138, 20394, True]], 'method': 'exact'}, [1055, 0]], ['exact death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1652, 20173, 20716, False]], 'method': 'exact'}, [730, 0]], ['exact late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'exact'}, [50, 1]], ['exact death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'exact'}, [230, 0]], ['exact death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'exact'}, [0, 0]], ['actuarial mixed cohort', {'study': [20000, 20730], 'age': 60, 'records': [[-2038, 19972, 20521, False], [-1836, 19923, 20435, False], [-2081, 20049, 20457, False], [-1816, 19815, 20798, False], [-1964, 19855, 20159, True]], 'method': 'actuarial'}, [1393, 1]], ['actuarial death on next birthday', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20000, 20465, True], [-1744, 19944, 20873, False]], 'method': 'actuarial'}, [730, 0]], ['actuarial late entrant death', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20250, 20300, True]], 'method': 'actuarial'}, [215, 1]], ['actuarial death after study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1400, 20100, 20750, True]], 'method': 'actuarial'}, [230, 0]], ['actuarial death before age band', {'study': [20000, 20730], 'age': 60, 'records': [[-1600, 20000, 20200, True]], 'method': 'actuarial'}, [0, 0]], ['exact survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1879, 19856, 20519, False], [-1807, 19835, 20774, False], [-2006, 19972, 20562, False]], 'method': 'exact'}, [989, 0]], ['actuarial survivors only', {'study': [20000, 20730], 'age': 60, 'records': [[-1878, 19900, 20430, False], [-2072, 19900, 20760, False], [-1895, 19900, 20822, False]], 'method': 'actuarial'}, [923, 0]], ['death on first observed day', {'study': [20000, 20730], 'age': 60, 'records': [[-1800, 20150, 20150, True]], 'method': 'exact'}, [0, 1]], ['death near study end', {'study': [20000, 20730], 'age': 60, 'records': [[-1270, 20000, 20727, True]], 'method': 'actuarial'}, [365, 1]]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(args), expected)
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 |
|---|---|---|---|
| exact mixed cohort | [1300, 0] | [1300, 0] | Passed |
| exact death on next birthday | [686, 0] | [686, 0] | Passed |
| exact late entrant death | [50, 1] | [50, 1] | Passed |
| exact death after study end | [230, 0] | [230, 0] | Passed |
| exact death before age band | [0, 0] | [0, 0] | Passed |
| actuarial mixed cohort | [1047, 1] | [1047, 1] | Passed |
| actuarial death on next birthday | [654, 0] | [654, 0] | Passed |
| actuarial late entrant death | [215, 1] | [215, 1] | Passed |
| actuarial death after study end | [230, 0] | [230, 0] | Passed |
| actuarial death before age band | [0, 0] | [0, 0] | Passed |
| exact survivors only | [793, 0] | [793, 0] | Passed |
| actuarial survivors only | [508, 0] | [508, 0] | Passed |
| death on first observed day | [0, 1] | [0, 1] | Passed |
| death near study end | [365, 1] | [365, 1] | Passed |
SHA-256 / 4de2a0691a1340a03069fdf6197b9ce05f4c3b4fde377b0e37fa51255ae3ad00
Verification & scope
A deterministic bounded teaching model of a stipulated toy actuarial contract. Rates are small synthetic tables, exact rationals are used where practical and floats are rounded at the output; it makes no claim of conformance with any published table, standard of practice or regulation. 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:47:16.225050+00:00.
Case digest / 0a97249f2f1d37c057ad9be70f8061e347a90bd9de56e7b00de449c76900fb7b