FA-65341 / Ecological population dynamics / Open access
Discrete logistic population with constant quota harvest: crowding feedback · case 01
Stocks never settle at carrying capacity; growth follows the initial density forever.
ROOT CAUSE
Density dependence uses the initial stock N0 instead of the current stock.
THE FAILURE
Density dependence uses the initial stock N0 instead of the current stock.
Unsuccessful approach: Inflating K by the quota shifts the equilibrium above the true capacity.
Case contract
Each year the quota is removed first; if the stock is then <= 0 the trajectory records 0.0 and stops; otherwise the survivors grow by r*N*(1-N/K); the trajectory starts with the unharvested N0; values rounded to 4; None for K<=0 or negative N0.
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(n0, r, k, harvest, years):
if k <= 0 or n0 < 0:
return None
n = float(n0)
traj = [round(n, 4)]
for _ in range(years):
n -= harvest
if n <= 0:
traj.append(0.0)
break
n = n + r * n * (1 - n0 / k)
traj.append(round(n, 4))
return traj
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: cod-like stock light quota',
(500, 0.4, 1000, 20, 8),
[500.0, 579.84, 658.4077, 730.745, 792.9796, 843.1725, 881.3963, 909.1534, 928.5772]),
('regression: quota exceeds growth collapse',
(300, 0.3, 1000, 120, 10),
[300.0, 224.28, 132.3017, 15.9468, 0.0]),
('control: quota equals stock exactly', (50, 0.5, 400, 50, 5), [50.0, 0.0]),
('regression: no harvest recovery',
(100, 0.6, 800, 0, 7),
[100.0, 152.5, 226.5578, 323.9962, 439.6637, 558.4838, 659.646, 729.084]),
('regression: above carrying capacity',
(1200, 0.5, 1000, 10, 6),
[1200.0, 1076.95, 1031.2338, 1010.3915, 1000.1957, 995.0498, 992.4131]),
('control: invalid carrying capacity', (100, 0.5, 0, 10, 5), None),
('control: zero years', (100, 0.5, 500, 10, 0), [100.0])],
[('control: quota equals stock exactly', (50, 0.5, 400, 50, 5), [50.0, 0.0]),
('regression: no harvest recovery',
(100, 0.6, 800, 0, 7),
[100.0, 152.5, 226.5578, 323.9962, 439.6637, 558.4838, 659.646, 729.084]),
('regression: above carrying capacity',
(1200, 0.5, 1000, 10, 6),
[1200.0, 1076.95, 1031.2338, 1010.3915, 1000.1957, 995.0498, 992.4131]),
('control: invalid carrying capacity', (100, 0.5, 0, 10, 5), None),
('control: zero years', (100, 0.5, 500, 10, 0), [100.0]),
('regression: slow grower',
(800, 0.1, 1000, 15, 9),
[800.0, 801.8775, 803.6476, 805.3159, 806.8876, 808.3677, 809.7613, 811.0728, 812.3069, 813.4678]),
('regression: two-year collapse', (60, 0.2, 500, 40, 6), [60.0, 23.84, 0.0])],
[('regression: cod-like stock light quota',
(500, 0.4, 1000, 20, 8),
[500.0, 579.84, 658.4077, 730.745, 792.9796, 843.1725, 881.3963, 909.1534, 928.5772]),
('regression: quota exceeds growth collapse',
(300, 0.3, 1000, 120, 10),
[300.0, 224.28, 132.3017, 15.9468, 0.0]),
('control: quota equals stock exactly', (50, 0.5, 400, 50, 5), [50.0, 0.0]),
('control: invalid carrying capacity', (100, 0.5, 0, 10, 5), None),
('control: zero years', (100, 0.5, 500, 10, 0), [100.0]),
('regression: slow grower',
(800, 0.1, 1000, 15, 9),
[800.0, 801.8775, 803.6476, 805.3159, 806.8876, 808.3677, 809.7613, 811.0728, 812.3069, 813.4678]),
('regression: two-year collapse', (60, 0.2, 500, 40, 6), [60.0, 23.84, 0.0])],
[('regression: cod-like stock light quota',
(500, 0.4, 1000, 20, 8),
[500.0, 579.84, 658.4077, 730.745, 792.9796, 843.1725, 881.3963, 909.1534, 928.5772]),
('regression: quota exceeds growth collapse',
(300, 0.3, 1000, 120, 10),
[300.0, 224.28, 132.3017, 15.9468, 0.0]),
('control: quota equals stock exactly', (50, 0.5, 400, 50, 5), [50.0, 0.0]),
('regression: no harvest recovery',
(100, 0.6, 800, 0, 7),
[100.0, 152.5, 226.5578, 323.9962, 439.6637, 558.4838, 659.646, 729.084]),
('regression: above carrying capacity',
(1200, 0.5, 1000, 10, 6),
[1200.0, 1076.95, 1031.2338, 1010.3915, 1000.1957, 995.0498, 992.4131]),
('control: invalid carrying capacity', (100, 0.5, 0, 10, 5), None),
('control: zero years', (100, 0.5, 500, 10, 0), [100.0])],
[('control: quota equals stock exactly', (50, 0.5, 400, 50, 5), [50.0, 0.0]),
('regression: no harvest recovery',
(100, 0.6, 800, 0, 7),
[100.0, 152.5, 226.5578, 323.9962, 439.6637, 558.4838, 659.646, 729.084]),
('regression: above carrying capacity',
(1200, 0.5, 1000, 10, 6),
[1200.0, 1076.95, 1031.2338, 1010.3915, 1000.1957, 995.0498, 992.4131]),
('control: invalid carrying capacity', (100, 0.5, 0, 10, 5), None),
('control: zero years', (100, 0.5, 500, 10, 0), [100.0]),
('regression: slow grower',
(800, 0.1, 1000, 15, 9),
[800.0, 801.8775, 803.6476, 805.3159, 806.8876, 808.3677, 809.7613, 811.0728, 812.3069, 813.4678]),
('regression: two-year collapse', (60, 0.2, 500, 40, 6), [60.0, 23.84, 0.0])]]
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: cod-like stock light quota | [500.0, 576.0, 667.2, 776.64, 907.968, 1065.5616, 1254.6739, 1481.6087, 1753.9304] | [500.0, 579.84, 658.4077, 730.745, 792.9796, 843.1725, 881.3963, 909.1534, 928.5772] | Failed |
| regression: quota exceeds growth collapse | [300.0, 217.8, 118.338, 0.0] | [300.0, 224.28, 132.3017, 15.9468, 0.0] | Failed |
| control: quota equals stock exactly | [50.0, 0.0] | [50.0, 0.0] | Passed |
| regression: no harvest recovery | [100.0, 152.5, 232.5625, 354.6578, 540.8532, 824.8011, 1257.8216, 1918.178] | [100.0, 152.5, 226.5578, 323.9962, 439.6637, 558.4838, 659.646, 729.084] | Failed |
| regression: above carrying capacity | [1200.0, 1071.0, 954.9, 850.41, 756.369, 671.7321, 595.5589] | [1200.0, 1076.95, 1031.2338, 1010.3915, 1000.1957, 995.0498, 992.4131] | Failed |
| control: invalid carrying capacity | None | None | Passed |
| control: zero years | [100.0] | [100.0] | Passed |
SHA-256 / 0c8bc189879779d91c14a61130cf4ac71d8e23e3b24aabf36d31ebf67b8b91f8
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(n0, r, k, harvest, years):
if k <= 0 or n0 < 0:
return None
n = float(n0)
traj = [round(n, 4)]
for _ in range(years):
n -= harvest
if n <= 0:
traj.append(0.0)
break
n = n + r * n * (1 - n / (k + harvest))
traj.append(round(n, 4))
return traj
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: cod-like stock light quota',
(500, 0.4, 1000, 20, 8),
[500.0, 579.84, 658.4077, 730.745, 792.9796, 843.1725, 881.3963, 909.1534, 928.5772]),
('regression: quota exceeds growth collapse',
(300, 0.3, 1000, 120, 10),
[300.0, 224.28, 132.3017, 15.9468, 0.0]),
('control: quota equals stock exactly', (50, 0.5, 400, 50, 5), [50.0, 0.0]),
('regression: no harvest recovery',
(100, 0.6, 800, 0, 7),
[100.0, 152.5, 226.5578, 323.9962, 439.6637, 558.4838, 659.646, 729.084]),
('regression: above carrying capacity',
(1200, 0.5, 1000, 10, 6),
[1200.0, 1076.95, 1031.2338, 1010.3915, 1000.1957, 995.0498, 992.4131]),
('control: invalid carrying capacity', (100, 0.5, 0, 10, 5), None),
('control: zero years', (100, 0.5, 500, 10, 0), [100.0])],
[('control: quota equals stock exactly', (50, 0.5, 400, 50, 5), [50.0, 0.0]),
('regression: no harvest recovery',
(100, 0.6, 800, 0, 7),
[100.0, 152.5, 226.5578, 323.9962, 439.6637, 558.4838, 659.646, 729.084]),
('regression: above carrying capacity',
(1200, 0.5, 1000, 10, 6),
[1200.0, 1076.95, 1031.2338, 1010.3915, 1000.1957, 995.0498, 992.4131]),
('control: invalid carrying capacity', (100, 0.5, 0, 10, 5), None),
('control: zero years', (100, 0.5, 500, 10, 0), [100.0]),
('regression: slow grower',
(800, 0.1, 1000, 15, 9),
[800.0, 801.8775, 803.6476, 805.3159, 806.8876, 808.3677, 809.7613, 811.0728, 812.3069, 813.4678]),
('regression: two-year collapse', (60, 0.2, 500, 40, 6), [60.0, 23.84, 0.0])],
[('regression: cod-like stock light quota',
(500, 0.4, 1000, 20, 8),
[500.0, 579.84, 658.4077, 730.745, 792.9796, 843.1725, 881.3963, 909.1534, 928.5772]),
('regression: quota exceeds growth collapse',
(300, 0.3, 1000, 120, 10),
[300.0, 224.28, 132.3017, 15.9468, 0.0]),
('control: quota equals stock exactly', (50, 0.5, 400, 50, 5), [50.0, 0.0]),
('control: invalid carrying capacity', (100, 0.5, 0, 10, 5), None),
('control: zero years', (100, 0.5, 500, 10, 0), [100.0]),
('regression: slow grower',
(800, 0.1, 1000, 15, 9),
[800.0, 801.8775, 803.6476, 805.3159, 806.8876, 808.3677, 809.7613, 811.0728, 812.3069, 813.4678]),
('regression: two-year collapse', (60, 0.2, 500, 40, 6), [60.0, 23.84, 0.0])],
[('regression: cod-like stock light quota',
(500, 0.4, 1000, 20, 8),
[500.0, 579.84, 658.4077, 730.745, 792.9796, 843.1725, 881.3963, 909.1534, 928.5772]),
('regression: quota exceeds growth collapse',
(300, 0.3, 1000, 120, 10),
[300.0, 224.28, 132.3017, 15.9468, 0.0]),
('control: quota equals stock exactly', (50, 0.5, 400, 50, 5), [50.0, 0.0]),
('regression: no harvest recovery',
(100, 0.6, 800, 0, 7),
[100.0, 152.5, 226.5578, 323.9962, 439.6637, 558.4838, 659.646, 729.084]),
('regression: above carrying capacity',
(1200, 0.5, 1000, 10, 6),
[1200.0, 1076.95, 1031.2338, 1010.3915, 1000.1957, 995.0498, 992.4131]),
('control: invalid carrying capacity', (100, 0.5, 0, 10, 5), None),
('control: zero years', (100, 0.5, 500, 10, 0), [100.0])],
[('control: quota equals stock exactly', (50, 0.5, 400, 50, 5), [50.0, 0.0]),
('regression: no harvest recovery',
(100, 0.6, 800, 0, 7),
[100.0, 152.5, 226.5578, 323.9962, 439.6637, 558.4838, 659.646, 729.084]),
('regression: above carrying capacity',
(1200, 0.5, 1000, 10, 6),
[1200.0, 1076.95, 1031.2338, 1010.3915, 1000.1957, 995.0498, 992.4131]),
('control: invalid carrying capacity', (100, 0.5, 0, 10, 5), None),
('control: zero years', (100, 0.5, 500, 10, 0), [100.0]),
('regression: slow grower',
(800, 0.1, 1000, 15, 9),
[800.0, 801.8775, 803.6476, 805.3159, 806.8876, 808.3677, 809.7613, 811.0728, 812.3069, 813.4678]),
('regression: two-year collapse', (60, 0.2, 500, 40, 6), [60.0, 23.84, 0.0])]]
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: cod-like stock light quota | [500.0, 581.6471, 662.601, 737.7057, 802.7874, 855.6059, 896.0297, 925.4894, 946.1514] | [500.0, 579.84, 658.4077, 730.745, 792.9796, 843.1725, 881.3963, 909.1534, 928.5772] | Failed |
| regression: quota exceeds growth collapse | [300.0, 225.3214, 133.9466, 18.0785, 0.0] | [300.0, 224.28, 132.3017, 15.9468, 0.0] | Failed |
| control: quota equals stock exactly | [50.0, 0.0] | [50.0, 0.0] | Passed |
| regression: no harvest recovery | [100.0, 152.5, 226.5578, 323.9962, 439.6637, 558.4838, 659.646, 729.084] | [100.0, 152.5, 226.5578, 323.9962, 439.6637, 558.4838, 659.646, 729.084] | Passed |
| regression: above carrying capacity | [1200.0, 1083.9604, 1039.955, 1019.7804, 1009.8902, 1004.8945, 1002.3343] | [1200.0, 1076.95, 1031.2338, 1010.3915, 1000.1957, 995.0498, 992.4131] | Failed |
| control: invalid carrying capacity | None | None | Passed |
| control: zero years | [100.0] | [100.0] | Passed |
SHA-256 / e2052ba7a171be8a158f28e24a0448d580eeffab890e202b5c08230af6740061
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.167440+00:00.
Case digest / 736d8f68bc26df82854ceaf2da4e6e9c4d455d74b4001756521ee1e45202ab63