{"abstract":"Impossible samples with more recaptures than animals caught are estimated.","category":"Ecological population dynamics","checks":7,"contract":"Recaptures must be in [0, min(marked, caught)] else None; 'lp' = M*C/R ([None, None] when R=0, no variance); Chapman = (M+1)(C+1)/(R+1)-1 with variance (M+1)(C+1)(M-R)(C-R)/((R+1)^2 (R+2)); return [estimate rounded 2, variance rounded 2 or None].","contract_signature":"marked, caught, recaptured, method","evaluation_group":"w2-ecopop-mark-recapture","failed_approach":"Checking against the larger sample still admits impossible data.","family":"w2-ecopop-mark-recapture-recapture-feasibility","id":"FA-65516","implementations":{"attempt":{"sha256":"fe4d71be18b3e398a0b6dcdb4f570f2efc9e60efb3cbda42a1892a86bdfe02b8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(marked, caught, recaptured, method):\n    if recaptured < 0 or recaptured > max(marked, caught):\n        return None\n    if method == 'lp':\n        if recaptured == 0:\n            return [None, None]\n        return [round(marked * caught / recaptured, 2), None]\n    est = (marked + 1) * (caught + 1) / (recaptured + 1) - 1\n    var = (marked + 1) * (caught + 1) * (marked - recaptured) * (caught - recaptured) / ((recaptured + 1) ** 2 * (recaptured + 2))\n    return [round(est, 2), round(var, 2)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control: trout chapman', (120, 100, 20, 'chapman'), [580.95, 10077.1]),\n  ('control: trout petersen', (120, 100, 20, 'lp'), [600.0, None]),\n  ('control: zero recaptures chapman', (50, 40, 0, 'chapman'), [2090.0, 2091000.0]),\n  ('control: zero recaptures petersen', (50, 40, 0, 'lp'), [None, None]),\n  ('control: all recaptured', (30, 30, 30, 'chapman'), [30.0, 0.0]),\n  ('regression: recaptures exceed catch', (80, 10, 12, 'chapman'), None),\n  ('regression: recaptures exceed marked', (10, 80, 12, 'lp'), None)],\n [('control: zero recaptures petersen', (50, 40, 0, 'lp'), [None, None]),\n  ('control: all recaptured', (30, 30, 30, 'chapman'), [30.0, 0.0]),\n  ('regression: recaptures exceed catch', (80, 10, 12, 'chapman'), None),\n  ('regression: recaptures exceed marked', (10, 80, 12, 'lp'), None),\n  ('control: small sample', (15, 12, 3, 'chapman'), [51.0, 280.8]),\n  ('control: butterflies', (200, 150, 45, 'chapman'), [658.8, 4966.84]),\n  ('control: negative recapture', (20, 20, -1, 'lp'), None)],\n [('control: trout chapman', (120, 100, 20, 'chapman'), [580.95, 10077.1]),\n  ('control: trout petersen', (120, 100, 20, 'lp'), [600.0, None]),\n  ('regression: recaptures exceed catch', (80, 10, 12, 'chapman'), None),\n  ('regression: recaptures exceed marked', (10, 80, 12, 'lp'), None),\n  ('control: small sample', (15, 12, 3, 'chapman'), [51.0, 280.8]),\n  ('control: butterflies', (200, 150, 45, 'chapman'), [658.8, 4966.84]),\n  ('control: negative recapture', (20, 20, -1, 'lp'), None)],\n [('control: trout chapman', (120, 100, 20, 'chapman'), [580.95, 10077.1]),\n  ('control: trout petersen', (120, 100, 20, 'lp'), [600.0, None]),\n  ('control: zero recaptures chapman', (50, 40, 0, 'chapman'), [2090.0, 2091000.0]),\n  ('control: zero recaptures petersen', (50, 40, 0, 'lp'), [None, None]),\n  ('control: all recaptured', (30, 30, 30, 'chapman'), [30.0, 0.0]),\n  ('regression: recaptures exceed catch', (80, 10, 12, 'chapman'), None),\n  ('control: negative recapture', (20, 20, -1, 'lp'), None)],\n [('control: zero recaptures chapman', (50, 40, 0, 'chapman'), [2090.0, 2091000.0]),\n  ('control: zero recaptures petersen', (50, 40, 0, 'lp'), [None, None]),\n  ('control: all recaptured', (30, 30, 30, 'chapman'), [30.0, 0.0]),\n  ('regression: recaptures exceed catch', (80, 10, 12, 'chapman'), None),\n  ('regression: recaptures exceed marked', (10, 80, 12, 'lp'), None),\n  ('control: small sample', (15, 12, 3, 'chapman'), [51.0, 280.8]),\n  ('control: butterflies', (200, 150, 45, 'chapman'), [658.8, 4966.84])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"1f04c3a49af229f7a12e685930a1f23d93d9ff8bdbd8259b7360820a1775f49b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(marked, caught, recaptured, method):\n    if recaptured < 0 or recaptured > marked:\n        return None\n    if method == 'lp':\n        if recaptured == 0:\n            return [None, None]\n        return [round(marked * caught / recaptured, 2), None]\n    est = (marked + 1) * (caught + 1) / (recaptured + 1) - 1\n    var = (marked + 1) * (caught + 1) * (marked - recaptured) * (caught - recaptured) / ((recaptured + 1) ** 2 * (recaptured + 2))\n    return [round(est, 2), round(var, 2)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('control: trout chapman', (120, 100, 20, 'chapman'), [580.95, 10077.1]),\n  ('control: trout petersen', (120, 100, 20, 'lp'), [600.0, None]),\n  ('control: zero recaptures chapman', (50, 40, 0, 'chapman'), [2090.0, 2091000.0]),\n  ('control: zero recaptures petersen', (50, 40, 0, 'lp'), [None, None]),\n  ('control: all recaptured', (30, 30, 30, 'chapman'), [30.0, 0.0]),\n  ('regression: recaptures exceed catch', (80, 10, 12, 'chapman'), None),\n  ('regression: recaptures exceed marked', (10, 80, 12, 'lp'), None)],\n [('control: zero recaptures petersen', (50, 40, 0, 'lp'), [None, None]),\n  ('control: all recaptured', (30, 30, 30, 'chapman'), [30.0, 0.0]),\n  ('regression: recaptures exceed catch', (80, 10, 12, 'chapman'), None),\n  ('regression: recaptures exceed marked', (10, 80, 12, 'lp'), None),\n  ('control: small sample', (15, 12, 3, 'chapman'), [51.0, 280.8]),\n  ('control: butterflies', (200, 150, 45, 'chapman'), [658.8, 4966.84]),\n  ('control: negative recapture', (20, 20, -1, 'lp'), None)],\n [('control: trout chapman', (120, 100, 20, 'chapman'), [580.95, 10077.1]),\n  ('control: trout petersen', (120, 100, 20, 'lp'), [600.0, None]),\n  ('regression: recaptures exceed catch', (80, 10, 12, 'chapman'), None),\n  ('regression: recaptures exceed marked', (10, 80, 12, 'lp'), None),\n  ('control: small sample', (15, 12, 3, 'chapman'), [51.0, 280.8]),\n  ('control: butterflies', (200, 150, 45, 'chapman'), [658.8, 4966.84]),\n  ('control: negative recapture', (20, 20, -1, 'lp'), None)],\n [('control: trout chapman', (120, 100, 20, 'chapman'), [580.95, 10077.1]),\n  ('control: trout petersen', (120, 100, 20, 'lp'), [600.0, None]),\n  ('control: zero recaptures chapman', (50, 40, 0, 'chapman'), [2090.0, 2091000.0]),\n  ('control: zero recaptures petersen', (50, 40, 0, 'lp'), [None, None]),\n  ('control: all recaptured', (30, 30, 30, 'chapman'), [30.0, 0.0]),\n  ('regression: recaptures exceed catch', (80, 10, 12, 'chapman'), None),\n  ('control: negative recapture', (20, 20, -1, 'lp'), None)],\n [('control: zero recaptures chapman', (50, 40, 0, 'chapman'), [2090.0, 2091000.0]),\n  ('control: zero recaptures petersen', (50, 40, 0, 'lp'), [None, None]),\n  ('control: all recaptured', (30, 30, 30, 'chapman'), [30.0, 0.0]),\n  ('regression: recaptures exceed catch', (80, 10, 12, 'chapman'), None),\n  ('regression: recaptures exceed marked', (10, 80, 12, 'lp'), None),\n  ('control: small sample', (15, 12, 3, 'chapman'), [51.0, 280.8]),\n  ('control: butterflies', (200, 150, 45, 'chapman'), [658.8, 4966.84])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-ecopop-mark-recapture-recapture-feasibility","generated_at":"2026-09-29T14:47:34.696343+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Population projections set harvest quotas, conservation status and pest-control timing; a wrong update order, boundary or rate conversion silently changes management advice.","root_cause":"Recaptures are only checked against the marked count.","sha256":"8f1fd3aafa25e0f06dd3d0b9d62c732c51bdc96ca7ac20655076a159b4580305","title":"Two-sample mark-recapture abundance: recapture feasibility · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":42.632,"exit_code":1,"observations":[{"actual":[580.95,10077.1],"check":"control: trout chapman","expected":[580.95,10077.1],"passed":true},{"actual":[600.0,null],"check":"control: trout petersen","expected":[600.0,null],"passed":true},{"actual":[2090.0,2091000.0],"check":"control: zero recaptures chapman","expected":[2090.0,2091000.0],"passed":true},{"actual":[null,null],"check":"control: zero recaptures petersen","expected":[null,null],"passed":true},{"actual":[30.0,0.0],"check":"control: all recaptured","expected":[30.0,0.0],"passed":true},{"actual":[67.54,-51.22],"check":"regression: recaptures exceed catch","expected":null,"passed":false},{"actual":[66.67,null],"check":"regression: recaptures exceed marked","expected":null,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control: trout chapman\", \"actual\": [580.95, 10077.1], \"expected\": [580.95, 10077.1], \"passed\": true}, {\"check\": \"control: trout petersen\", \"actual\": [600.0, null], \"expected\": [600.0, null], \"passed\": true}, {\"check\": \"control: zero recaptures chapman\", \"actual\": [2090.0, 2091000.0], \"expected\": [2090.0, 2091000.0], \"passed\": true}, {\"check\": \"control: zero recaptures petersen\", \"actual\": [null, null], \"expected\": [null, null], \"passed\": true}, {\"check\": \"control: all recaptured\", \"actual\": [30.0, 0.0], \"expected\": [30.0, 0.0], \"passed\": true}, {\"check\": \"regression: recaptures exceed catch\", \"actual\": [67.54, -51.22], \"expected\": null, \"passed\": false}, {\"check\": \"regression: recaptures exceed marked\", \"actual\": [66.67, null], \"expected\": null, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.066,"exit_code":1,"observations":[{"actual":[580.95,10077.1],"check":"control: trout chapman","expected":[580.95,10077.1],"passed":true},{"actual":[600.0,null],"check":"control: trout petersen","expected":[600.0,null],"passed":true},{"actual":[2090.0,2091000.0],"check":"control: zero recaptures chapman","expected":[2090.0,2091000.0],"passed":true},{"actual":[null,null],"check":"control: zero recaptures petersen","expected":[null,null],"passed":true},{"actual":[30.0,0.0],"check":"control: all recaptured","expected":[30.0,0.0],"passed":true},{"actual":[67.54,-51.22],"check":"regression: recaptures exceed catch","expected":null,"passed":false},{"actual":null,"check":"regression: recaptures exceed marked","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control: trout chapman\", \"actual\": [580.95, 10077.1], \"expected\": [580.95, 10077.1], \"passed\": true}, {\"check\": \"control: trout petersen\", \"actual\": [600.0, null], \"expected\": [600.0, null], \"passed\": true}, {\"check\": \"control: zero recaptures chapman\", \"actual\": [2090.0, 2091000.0], \"expected\": [2090.0, 2091000.0], \"passed\": true}, {\"check\": \"control: zero recaptures petersen\", \"actual\": [null, null], \"expected\": [null, null], \"passed\": true}, {\"check\": \"control: all recaptured\", \"actual\": [30.0, 0.0], \"expected\": [30.0, 0.0], \"passed\": true}, {\"check\": \"regression: recaptures exceed catch\", \"actual\": [67.54, -51.22], \"expected\": null, \"passed\": false}, {\"check\": \"regression: recaptures exceed marked\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}