FAILURE MAP
← Case archive

FA-65326 / Epidemic compartment models / Open access

Ross-Macdonald vector-borne R0: mosquito lifespan divisor · case 01

R0 ignores the infectious lifespan of the mosquito.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The 1/mu mosquito infectious lifespan factor is dropped.

VERIFIED REPAIR

Restore the mosquito lifespan divisor rule: `/ (r * mu)`.

Unsuccessful approach: Adding the rates combines the human and mosquito periods incorrectly.

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(-mu * n_days)
    r0 = m * a * a * b * c * survive / r
    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]),
  ('control: 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),
  ('regression: 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]),
  ('control: 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),
  ('regression: 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]),
  ('control: 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),
  ('regression: 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]),
  ('control: 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),
  ('regression: 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]),
  ('control: 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),
  ('regression: 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 fixtureActualExpectedOutcome
regression: malaria-like[8.277287, 2.877028, 0.367879][82.772874, 9.09796, 0.367879]Failed
regression: dengue-like[0.64326, 0.802035, 0.382893][5.3605, 2.315275, 0.382893]Failed
control: no mosquitoes[0.0, 0.0, 0.367879][0.0, 0.0, 0.367879]Passed
control: invalid muNoneNonePassed
regression: zero incubation[1.125, 1.06066, 1.0][5.625, 2.371708, 1.0]Failed
regression: long lived mosquitoes[8.232175, 2.869177, 0.548812][164.643491, 12.831348, 0.548812]Failed
regression: low bite rate[2.099846, 1.449085, 0.25924][13.998974, 3.74152, 0.25924]Failed

SHA-256 / d37a8bf59e3b130d8ae831cc35c94a0f430374714c82eef7883c848950433769

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 = 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]),
  ('control: 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),
  ('regression: 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]),
  ('control: 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),
  ('regression: 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]),
  ('control: 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),
  ('regression: 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]),
  ('control: 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),
  ('regression: 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]),
  ('control: 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),
  ('regression: 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 fixtureActualExpectedOutcome
regression: malaria-like[0.752481, 0.867456, 0.367879][82.772874, 9.09796, 0.367879]Failed
regression: dengue-like[0.346371, 0.588533, 0.382893][5.3605, 2.315275, 0.382893]Failed
control: no mosquitoes[0.0, 0.0, 0.367879][0.0, 0.0, 0.367879]Passed
control: invalid muNoneNonePassed
regression: zero incubation[0.375, 0.612372, 1.0][5.625, 2.371708, 1.0]Failed
regression: long lived mosquitoes[2.35205, 1.533639, 0.548812][164.643491, 12.831348, 0.548812]Failed
regression: low bite rate[0.524962, 0.724542, 0.25924][13.998974, 3.74152, 0.25924]Failed

SHA-256 / a99d3041d951590c31d7b207f7d20c10a14a8054d8a3db5ff3808e8e7854e352

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]),
  ('control: 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),
  ('regression: 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]),
  ('control: 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),
  ('regression: 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]),
  ('control: 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),
  ('regression: 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]),
  ('control: 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),
  ('regression: 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]),
  ('control: 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),
  ('regression: 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 fixtureActualExpectedOutcome
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
control: no mosquitoes[0.0, 0.0, 0.367879][0.0, 0.0, 0.367879]Passed
control: invalid muNoneNonePassed
regression: 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 / 1dad2825de955aa92caaf1b7c5dd2722806f5c1a911e67b01950e377fe3d9a4a

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.762506+00:00.

Case digest / 2f5af27ec3215a2cdc539e5dbec5a575c6fc70c6d9fefda5b44869b608eed998