FAILURE MAP
← Case archive

FA-65726 / Ecological population dynamics / Open access

Two-pass removal abundance estimate: variance exponent · case 01

Variance estimates explode for strongly depleted streams.

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

ROOT CAUSE

The depletion term is squared instead of raised to the fourth power.

VERIFIED REPAIR

Restore the variance exponent rule: `/ (c1 - c2) ** 4`.

Unsuccessful approach: A cubic denominator is still dimensionally wrong.

Case contract

N = c1^2/(c1-c2), p = (c1-c2)/c1, var = c1^2*c2^2*(c1+c2)/(c1-c2)^4 rounded [2, 4, 2]; [None, None, None] when c1<=c2; None for negative catches.

Why this case matters

Population projections set harvest quotas, conservation status and pest-control timing; a wrong update order, boundary or rate conversion silently changes management advice.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(c1, c2):
    if c1 < 0 or c2 < 0:
        return None
    if c1 <= c2:
        return [None, None, None]
    n_hat = c1 * c1 / (c1 - c2)
    p_hat = (c1 - c2) / c1
    var = c1 ** 2 * c2 ** 2 * (c1 + c2) / (c1 - c2) ** 2
    return [round(n_hat, 2), round(p_hat, 4), round(var, 2)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: stream electrofishing', (60, 25), [102.86, 0.5833, 127.45]),
  ('regression: efficient first pass', (90, 10), [101.25, 0.8889, 1.98]),
  ('regression: weak depletion', (40, 32), [200.0, 0.2, 28800.0]),
  ('control: no depletion', (30, 30), [None, None, None]),
  ('control: second pass empty', (45, 0), [45.0, 1.0, 0.0]),
  ('control: negative catch', (-1, 3), None),
  ('control: increasing catch', (20, 25), [None, None, None])],
 [('regression: stream electrofishing', (60, 25), [102.86, 0.5833, 127.45]),
  ('control: no depletion', (30, 30), [None, None, None]),
  ('control: second pass empty', (45, 0), [45.0, 1.0, 0.0]),
  ('control: negative catch', (-1, 3), None),
  ('control: increasing catch', (20, 25), [None, None, None]),
  ('regression: small stream', (12, 5), [20.57, 0.5833, 25.49]),
  ('regression: large lake', (300, 140), [562.5, 0.5333, 1184.33])],
 [('regression: stream electrofishing', (60, 25), [102.86, 0.5833, 127.45]),
  ('regression: efficient first pass', (90, 10), [101.25, 0.8889, 1.98]),
  ('control: no depletion', (30, 30), [None, None, None]),
  ('control: second pass empty', (45, 0), [45.0, 1.0, 0.0]),
  ('control: increasing catch', (20, 25), [None, None, None]),
  ('regression: small stream', (12, 5), [20.57, 0.5833, 25.49]),
  ('regression: large lake', (300, 140), [562.5, 0.5333, 1184.33])],
 [('regression: stream electrofishing', (60, 25), [102.86, 0.5833, 127.45]),
  ('regression: efficient first pass', (90, 10), [101.25, 0.8889, 1.98]),
  ('regression: weak depletion', (40, 32), [200.0, 0.2, 28800.0]),
  ('control: no depletion', (30, 30), [None, None, None]),
  ('control: second pass empty', (45, 0), [45.0, 1.0, 0.0]),
  ('control: negative catch', (-1, 3), None),
  ('control: increasing catch', (20, 25), [None, None, None])],
 [('regression: stream electrofishing', (60, 25), [102.86, 0.5833, 127.45]),
  ('control: no depletion', (30, 30), [None, None, None]),
  ('control: second pass empty', (45, 0), [45.0, 1.0, 0.0]),
  ('control: negative catch', (-1, 3), None),
  ('control: increasing catch', (20, 25), [None, None, None]),
  ('regression: small stream', (12, 5), [20.57, 0.5833, 25.49]),
  ('regression: large lake', (300, 140), [562.5, 0.5333, 1184.33])]]
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: stream electrofishing[102.86, 0.5833, 156122.45][102.86, 0.5833, 127.45]Failed
regression: efficient first pass[101.25, 0.8889, 12656.25][101.25, 0.8889, 1.98]Failed
regression: weak depletion[200.0, 0.2, 1843200.0][200.0, 0.2, 28800.0]Failed
control: no depletion[None, None, None][None, None, None]Passed
control: second pass empty[45.0, 1.0, 0.0][45.0, 1.0, 0.0]Passed
control: negative catchNoneNonePassed
control: increasing catch[None, None, None][None, None, None]Passed

