{"abstract":"Runners dead-heating for a place fully inside the places are cut, or those straddling the last place are not.","category":"Betting odds conversion","checks":9,"contract":"Each-way settlement with dead heats. stake_cents is the stake of each part (win and place). odds is fractional \"a/b\"; terms \"1/4\" or \"1/5\" is the place fraction of the odds. position is the finishing position shared by dead_heat runners (1 = no dead heat), occupying positions position .. position + dead_heat - 1. Win part: paid if position == 1 with stake / dead_heat at 1 + a/b. Place part: paid if position <= places_paid, with stake scaled by min(dead_heat, places_paid - position + 1) / dead_heat at 1 + (a/b) * terms. Return the total return in cents rounded down.","contract_signature":"stake_cents, odds, terms, position, places_paid, dead_heat","evaluation_group":"w2-odds-conversion-each-way-dead-heat","failed_approach":"Ignoring the dead heat for the place part overpays runners tied for the last place.","family":"w2-odds-conversion-each-way-dead-heat-place-dead-heat-share","id":"FA-84496","implementations":{"attempt":{"sha256":"03a27c7ed0904cea3497d645bcc964b106fadc7b992ee79cdd28b9eff056290b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(stake_cents, odds, terms, position, places_paid, dead_heat):\n    a, b = map(int, odds.split('/'))\n    f = Fraction(a, b)\n    tn, td = map(int, terms.split('/'))\n    place_f = f * Fraction(tn, td)\n    ret = Fraction(0)\n    if position == 1:\n        ret += Fraction(stake_cents, dead_heat) * (1 + f)\n    if position <= places_paid:\n        share = Fraction(1)\n        ret += stake_cents * share * (1 + place_f)\n    return math.floor(ret)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ndef run(args):\n    try:\n        return solve(*args)\n    except Exception as exc:\n        return 'raised ' + type(exc).__name__\ncases = [[('control winner', (1000, '4/1', '1/4', 1, 3, 1), 7000),\n  ('control placed', (1000, '4/1', '1/4', 2, 3, 1), 2000),\n  ('control unplaced', (1000, '4/1', '1/4', 4, 3, 1), 0),\n  ('boundary dead heat for the win', (1000, '4/1', '1/5', 1, 3, 2), 4300),\n  ('boundary dead heat for last place', (1000, '10/1', '1/5', 3, 3, 2), 1500),\n  ('regression: place dead heat share', (250, '4/2', '1/4', 3, 3, 2), 187),\n  ('regression: place dead heat share', (100, '8/2', '1/5', 4, 5, 2), 180),\n  ('variant scenario 1', (500, '6/1', '1/5', 2, 2, 1), 1100),\n  ('variant scenario 2', (100, '21/2', '1/4', 4, 2, 1), 0)],\n [('control winner', (1000, '4/1', '1/4', 1, 3, 1), 7000),\n  ('control placed', (1000, '4/1', '1/4', 2, 3, 1), 2000),\n  ('control unplaced', (1000, '4/1', '1/4', 4, 3, 1), 0),\n  ('boundary dead heat for the win', (1000, '4/1', '1/5', 1, 3, 2), 4300),\n  ('boundary dead heat for last place', (1000, '10/1', '1/5', 3, 3, 2), 1500),\n  ('regression: place dead heat share', (1000, '4/1', '1/5', 1, 3, 2), 4300),\n  ('regression: place dead heat share', (500, '28/1', '1/4', 3, 3, 2), 2000),\n  ('variant scenario 1', (1000, '25/2', '1/5', 4, 2, 2), 0),\n  ('variant scenario 2', (1000, '22/5', '1/5', 6, 4, 3), 0)],\n [('control winner', (1000, '4/1', '1/4', 1, 3, 1), 7000),\n  ('control placed', (1000, '4/1', '1/4', 2, 3, 1), 2000),\n  ('control unplaced', (1000, '4/1', '1/4', 4, 3, 1), 0),\n  ('boundary dead heat for the win', (1000, '4/1', '1/5', 1, 3, 2), 4300),\n  ('boundary dead heat for last place', (1000, '10/1', '1/5', 3, 3, 2), 1500),\n  ('regression: place dead heat share', (500, '27/5', '1/4', 4, 4, 2), 587),\n  ('regression: place dead heat share', (1000, '5/1', '1/5', 1, 5, 3), 4000),\n  ('variant scenario 1', (1000, '18/5', '1/5', 2, 4, 1), 1720),\n  ('variant scenario 2', (500, '16/1', '1/5', 1, 3, 1), 10600)],\n [('control winner', (1000, '4/1', '1/4', 1, 3, 1), 7000),\n  ('control placed', (1000, '4/1', '1/4', 2, 3, 1), 2000),\n  ('control unplaced', (1000, '4/1', '1/4', 4, 3, 1), 0),\n  ('boundary dead heat for the win', (1000, '4/1', '1/5', 1, 3, 2), 4300),\n  ('boundary dead heat for last place', (1000, '10/1', '1/5', 3, 3, 2), 1500),\n  ('regression: place dead heat share', (250, '15/1', '1/4', 1, 5, 2), 3187),\n  ('regression: place dead heat share', (500, '18/2', '1/5', 2, 2, 2), 700),\n  ('variant scenario 1', (100, '1/2', '1/5', 2, 2, 1), 110),\n  ('variant scenario 2', (250, '17/4', '1/4', 3, 3, 1), 515)],\n [('control winner', (1000, '4/1', '1/4', 1, 3, 1), 7000),\n  ('control placed', (1000, '4/1', '1/4', 2, 3, 1), 2000),\n  ('control unplaced', (1000, '4/1', '1/4', 4, 3, 1), 0),\n  ('boundary dead heat for the win', (1000, '4/1', '1/5', 1, 3, 2), 4300),\n  ('boundary dead heat for last place', (1000, '10/1', '1/5', 3, 3, 2), 1500),\n  ('regression: place dead heat share', (1000, '2/5', '1/4', 1, 3, 2), 1800),\n  ('regression: place dead heat share', (100, '18/4', '1/5', 4, 5, 3), 126),\n  ('variant scenario 1', (250, '26/1', '1/5', 1, 3, 2), 4925),\n  ('variant scenario 2', (1000, '21/1', '1/5', 2, 4, 3), 5200)]]\nfor label, args, expected in cases[N - 1]:\n    check(label, run(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":"d709aaf1b3d68724447ab36868faca6d1adef4d8627ea964b2e49ce0c73f6cd0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(stake_cents, odds, terms, position, places_paid, dead_heat):\n    a, b = map(int, odds.split('/'))\n    f = Fraction(a, b)\n    tn, td = map(int, terms.split('/'))\n    place_f = f * Fraction(tn, td)\n    ret = Fraction(0)\n    if position == 1:\n        ret += Fraction(stake_cents, dead_heat) * (1 + f)\n    if position <= places_paid:\n        share = Fraction(1, dead_heat)\n        ret += stake_cents * share * (1 + place_f)\n    return math.floor(ret)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ndef run(args):\n    try:\n        return solve(*args)\n    except Exception as exc:\n        return 'raised ' + type(exc).__name__\ncases = [[('control winner', (1000, '4/1', '1/4', 1, 3, 1), 7000),\n  ('control placed', (1000, '4/1', '1/4', 2, 3, 1), 2000),\n  ('control unplaced', (1000, '4/1', '1/4', 4, 3, 1), 0),\n  ('boundary dead heat for the win', (1000, '4/1', '1/5', 1, 3, 2), 4300),\n  ('boundary dead heat for last place', (1000, '10/1', '1/5', 3, 3, 2), 1500),\n  ('regression: place dead heat share', (250, '4/2', '1/4', 3, 3, 2), 187),\n  ('regression: place dead heat share', (100, '8/2', '1/5', 4, 5, 2), 180),\n  ('variant scenario 1', (500, '6/1', '1/5', 2, 2, 1), 1100),\n  ('variant scenario 2', (100, '21/2', '1/4', 4, 2, 1), 0)],\n [('control winner', (1000, '4/1', '1/4', 1, 3, 1), 7000),\n  ('control placed', (1000, '4/1', '1/4', 2, 3, 1), 2000),\n  ('control unplaced', (1000, '4/1', '1/4', 4, 3, 1), 0),\n  ('boundary dead heat for the win', (1000, '4/1', '1/5', 1, 3, 2), 4300),\n  ('boundary dead heat for last place', (1000, '10/1', '1/5', 3, 3, 2), 1500),\n  ('regression: place dead heat share', (1000, '4/1', '1/5', 1, 3, 2), 4300),\n  ('regression: place dead heat share', (500, '28/1', '1/4', 3, 3, 2), 2000),\n  ('variant scenario 1', (1000, '25/2', '1/5', 4, 2, 2), 0),\n  ('variant scenario 2', (1000, '22/5', '1/5', 6, 4, 3), 0)],\n [('control winner', (1000, '4/1', '1/4', 1, 3, 1), 7000),\n  ('control placed', (1000, '4/1', '1/4', 2, 3, 1), 2000),\n  ('control unplaced', (1000, '4/1', '1/4', 4, 3, 1), 0),\n  ('boundary dead heat for the win', (1000, '4/1', '1/5', 1, 3, 2), 4300),\n  ('boundary dead heat for last place', (1000, '10/1', '1/5', 3, 3, 2), 1500),\n  ('regression: place dead heat share', (500, '27/5', '1/4', 4, 4, 2), 587),\n  ('regression: place dead heat share', (1000, '5/1', '1/5', 1, 5, 3), 4000),\n  ('variant scenario 1', (1000, '18/5', '1/5', 2, 4, 1), 1720),\n  ('variant scenario 2', (500, '16/1', '1/5', 1, 3, 1), 10600)],\n [('control winner', (1000, '4/1', '1/4', 1, 3, 1), 7000),\n  ('control placed', (1000, '4/1', '1/4', 2, 3, 1), 2000),\n  ('control unplaced', (1000, '4/1', '1/4', 4, 3, 1), 0),\n  ('boundary dead heat for the win', (1000, '4/1', '1/5', 1, 3, 2), 4300),\n  ('boundary dead heat for last place', (1000, '10/1', '1/5', 3, 3, 2), 1500),\n  ('regression: place dead heat share', (250, '15/1', '1/4', 1, 5, 2), 3187),\n  ('regression: place dead heat share', (500, '18/2', '1/5', 2, 2, 2), 700),\n  ('variant scenario 1', (100, '1/2', '1/5', 2, 2, 1), 110),\n  ('variant scenario 2', (250, '17/4', '1/4', 3, 3, 1), 515)],\n [('control winner', (1000, '4/1', '1/4', 1, 3, 1), 7000),\n  ('control placed', (1000, '4/1', '1/4', 2, 3, 1), 2000),\n  ('control unplaced', (1000, '4/1', '1/4', 4, 3, 1), 0),\n  ('boundary dead heat for the win', (1000, '4/1', '1/5', 1, 3, 2), 4300),\n  ('boundary dead heat for last place', (1000, '10/1', '1/5', 3, 3, 2), 1500),\n  ('regression: place dead heat share', (1000, '2/5', '1/4', 1, 3, 2), 1800),\n  ('regression: place dead heat share', (100, '18/4', '1/5', 4, 5, 3), 126),\n  ('variant scenario 1', (250, '26/1', '1/5', 1, 3, 2), 4925),\n  ('variant scenario 2', (1000, '21/1', '1/5', 2, 4, 3), 5200)]]\nfor label, args, expected in cases[N - 1]:\n    check(label, run(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":"Stipulated, bounded toy contract stated in the contract field; not a claim of conformance with any operator, exchange or regulator rule set. 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-odds-conversion-each-way-dead-heat-place-dead-heat-share","generated_at":"2026-09-29T14:50:31.402899+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Horse-racing settlement applies place terms and dead-heat reductions to each part separately.","root_cause":"The place stake is always divided by the dead-heat count.","sha256":"6b9d44553ae17da8d57444cd3370e49e136a8fc765dd27ad68a1d6ed0cc44977","title":"Place dead-heat reduction ignores how many places remain · 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.372,"exit_code":1,"observations":[{"actual":7000,"check":"control winner","expected":7000,"passed":true},{"actual":2000,"check":"control placed","expected":2000,"passed":true},{"actual":0,"check":"control unplaced","expected":0,"passed":true},{"actual":4300,"check":"boundary dead heat for the win","expected":4300,"passed":true},{"actual":3000,"check":"boundary dead heat for last place","expected":1500,"passed":false},{"actual":375,"check":"regression: place dead heat share","expected":187,"passed":false},{"actual":180,"check":"regression: place dead heat share","expected":180,"passed":true},{"actual":1100,"check":"variant scenario 1","expected":1100,"passed":true},{"actual":0,"check":"variant scenario 2","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control winner\", \"actual\": 7000, \"expected\": 7000, \"passed\": true}, {\"check\": \"control placed\", \"actual\": 2000, \"expected\": 2000, \"passed\": true}, {\"check\": \"control unplaced\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"boundary dead heat for the win\", \"actual\": 4300, \"expected\": 4300, \"passed\": true}, {\"check\": \"boundary dead heat for last place\", \"actual\": 3000, \"expected\": 1500, \"passed\": false}, {\"check\": \"regression: place dead heat share\", \"actual\": 375, \"expected\": 187, \"passed\": false}, {\"check\": \"regression: place dead heat share\", \"actual\": 180, \"expected\": 180, \"passed\": true}, {\"check\": \"variant scenario 1\", \"actual\": 1100, \"expected\": 1100, \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.968,"exit_code":1,"observations":[{"actual":7000,"check":"control winner","expected":7000,"passed":true},{"actual":2000,"check":"control placed","expected":2000,"passed":true},{"actual":0,"check":"control unplaced","expected":0,"passed":true},{"actual":3400,"check":"boundary dead heat for the win","expected":4300,"passed":false},{"actual":1500,"check":"boundary dead heat for last place","expected":1500,"passed":true},{"actual":187,"check":"regression: place dead heat share","expected":187,"passed":true},{"actual":90,"check":"regression: place dead heat share","expected":180,"passed":false},{"actual":1100,"check":"variant scenario 1","expected":1100,"passed":true},{"actual":0,"check":"variant scenario 2","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control winner\", \"actual\": 7000, \"expected\": 7000, \"passed\": true}, {\"check\": \"control placed\", \"actual\": 2000, \"expected\": 2000, \"passed\": true}, {\"check\": \"control unplaced\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"boundary dead heat for the win\", \"actual\": 3400, \"expected\": 4300, \"passed\": false}, {\"check\": \"boundary dead heat for last place\", \"actual\": 1500, \"expected\": 1500, \"passed\": true}, {\"check\": \"regression: place dead heat share\", \"actual\": 187, \"expected\": 187, \"passed\": true}, {\"check\": \"regression: place dead heat share\", \"actual\": 90, \"expected\": 180, \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": 1100, \"expected\": 1100, \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": 0, \"expected\": 0, \"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."}}