FAILURE MAP
← Case archive

FA-65441 / Ecological population dynamics / Open access

Holling functional response consumption: type III sigmoid · case 01

Type III intake rises without bound instead of saturating.

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

ROOT CAUSE

The denominator uses N instead of N^2.

THE FAILURE

The denominator uses N instead of N^2.

Unsuccessful approach: Using N in the numerator gives a hump-shaped response.

Case contract

Per-predator intake f: type 1 = a*N capped at 1/h (uncapped when h==0), type 2 = aN/(1+ahN), type 3 = aN^2/(1+ahN^2); eaten = min(f*predators*duration, N); return [f rounded 6, eaten rounded 4]; None for negative parameters or unknown kind.

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(kind, a, h, prey, predators, duration):
    if a < 0 or h < 0 or prey < 0:
        return None
    if kind == 1:
        f = a * prey if h == 0 else min(a * prey, 1 / h)
    elif kind == 2:
        f = a * prey / (1 + a * h * prey)
    elif kind == 3:
        f = a * prey ** 2 / (1 + a * h * prey)
    else:
        return None
    eaten = min(f * predators * duration, prey)
    return [round(f, 6), round(eaten, 4)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
  ('control: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
  ('control: type 1 no handling', (1, 0.3, 0.0, 40, 1, 1), [12.0, 12.0]),
  ('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
  ('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
  ('regression: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
  ('regression: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752])],
 [('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
  ('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
  ('regression: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
  ('regression: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752]),
  ('control: depletion cap', (2, 2.0, 0.05, 10, 20, 5), [10.0, 10]),
  ('control: unknown kind', (4, 0.1, 0.1, 10, 1, 1), None),
  ('control: no prey', (2, 0.5, 0.5, 0, 2, 1), [0.0, 0.0])],
 [('control: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
  ('regression: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
  ('regression: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752]),
  ('control: depletion cap', (2, 2.0, 0.05, 10, 20, 5), [10.0, 10]),
  ('control: unknown kind', (4, 0.1, 0.1, 10, 1, 1), None),
  ('control: no prey', (2, 0.5, 0.5, 0, 2, 1), [0.0, 0.0]),
  ('control: invalid negative handling', (2, 0.5, -0.1, 10, 1, 1), None)],
 [('control: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
  ('control: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
  ('control: type 1 no handling', (1, 0.3, 0.0, 40, 1, 1), [12.0, 12.0]),
  ('regression: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
  ('regression: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752]),
  ('control: no prey', (2, 0.5, 0.5, 0, 2, 1), [0.0, 0.0]),
  ('control: invalid negative handling', (2, 0.5, -0.1, 10, 1, 1), None)],
 [('control: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
  ('control: type 1 no handling', (1, 0.3, 0.0, 40, 1, 1), [12.0, 12.0]),
  ('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
  ('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
  ('regression: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
  ('regression: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752]),
  ('control: depletion cap', (2, 2.0, 0.05, 10, 20, 5), [10.0, 10])]]
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
control: type 1 saturated filter feeder[4.0, 8.0][4.0, 8.0]Passed
control: type 1 unsaturated[1.0, 2.0][1.0, 2.0]Passed
control: type 1 no handling[12.0, 12.0][12.0, 12.0]Passed
control: type 2 wolves on moose[1.846154, 11.0769][1.846154, 11.0769]Passed
control: type 2 low density[0.566038, 0.566][0.566038, 0.566]Passed
regression: type 3 prey switching[6.428571, 12][2.95082, 12]Failed
regression: type 3 high density[83.333333, 50][2.475248, 2.4752]Failed

SHA-256 / 70396061d394ac24c3bd60603530c5b59d85ec3117a06a23380091a11aa18bec

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(kind, a, h, prey, predators, duration):
    if a < 0 or h < 0 or prey < 0:
        return None
    if kind == 1:
        f = a * prey if h == 0 else min(a * prey, 1 / h)
    elif kind == 2:
        f = a * prey / (1 + a * h * prey)
    elif kind == 3:
        f = a * prey / (1 + a * h * prey ** 2)
    else:
        return None
    eaten = min(f * predators * duration, prey)
    return [round(f, 6), round(eaten, 4)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('control: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
  ('control: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
  ('control: type 1 no handling', (1, 0.3, 0.0, 40, 1, 1), [12.0, 12.0]),
  ('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
  ('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
  ('regression: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
  ('regression: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752])],
 [('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
  ('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
  ('regression: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
  ('regression: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752]),
  ('control: depletion cap', (2, 2.0, 0.05, 10, 20, 5), [10.0, 10]),
  ('control: unknown kind', (4, 0.1, 0.1, 10, 1, 1), None),
  ('control: no prey', (2, 0.5, 0.5, 0, 2, 1), [0.0, 0.0])],
 [('control: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
  ('regression: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
  ('regression: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752]),
  ('control: depletion cap', (2, 2.0, 0.05, 10, 20, 5), [10.0, 10]),
  ('control: unknown kind', (4, 0.1, 0.1, 10, 1, 1), None),
  ('control: no prey', (2, 0.5, 0.5, 0, 2, 1), [0.0, 0.0]),
  ('control: invalid negative handling', (2, 0.5, -0.1, 10, 1, 1), None)],
 [('control: type 1 saturated filter feeder', (1, 0.5, 0.25, 20, 2, 1), [4.0, 8.0]),
  ('control: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
  ('control: type 1 no handling', (1, 0.3, 0.0, 40, 1, 1), [12.0, 12.0]),
  ('regression: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
  ('regression: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752]),
  ('control: no prey', (2, 0.5, 0.5, 0, 2, 1), [0.0, 0.0]),
  ('control: invalid negative handling', (2, 0.5, -0.1, 10, 1, 1), None)],
 [('control: type 1 unsaturated', (1, 0.1, 0.5, 10, 1, 2), [1.0, 2.0]),
  ('control: type 1 no handling', (1, 0.3, 0.0, 40, 1, 1), [12.0, 12.0]),
  ('control: type 2 wolves on moose', (2, 0.8, 0.5, 30, 3, 2), [1.846154, 11.0769]),
  ('control: type 2 low density', (2, 0.2, 0.1, 3, 1, 1), [0.566038, 0.566]),
  ('regression: type 3 prey switching', (3, 0.05, 0.2, 12, 2, 3), [2.95082, 12]),
  ('regression: type 3 high density', (3, 0.1, 0.4, 50, 1, 1), [2.475248, 2.4752]),
  ('control: depletion cap', (2, 2.0, 0.05, 10, 20, 5), [10.0, 10])]]
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
control: type 1 saturated filter feeder[4.0, 8.0][4.0, 8.0]Passed
control: type 1 unsaturated[1.0, 2.0][1.0, 2.0]Passed
control: type 1 no handling[12.0, 12.0][12.0, 12.0]Passed
control: type 2 wolves on moose[1.846154, 11.0769][1.846154, 11.0769]Passed
control: type 2 low density[0.566038, 0.566][0.566038, 0.566]Passed
regression: type 3 prey switching[0.245902, 1.4754][2.95082, 12]Failed
regression: type 3 high density[0.049505, 0.0495][2.475248, 2.4752]Failed

SHA-256 / 9eb2b63090e367a71268e79167ef68bba7806f317ab5c298c65671dcc63cd770

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / fab834c1edeecb0574008cdc8fd8cbd6f502289e4f840afd5806958e017f18b5