SHA-256 / 5590c21a8aa739bce5e5e04608cf5f2521951287d455de27966c9b9db56a1dda

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(c1, c2):
    if c1 < 0 or c2 < 0:
        return None
    if c1 <= c2:
        return [None, None, None]
    n_hat = c1 * c1 / (c1 - c2)
    p_hat = (c1 - c2) / c1
    var = c1 ** 2 * c2 ** 2 * (c1 + c2) / (c1 - c2) ** 3
    return [round(n_hat, 2), round(p_hat, 4), round(var, 2)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: stream electrofishing', (60, 25), [102.86, 0.5833, 127.45]),
  ('regression: efficient first pass', (90, 10), [101.25, 0.8889, 1.98]),
  ('regression: weak depletion', (40, 32), [200.0, 0.2, 28800.0]),
  ('control: no depletion', (30, 30), [None, None, None]),
  ('control: second pass empty', (45, 0), [45.0, 1.0, 0.0]),
  ('control: negative catch', (-1, 3), None),
  ('control: increasing catch', (20, 25), [None, None, None])],
 [('regression: stream electrofishing', (60, 25), [102.86, 0.5833, 127.45]),
  ('control: no depletion', (30, 30), [None, None, None]),
  ('control: second pass empty', (45, 0), [45.0, 1.0, 0.0]),
  ('control: negative catch', (-1, 3), None),
  ('control: increasing catch', (20, 25), [None, None, None]),
  ('regression: small stream', (12, 5), [20.57, 0.5833, 25.49]),
  ('regression: large lake', (300, 140), [562.5, 0.5333, 1184.33])],
 [('regression: stream electrofishing', (60, 25), [102.86, 0.5833, 127.45]),
  ('regression: efficient first pass', (90, 10), [101.25, 0.8889, 1.98]),
  ('control: no depletion', (30, 30), [None, None, None]),
  ('control: second pass empty', (45, 0), [45.0, 1.0, 0.0]),
  ('control: increasing catch', (20, 25), [None, None, None]),
  ('regression: small stream', (12, 5), [20.57, 0.5833, 25.49]),
  ('regression: large lake', (300, 140), [562.5, 0.5333, 1184.33])],
 [('regression: stream electrofishing', (60, 25), [102.86, 0.5833, 127.45]),
  ('regression: efficient first pass', (90, 10), [101.25, 0.8889, 1.98]),
  ('regression: weak depletion', (40, 32), [200.0, 0.2, 28800.0]),
  ('control: no depletion', (30, 30), [None, None, None]),
  ('control: second pass empty', (45, 0), [45.0, 1.0, 0.0]),
  ('control: negative catch', (-1, 3), None),
  ('control: increasing catch', (20, 25), [None, None, None])],
 [('regression: stream electrofishing', (60, 25), [102.86, 0.5833, 127.45]),
  ('control: no depletion', (30, 30), [None, None, None]),
  ('control: second pass empty', (45, 0), [45.0, 1.0, 0.0]),
  ('control: negative catch', (-1, 3), None),
  ('control: increasing catch', (20, 25), [None, None, None]),
  ('regression: small stream', (12, 5), [20.57, 0.5833, 25.49]),
  ('regression: large lake', (300, 140), [562.5, 0.5333, 1184.33])]]
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: stream electrofishing[102.86, 0.5833, 4460.64][102.86, 0.5833, 127.45]Failed
regression: efficient first pass[101.25, 0.8889, 158.2][101.25, 0.8889, 1.98]Failed
regression: weak depletion[200.0, 0.2, 230400.0][200.0, 0.2, 28800.0]Failed
control: no depletion[None, None, None][None, None, None]Passed
control: second pass empty[45.0, 1.0, 0.0][45.0, 1.0, 0.0]Passed
control: negative catchNoneNonePassed
control: increasing catch[None, None, None][None, None, None]Passed

