FA-65321 / Epidemic compartment models / Open access
Ross-Macdonald vector-borne R0: incubation survival · case 01
Survival through the extrinsic incubation period is almost zero for realistic parameters.
ROOT CAUSE
The daily death rate is treated as a lifespan in the exponent.
VERIFIED REPAIR
Restore the incubation survival rule: `math.exp(-mu * n_days)`.
Unsuccessful approach: The linearised survival 1-mu*n overstates survival and can truncate at zero.
Case contract
R0 = m*a^2*b*c*exp(-mu*n)/(r*mu) with biting rate a, transmission probabilities b and c, mosquito density ratio m, human recovery r, mosquito death rate mu and extrinsic incubation n days; return [R0, sqrt(R0) generational value, survival exp(-mu*n)] rounded 6; None if a, r or mu is not positive or m is negative.
Why this case matters
Compartmental epidemic calculations drive outbreak forecasts, vaccine targets and hospital planning; a single wrong flow, rate conversion or boundary silently changes every downstream number.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(a, b, c, m, r, mu, n_days):
if min(a, r, mu) <= 0 or m < 0:
return None
survive = math.exp(-n_days / mu)
r0 = m * a * a * b * c * survive / (r * mu)
return [round(r0, 6), round(math.sqrt(r0), 6), round(survive, 6)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: malaria-like', (0.3, 0.5, 0.5, 10, 0.01, 0.1, 10), [82.772874, 9.09796, 0.367879]),
('regression: dengue-like', (0.7, 0.4, 0.6, 2, 0.14, 0.12, 8), [5.3605, 2.315275, 0.382893]),
('regression: no mosquitoes', (0.3, 0.5, 0.5, 0, 0.01, 0.1, 10), [0.0, 0.0, 0.367879]),
('control: invalid mu', (0.3, 0.5, 0.5, 10, 0.01, 0.0, 10), None),
('control: zero incubation', (0.5, 0.3, 0.3, 5, 0.1, 0.2, 0), [5.625, 2.371708, 1.0]),
('regression: long lived mosquitoes',
(0.25, 0.6, 0.4, 20, 0.02, 0.05, 12),
[164.643491, 12.831348, 0.548812]),
('regression: low bite rate', (0.1, 0.9, 0.9, 50, 0.05, 0.15, 9), [13.998974, 3.74152, 0.25924])],
[('regression: malaria-like', (0.3, 0.5, 0.5, 10, 0.01, 0.1, 10), [82.772874, 9.09796, 0.367879]),
('regression: dengue-like', (0.7, 0.4, 0.6, 2, 0.14, 0.12, 8), [5.3605, 2.315275, 0.382893]),
('regression: no mosquitoes', (0.3, 0.5, 0.5, 0, 0.01, 0.1, 10), [0.0, 0.0, 0.367879]),
('control: invalid mu', (0.3, 0.5, 0.5, 10, 0.01, 0.0, 10), None),
('control: zero incubation', (0.5, 0.3, 0.3, 5, 0.1, 0.2, 0), [5.625, 2.371708, 1.0]),
('regression: long lived mosquitoes',
(0.25, 0.6, 0.4, 20, 0.02, 0.05, 12),
[164.643491, 12.831348, 0.548812]),
('regression: low bite rate', (0.1, 0.9, 0.9, 50, 0.05, 0.15, 9), [13.998974, 3.74152, 0.25924])],
[('regression: malaria-like', (0.3, 0.5, 0.5, 10, 0.01, 0.1, 10), [82.772874, 9.09796, 0.367879]),
('regression: dengue-like', (0.7, 0.4, 0.6, 2, 0.14, 0.12, 8), [5.3605, 2.315275, 0.382893]),
('regression: no mosquitoes', (0.3, 0.5, 0.5, 0, 0.01, 0.1, 10), [0.0, 0.0, 0.367879]),
('control: invalid mu', (0.3, 0.5, 0.5, 10, 0.01, 0.0, 10), None),
('control: zero incubation', (0.5, 0.3, 0.3, 5, 0.1, 0.2, 0), [5.625, 2.371708, 1.0]),
('regression: long lived mosquitoes',
(0.25, 0.6, 0.4, 20, 0.02, 0.05, 12),
[164.643491, 12.831348, 0.548812]),
('regression: low bite rate', (0.1, 0.9, 0.9, 50, 0.05, 0.15, 9), [13.998974, 3.74152, 0.25924])],
[('regression: malaria-like', (0.3, 0.5, 0.5, 10, 0.01, 0.1, 10), [82.772874, 9.09796, 0.367879]),
('regression: dengue-like', (0.7, 0.4, 0.6, 2, 0.14, 0.12, 8), [5.3605, 2.315275, 0.382893]),
('regression: no mosquitoes', (0.3, 0.5, 0.5, 0, 0.01, 0.1, 10), [0.0, 0.0, 0.367879]),
('control: invalid mu', (0.3, 0.5, 0.5, 10, 0.01, 0.0, 10), None),
('control: zero incubation', (0.5, 0.3, 0.3, 5, 0.1, 0.2, 0), [5.625, 2.371708, 1.0]),
('regression: long lived mosquitoes',
(0.25, 0.6, 0.4, 20, 0.02, 0.05, 12),
[164.643491, 12.831348, 0.548812]),
('regression: low bite rate', (0.1, 0.9, 0.9, 50, 0.05, 0.15, 9), [13.998974, 3.74152, 0.25924])],
[('regression: malaria-like', (0.3, 0.5, 0.5, 10, 0.01, 0.1, 10), [82.772874, 9.09796, 0.367879]),
('regression: dengue-like', (0.7, 0.4, 0.6, 2, 0.14, 0.12, 8), [5.3605, 2.315275, 0.382893]),
('regression: no mosquitoes', (0.3, 0.5, 0.5, 0, 0.01, 0.1, 10), [0.0, 0.0, 0.367879]),
('control: invalid mu', (0.3, 0.5, 0.5, 10, 0.01, 0.0, 10), None),
('control: zero incubation', (0.5, 0.3, 0.3, 5, 0.1, 0.2, 0), [5.625, 2.371708, 1.0]),
('regression: long lived mosquitoes',
(0.25, 0.6, 0.4, 20, 0.02, 0.05, 12),
[164.643491, 12.831348, 0.548812]),
('regression: low bite rate', (0.1, 0.9, 0.9, 50, 0.05, 0.15, 9), [13.998974, 3.74152, 0.25924])]]
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 |
|---|---|---|---|
| regression: malaria-like | [0.0, 0.0, 0.0] | [82.772874, 9.09796, 0.367879] | Failed |
| regression: dengue-like | [0.0, 0.0, 0.0] | [5.3605, 2.315275, 0.382893] | Failed |
| regression: no mosquitoes | [0.0, 0.0, 0.0] | [0.0, 0.0, 0.367879] | Failed |
| control: invalid mu | None | None | Passed |
| control: zero incubation | [5.625, 2.371708, 1.0] | [5.625, 2.371708, 1.0] | Passed |
| regression: long lived mosquitoes | [0.0, 0.0, 0.0] | [164.643491, 12.831348, 0.548812] | Failed |
| regression: low bite rate | [0.0, 0.0, 0.0] | [13.998974, 3.74152, 0.25924] | Failed |
SHA-256 / dddb6dca81a5b417e312a4aaa684483e0f89e620b32e74ac29837f7985558e02
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(a, b, c, m, r, mu, n_days):
if min(a, r, mu) <= 0 or m < 0:
return None
survive = max(0.0, 1 - mu * n_days)
r0 = m * a * a * b * c * survive / (r * mu)
return [round(r0, 6), round(math.sqrt(r0), 6), round(survive, 6)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: malaria-like', (0.3, 0.5, 0.5, 10, 0.01, 0.1, 10), [82.772874, 9.09796, 0.367879]),
('regression: dengue-like', (0.7, 0.4, 0.6, 2, 0.14, 0.12, 8), [5.3605, 2.315275, 0.382893]),
('regression: no mosquitoes', (0.3, 0.5, 0.5, 0, 0.01, 0.1, 10), [0.0, 0.0, 0.367879]),
('control: invalid mu', (0.3, 0.5, 0.5, 10, 0.01, 0.0, 10), None),
('control: zero incubation', (0.5, 0.3, 0.3, 5, 0.1, 0.2, 0), [5.625, 2.371708, 1.0]),
('regression: long lived mosquitoes',
(0.25, 0.6, 0.4, 20, 0.02, 0.05, 12),
[164.643491, 12.831348, 0.548812]),
('regression: low bite rate', (0.1, 0.9, 0.9, 50, 0.05, 0.15, 9), [13.998974, 3.74152, 0.25924])],
[('regression: malaria-like', (0.3, 0.5, 0.5, 10, 0.01, 0.1, 10), [82.772874, 9.09796, 0.367879]),
('regression: dengue-like', (0.7, 0.4, 0.6, 2, 0.14, 0.12, 8), [5.3605, 2.315275, 0.382893]),
('regression: no mosquitoes', (0.3, 0.5, 0.5, 0, 0.01, 0.1, 10), [0.0, 0.0, 0.367879]),
('control: invalid mu', (0.3, 0.5, 0.5, 10, 0.01, 0.0, 10), None),
('control: zero incubation', (0.5, 0.3, 0.3, 5, 0.1, 0.2, 0), [5.625, 2.371708, 1.0]),
('regression: long lived mosquitoes',
(0.25, 0.6, 0.4, 20, 0.02, 0.05, 12),
[164.643491, 12.831348, 0.548812]),
('regression: low bite rate', (0.1, 0.9, 0.9, 50, 0.05, 0.15, 9), [13.998974, 3.74152, 0.25924])],
[('regression: malaria-like', (0.3, 0.5, 0.5, 10, 0.01, 0.1, 10), [82.772874, 9.09796, 0.367879]),
('regression: dengue-like', (0.7, 0.4, 0.6, 2, 0.14, 0.12, 8), [5.3605, 2.315275, 0.382893]),
('regression: no mosquitoes', (0.3, 0.5, 0.5, 0, 0.01, 0.1, 10), [0.0, 0.0, 0.367879]),
('control: invalid mu', (0.3, 0.5, 0.5, 10, 0.01, 0.0, 10), None),
('control: zero incubation', (0.5, 0.3, 0.3, 5, 0.1, 0.2, 0), [5.625, 2.371708, 1.0]),
('regression: long lived mosquitoes',
(0.25, 0.6, 0.4, 20, 0.02, 0.05, 12),
[164.643491, 12.831348, 0.548812]),
('regression: low bite rate', (0.1, 0.9, 0.9, 50, 0.05, 0.15, 9), [13.998974, 3.74152, 0.25924])],
[('regression: malaria-like', (0.3, 0.5, 0.5, 10, 0.01, 0.1, 10), [82.772874, 9.09796, 0.367879]),
('regression: dengue-like', (0.7, 0.4, 0.6, 2, 0.14, 0.12, 8), [5.3605, 2.315275, 0.382893]),
('regression: no mosquitoes', (0.3, 0.5, 0.5, 0, 0.01, 0.1, 10), [0.0, 0.0, 0.367879]),
('control: invalid mu', (0.3, 0.5, 0.5, 10, 0.01, 0.0, 10), None),
('control: zero incubation', (0.5, 0.3, 0.3, 5, 0.1, 0.2, 0), [5.625, 2.371708, 1.0]),
('regression: long lived mosquitoes',
(0.25, 0.6, 0.4, 20, 0.02, 0.05, 12),
[164.643491, 12.831348, 0.548812]),
('regression: low bite rate', (0.1, 0.9, 0.9, 50, 0.05, 0.15, 9), [13.998974, 3.74152, 0.25924])],
[('regression: malaria-like', (0.3, 0.5, 0.5, 10, 0.01, 0.1, 10), [82.772874, 9.09796, 0.367879]),
('regression: dengue-like', (0.7, 0.4, 0.6, 2, 0.14, 0.12, 8), [5.3605, 2.315275, 0.382893]),
('regression: no mosquitoes', (0.3, 0.5, 0.5, 0, 0.01, 0.1, 10), [0.0, 0.0, 0.367879]),
('control: invalid mu', (0.3, 0.5, 0.5, 10, 0.01, 0.0, 10), None),
('control: zero incubation', (0.5, 0.3, 0.3, 5, 0.1, 0.2, 0), [5.625, 2.371708, 1.0]),
('regression: long lived mosquitoes',
(0.25, 0.6, 0.4, 20, 0.02, 0.05, 12),
[164.643491, 12.831348, 0.548812]),
('regression: low bite rate', (0.1, 0.9, 0.9, 50, 0.05, 0.15, 9), [13.998974, 3.74152, 0.25924])]]
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 |
|---|---|---|---|
| regression: malaria-like | [0.0, 0.0, 0.0] | [82.772874, 9.09796, 0.367879] | Failed |
| regression: dengue-like | [0.56, 0.748331, 0.04] | [5.3605, 2.315275, 0.382893] | Failed |
| regression: no mosquitoes | [0.0, 0.0, 0.0] | [0.0, 0.0, 0.367879] | Failed |
| control: invalid mu | None | None | Passed |
| control: zero incubation | [5.625, 2.371708, 1.0] | [5.625, 2.371708, 1.0] | Passed |
| regression: long lived mosquitoes | [120.0, 10.954451, 0.4] | [164.643491, 12.831348, 0.548812] | Failed |
| regression: low bite rate | [0.0, 0.0, 0.0] | [13.998974, 3.74152, 0.25924] | Failed |
SHA-256 / 506513a14bbba8479f0f85f5414bdc301af4de94f57905c52188675bce0120e5
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(a, b, c, m, r, mu, n_days):
if min(a, r, mu) <= 0 or m < 0:
return None
survive = math.exp(-mu * n_days)
r0 = m * a * a * b * c * survive / (r * mu)
return [round(r0, 6), round(math.sqrt(r0), 6), round(survive, 6)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: malaria-like', (0.3, 0.5, 0.5, 10, 0.01, 0.1, 10), [82.772874, 9.09796, 0.367879]),
('regression: dengue-like', (0.7, 0.4, 0.6, 2, 0.14, 0.12, 8), [5.3605, 2.315275, 0.382893]),
('regression: no mosquitoes', (0.3, 0.5, 0.5, 0, 0.01, 0.1, 10), [0.0, 0.0, 0.367879]),
('control: invalid mu', (0.3, 0.5, 0.5, 10, 0.01, 0.0, 10), None),
('control: zero incubation', (0.5, 0.3, 0.3, 5, 0.1, 0.2, 0), [5.625, 2.371708, 1.0]),
('regression: long lived mosquitoes',
(0.25, 0.6, 0.4, 20, 0.02, 0.05, 12),
[164.643491, 12.831348, 0.548812]),
('regression: low bite rate', (0.1, 0.9, 0.9, 50, 0.05, 0.15, 9), [13.998974, 3.74152, 0.25924])],
[('regression: malaria-like', (0.3, 0.5, 0.5, 10, 0.01, 0.1, 10), [82.772874, 9.09796, 0.367879]),
('regression: dengue-like', (0.7, 0.4, 0.6, 2, 0.14, 0.12, 8), [5.3605, 2.315275, 0.382893]),
('regression: no mosquitoes', (0.3, 0.5, 0.5, 0, 0.01, 0.1, 10), [0.0, 0.0, 0.367879]),
('control: invalid mu', (0.3, 0.5, 0.5, 10, 0.01, 0.0, 10), None),
('control: zero incubation', (0.5, 0.3, 0.3, 5, 0.1, 0.2, 0), [5.625, 2.371708, 1.0]),
('regression: long lived mosquitoes',
(0.25, 0.6, 0.4, 20, 0.02, 0.05, 12),
[164.643491, 12.831348, 0.548812]),
('regression: low bite rate', (0.1, 0.9, 0.9, 50, 0.05, 0.15, 9), [13.998974, 3.74152, 0.25924])],
[('regression: malaria-like', (0.3, 0.5, 0.5, 10, 0.01, 0.1, 10), [82.772874, 9.09796, 0.367879]),
('regression: dengue-like', (0.7, 0.4, 0.6, 2, 0.14, 0.12, 8), [5.3605, 2.315275, 0.382893]),
('regression: no mosquitoes', (0.3, 0.5, 0.5, 0, 0.01, 0.1, 10), [0.0, 0.0, 0.367879]),
('control: invalid mu', (0.3, 0.5, 0.5, 10, 0.01, 0.0, 10), None),
('control: zero incubation', (0.5, 0.3, 0.3, 5, 0.1, 0.2, 0), [5.625, 2.371708, 1.0]),
('regression: long lived mosquitoes',
(0.25, 0.6, 0.4, 20, 0.02, 0.05, 12),
[164.643491, 12.831348, 0.548812]),
('regression: low bite rate', (0.1, 0.9, 0.9, 50, 0.05, 0.15, 9), [13.998974, 3.74152, 0.25924])],
[('regression: malaria-like', (0.3, 0.5, 0.5, 10, 0.01, 0.1, 10), [82.772874, 9.09796, 0.367879]),
('regression: dengue-like', (0.7, 0.4, 0.6, 2, 0.14, 0.12, 8), [5.3605, 2.315275, 0.382893]),
('regression: no mosquitoes', (0.3, 0.5, 0.5, 0, 0.01, 0.1, 10), [0.0, 0.0, 0.367879]),
('control: invalid mu', (0.3, 0.5, 0.5, 10, 0.01, 0.0, 10), None),
('control: zero incubation', (0.5, 0.3, 0.3, 5, 0.1, 0.2, 0), [5.625, 2.371708, 1.0]),
('regression: long lived mosquitoes',
(0.25, 0.6, 0.4, 20, 0.02, 0.05, 12),
[164.643491, 12.831348, 0.548812]),
('regression: low bite rate', (0.1, 0.9, 0.9, 50, 0.05, 0.15, 9), [13.998974, 3.74152, 0.25924])],
[('regression: malaria-like', (0.3, 0.5, 0.5, 10, 0.01, 0.1, 10), [82.772874, 9.09796, 0.367879]),
('regression: dengue-like', (0.7, 0.4, 0.6, 2, 0.14, 0.12, 8), [5.3605, 2.315275, 0.382893]),
('regression: no mosquitoes', (0.3, 0.5, 0.5, 0, 0.01, 0.1, 10), [0.0, 0.0, 0.367879]),
('control: invalid mu', (0.3, 0.5, 0.5, 10, 0.01, 0.0, 10), None),
('control: zero incubation', (0.5, 0.3, 0.3, 5, 0.1, 0.2, 0), [5.625, 2.371708, 1.0]),
('regression: long lived mosquitoes',
(0.25, 0.6, 0.4, 20, 0.02, 0.05, 12),
[164.643491, 12.831348, 0.548812]),
('regression: low bite rate', (0.1, 0.9, 0.9, 50, 0.05, 0.15, 9), [13.998974, 3.74152, 0.25924])]]
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 |
|---|---|---|---|
| regression: malaria-like | [82.772874, 9.09796, 0.367879] | [82.772874, 9.09796, 0.367879] | Passed |
| regression: dengue-like | [5.3605, 2.315275, 0.382893] | [5.3605, 2.315275, 0.382893] | Passed |
| regression: no mosquitoes | [0.0, 0.0, 0.367879] | [0.0, 0.0, 0.367879] | Passed |
| control: invalid mu | None | None | Passed |
| control: zero incubation | [5.625, 2.371708, 1.0] | [5.625, 2.371708, 1.0] | Passed |
| regression: long lived mosquitoes | [164.643491, 12.831348, 0.548812] | [164.643491, 12.831348, 0.548812] | Passed |
| regression: low bite rate | [13.998974, 3.74152, 0.25924] | [13.998974, 3.74152, 0.25924] | Passed |
SHA-256 / df1e9d2b285f80467a21574e535f7d9db54db2a0bc601425256ea2a8194d0d5e
Verification & scope
Deterministic bounded teaching model with a stipulated contract; not a validated scientific or public-health modelling library. 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:32.735416+00:00.
Case digest / 24474069d6c6df69f6d8f2c3ccb24f2faec17ed7a7aa865271ca385d2f2bbf54