{"abstract":"A dead-heated winner is paid as a solo winner.","category":"Betting odds conversion","checks":8,"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.","evaluation_group":"w2-odds-conversion-each-way-dead-heat","failed_approach":"Dividing only the winnings keeps the full stake and overpays.","family":"w2-odds-conversion-each-way-dead-heat-win-dead-heat","id":"FA-84491","implementations":{"attempt":{"sha256":"88fd749a285b8b782cde82c81bde12044890f15a261757d2eb1dc26bbed2e087","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 += stake_cents * (1 + f / dead_heat)\n    if position <= places_paid:\n        share = Fraction(min(dead_heat, places_paid - position + 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: win dead heat', (1000, '4/4', '1/4', 1, 2, 2), 2250),\n  ('variant scenario 1', (250, '10/5', '1/4', 2, 3, 2), 375),\n  ('variant scenario 2', (250, '19/4', '1/5', 1, 2, 1), 1925)],\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: win dead heat', (1000, '18/2', '1/5', 1, 5, 3), 6133),\n  ('variant scenario 1', (100, '9/4', '1/4', 4, 5, 1), 156),\n  ('variant scenario 2', (100, '31/5', '1/5', 4, 5, 1), 224)],\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: win dead heat', (1000, '23/4', '1/5', 1, 5, 2), 5525),\n  ('variant scenario 1', (1000, '10/2', '1/5', 5, 5, 1), 2000),\n  ('variant scenario 2', (100, '11/2', '1/5', 5, 3, 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: win dead heat', (250, '20/1', '1/5', 1, 3, 2), 3875),\n  ('variant scenario 1', (500, '5/1', '1/5', 2, 5, 2), 1000),\n  ('variant scenario 2', (100, '16/2', '1/4', 4, 4, 1), 300)],\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: win dead heat', (100, '9/1', '1/4', 1, 2, 3), 550),\n  ('variant scenario 1', (1000, '10/1', '1/4', 2, 3, 1), 3500),\n  ('variant scenario 2', (1000, '18/5', '1/4', 5, 3, 2), 0)]]\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":"ff67128ad93d2e0f9ea402ec3e350ef89f186cf579a4eaed02f9adfc1b24fab0","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 += stake_cents * (1 + f)\n    if position <= places_paid:\n        share = Fraction(min(dead_heat, places_paid - position + 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: win dead heat', (1000, '4/4', '1/4', 1, 2, 2), 2250),\n  ('variant scenario 1', (250, '10/5', '1/4', 2, 3, 2), 375),\n  ('variant scenario 2', (250, '19/4', '1/5', 1, 2, 1), 1925)],\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: win dead heat', (1000, '18/2', '1/5', 1, 5, 3), 6133),\n  ('variant scenario 1', (100, '9/4', '1/4', 4, 5, 1), 156),\n  ('variant scenario 2', (100, '31/5', '1/5', 4, 5, 1), 224)],\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: win dead heat', (1000, '23/4', '1/5', 1, 5, 2), 5525),\n  ('variant scenario 1', (1000, '10/2', '1/5', 5, 5, 1), 2000),\n  ('variant scenario 2', (100, '11/2', '1/5', 5, 3, 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: win dead heat', (250, '20/1', '1/5', 1, 3, 2), 3875),\n  ('variant scenario 1', (500, '5/1', '1/5', 2, 5, 2), 1000),\n  ('variant scenario 2', (100, '16/2', '1/4', 4, 4, 1), 300)],\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: win dead heat', (100, '9/1', '1/4', 1, 2, 3), 550),\n  ('variant scenario 1', (1000, '10/1', '1/4', 2, 3, 1), 3500),\n  ('variant scenario 2', (1000, '18/5', '1/4', 5, 3, 2), 0)]]\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"},"fixed":{"sha256":"d057efaa8d451e828880cd52f0d3c02d608944fd11722cf36383edda439f2082","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(min(dead_heat, places_paid - position + 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: win dead heat', (1000, '4/4', '1/4', 1, 2, 2), 2250),\n  ('variant scenario 1', (250, '10/5', '1/4', 2, 3, 2), 375),\n  ('variant scenario 2', (250, '19/4', '1/5', 1, 2, 1), 1925)],\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: win dead heat', (1000, '18/2', '1/5', 1, 5, 3), 6133),\n  ('variant scenario 1', (100, '9/4', '1/4', 4, 5, 1), 156),\n  ('variant scenario 2', (100, '31/5', '1/5', 4, 5, 1), 224)],\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: win dead heat', (1000, '23/4', '1/5', 1, 5, 2), 5525),\n  ('variant scenario 1', (1000, '10/2', '1/5', 5, 5, 1), 2000),\n  ('variant scenario 2', (100, '11/2', '1/5', 5, 3, 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: win dead heat', (250, '20/1', '1/5', 1, 3, 2), 3875),\n  ('variant scenario 1', (500, '5/1', '1/5', 2, 5, 2), 1000),\n  ('variant scenario 2', (100, '16/2', '1/4', 4, 4, 1), 300)],\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: win dead heat', (100, '9/1', '1/4', 1, 2, 3), 550),\n  ('variant scenario 1', (1000, '10/1', '1/4', 2, 3, 1), 3500),\n  ('variant scenario 2', (1000, '18/5', '1/4', 5, 3, 2), 0)]]\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-win-dead-heat","generated_at":"2026-09-29T14:50:31.311949+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.","repair":"Divide the win stake by the number of runners dead-heating.","root_cause":"The win part uses the full stake regardless of the dead heat.","sha256":"16e3f393b8958ddd10d001f7c12dbf71de501d1830afb46146c966da18978cc1","title":"Dead heat for first ignored or applied to profit only · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":45.331,"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":4800,"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":2750,"check":"regression: win dead heat","expected":2250,"passed":false},{"actual":375,"check":"variant scenario 1","expected":375,"passed":true},{"actual":1925,"check":"variant scenario 2","expected":1925,"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\": 4800, \"expected\": 4300, \"passed\": false}, {\"check\": \"boundary dead heat for last place\", \"actual\": 1500, \"expected\": 1500, \"passed\": true}, {\"check\": \"regression: win dead heat\", \"actual\": 2750, \"expected\": 2250, \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": 375, \"expected\": 375, \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": 1925, \"expected\": 1925, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.689,"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":6800,"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":3250,"check":"regression: win dead heat","expected":2250,"passed":false},{"actual":375,"check":"variant scenario 1","expected":375,"passed":true},{"actual":1925,"check":"variant scenario 2","expected":1925,"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\": 6800, \"expected\": 4300, \"passed\": false}, {\"check\": \"boundary dead heat for last place\", \"actual\": 1500, \"expected\": 1500, \"passed\": true}, {\"check\": \"regression: win dead heat\", \"actual\": 3250, \"expected\": 2250, \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": 375, \"expected\": 375, \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": 1925, \"expected\": 1925, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":45.249,"exit_code":0,"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":1500,"check":"boundary dead heat for last place","expected":1500,"passed":true},{"actual":2250,"check":"regression: win dead heat","expected":2250,"passed":true},{"actual":375,"check":"variant scenario 1","expected":375,"passed":true},{"actual":1925,"check":"variant scenario 2","expected":1925,"passed":true}],"passed":true,"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\": 1500, \"expected\": 1500, \"passed\": true}, {\"check\": \"regression: win dead heat\", \"actual\": 2250, \"expected\": 2250, \"passed\": true}, {\"check\": \"variant scenario 1\", \"actual\": 375, \"expected\": 375, \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": 1925, \"expected\": 1925, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}