SHA-256 / 54ad909cd28d1205c029105189379360ec621288cf0cf0306408ba583b5fb822

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(c1, c2):
    if c1 < 0 or c2 < 0:
        return None
    if c1 <= c2:
        return [None, None, None]
    n_hat = c1 * c1 / (c1 - c2)
    p_hat = (c1 - c2) / c1
    var = c1 ** 2 * c2 ** 2 * (c1 + c2) / (c1 - c2) ** 4
    return [round(n_hat, 2), round(p_hat, 4), round(var, 2)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: stream electrofishing', (60, 25), [102.86, 0.5833, 127.45]),
  ('regression: efficient first pass', (90, 10), [101.25, 0.8889, 1.98]),
  ('regression: weak depletion', (40, 32), [200.0, 0.2, 28800.0]),
  ('control: no depletion', (30, 30), [None, None, None]),
  ('control: second pass empty', (45, 0), [45.0, 1.0, 0.0]),
  ('control: negative catch', (-1, 3), None),
  ('control: increasing catch', (20, 25), [None, None, None])],
 [('regression: stream electrofishing', (60, 25), [102.86, 0.5833, 127.45]),
  ('control: no depletion', (30, 30), [None, None, None]),
  ('control: second pass empty', (45, 0), [45.0, 1.0, 0.0]),
  ('control: negative catch', (-1, 3), None),
  ('control: increasing catch', (20, 25), [None, None, None]),
  ('regression: small stream', (12, 5), [20.57, 0.5833, 25.49]),
  ('regression: large lake', (300, 140), [562.5, 0.5333, 1184.33])],
 [('regression: stream electrofishing', (60, 25), [102.86, 0.5833, 127.45]),
  ('regression: efficient first pass', (90, 10), [101.25, 0.8889, 1.98]),
  ('control: no depletion', (30, 30), [None, None, None]),
  ('control: second pass empty', (45, 0), [45.0, 1.0, 0.0]),
  ('control: increasing catch', (20, 25), [None, None, None]),
  ('regression: small stream', (12, 5), [20.57, 0.5833, 25.49]),
  ('regression: large lake', (300, 140), [562.5, 0.5333, 1184.33])],
 [('regression: stream electrofishing', (60, 25), [102.86, 0.5833, 127.45]),
  ('regression: efficient first pass', (90, 10), [101.25, 0.8889, 1.98]),
  ('regression: weak depletion', (40, 32), [200.0, 0.2, 28800.0]),
  ('control: no depletion', (30, 30), [None, None, None]),
  ('control: second pass empty', (45, 0), [45.0, 1.0, 0.0]),
  ('control: negative catch', (-1, 3), None),
  ('control: increasing catch', (20, 25), [None, None, None])],
 [('regression: stream electrofishing', (60, 25), [102.86, 0.5833, 127.45]),
  ('control: no depletion', (30, 30), [None, None, None]),
  ('control: second pass empty', (45, 0), [45.0, 1.0, 0.0]),
  ('control: negative catch', (-1, 3), None),
  ('control: increasing catch', (20, 25), [None, None, None]),
  ('regression: small stream', (12, 5), [20.57, 0.5833, 25.49]),
  ('regression: large lake', (300, 140), [562.5, 0.5333, 1184.33])]]
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: stream electrofishing[102.86, 0.5833, 127.45][102.86, 0.5833, 127.45]Passed
regression: efficient first pass[101.25, 0.8889, 1.98][101.25, 0.8889, 1.98]Passed
regression: weak depletion[200.0, 0.2, 28800.0][200.0, 0.2, 28800.0]Passed
control: no depletion[None, None, None][None, None, None]Passed
control: second pass empty[45.0, 1.0, 0.0][45.0, 1.0, 0.0]Passed
control: negative catchNoneNonePassed
control: increasing catch[None, None, None][None, None, None]Passed

SHA-256 / d0b39053c6414357323cbeb54dce881b6830dcac63c1aa13b20441ed22c09387

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

Case digest / c87f975cb02e2b05c86db4070f27df4e7b24f3a597670d4a56dcc55271f49a23