{"abstract":"Winning bets lose part of their stake to the deduction.","category":"Betting odds conversion","checks":8,"contract":"Non-runner deduction for a winning bet. Each withdrawn runner's decimal price maps to pence-in-the-pound from the first band whose limit it does not exceed: [('1.30', 75), ('1.40', 70), ('1.53', 65), ('1.62', 60), ('1.80', 55), ('1.95', 50), ('2.20', 45), ('2.50', 40), ('2.75', 35), ('3.25', 30), ('4.00', 25), ('5.00', 20), ('6.50', 15), ('10.00', 10), ('15.00', 5)]; above 15.00 it is 0. Deductions from several withdrawals are summed and capped at 75. The deduction applies to winnings only: return = stake + floor(stake * (price - 1) * (100 - deduction) / 100). Return [deduction, return cents].","contract_signature":"stake_cents, price, withdrawn","evaluation_group":"w2-odds-conversion-non-runner-deduction","failed_approach":"Charging the deduction per pound of stake still reduces the returned stake.","family":"w2-odds-conversion-non-runner-deduction-deduction-base","id":"FA-84661","implementations":{"attempt":{"sha256":"8eb7143fb13eed5c5aadaa6c2c550881b3264427e4c8f445eab3964d0216aa3a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(stake_cents, price, withdrawn):\n    TABLE = [('1.30', 75), ('1.40', 70), ('1.53', 65), ('1.62', 60), ('1.80', 55), ('1.95', 50), ('2.20', 45), ('2.50', 40), ('2.75', 35), ('3.25', 30), ('4.00', 25), ('5.00', 20), ('6.50', 15), ('10.00', 10), ('15.00', 5)]\n    def ded(p):\n        p = Fraction(p)\n        for limit, pence in TABLE:\n            if p <= Fraction(limit):\n                return pence\n        return 0\n    total = min(75, sum(ded(w) for w in withdrawn))\n    profit = stake_cents * (Fraction(price) - 1)\n    return [total, stake_cents + math.floor(profit - stake_cents * total / Fraction(100))]\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 no withdrawal', (1000, '5.00', []), [0, 5000]),\n  ('boundary price on band limit', (1000, '5.00', ['2.50']), [40, 3400]),\n  ('control long-shot withdrawal', (1000, '5.00', ['21.00']), [0, 5000]),\n  ('boundary cap at 75', (1000, '3.00', ['1.50', '1.50']), [75, 1500]),\n  ('control two withdrawals', (1000, '3.00', ['4.00', '6.00']), [40, 2200]),\n  ('regression: deduction base', (1000, '10.45', ['1.62', '2.75', '16.11']), [75, 3362]),\n  ('variant scenario 1', (250, '5.08', []), [0, 1270]),\n  ('variant scenario 2', (250, '10.79', []), [0, 2697])],\n [('control no withdrawal', (1000, '5.00', []), [0, 5000]),\n  ('boundary price on band limit', (1000, '5.00', ['2.50']), [40, 3400]),\n  ('control long-shot withdrawal', (1000, '5.00', ['21.00']), [0, 5000]),\n  ('boundary cap at 75', (1000, '3.00', ['1.50', '1.50']), [75, 1500]),\n  ('control two withdrawals', (1000, '3.00', ['4.00', '6.00']), [40, 2200]),\n  ('regression: deduction base', (250, '8.73', ['10.40', '2.50', '1.40']), [75, 733]),\n  ('variant scenario 1', (500, '1.61', ['4.18']), [20, 744]),\n  ('variant scenario 2', (1000, '8.66', []), [0, 8660])],\n [('control no withdrawal', (1000, '5.00', []), [0, 5000]),\n  ('boundary price on band limit', (1000, '5.00', ['2.50']), [40, 3400]),\n  ('control long-shot withdrawal', (1000, '5.00', ['21.00']), [0, 5000]),\n  ('boundary cap at 75', (1000, '3.00', ['1.50', '1.50']), [75, 1500]),\n  ('control two withdrawals', (1000, '3.00', ['4.00', '6.00']), [40, 2200]),\n  ('regression: deduction base', (500, '3.28', ['17.50', '17.84', '5.27']), [15, 1469]),\n  ('variant scenario 1', (500, '6.94', ['5.00', '6.50', '19.18']), [35, 2430]),\n  ('variant scenario 2', (500, '7.47', ['14.89', '3.00', '1.30']), [75, 1308])],\n [('control no withdrawal', (1000, '5.00', []), [0, 5000]),\n  ('boundary price on band limit', (1000, '5.00', ['2.50']), [40, 3400]),\n  ('control long-shot withdrawal', (1000, '5.00', ['21.00']), [0, 5000]),\n  ('boundary cap at 75', (1000, '3.00', ['1.50', '1.50']), [75, 1500]),\n  ('control two withdrawals', (1000, '3.00', ['4.00', '6.00']), [40, 2200]),\n  ('regression: deduction base', (1000, '7.16', ['16.19', '5.05', '2.50']), [55, 3772]),\n  ('variant scenario 1', (250, '11.49', ['2.75', '1.40', '12.13']), [75, 905]),\n  ('variant scenario 2', (1000, '5.49', []), [0, 5490])],\n [('control no withdrawal', (1000, '5.00', []), [0, 5000]),\n  ('boundary price on band limit', (1000, '5.00', ['2.50']), [40, 3400]),\n  ('control long-shot withdrawal', (1000, '5.00', ['21.00']), [0, 5000]),\n  ('boundary cap at 75', (1000, '3.00', ['1.50', '1.50']), [75, 1500]),\n  ('control two withdrawals', (1000, '3.00', ['4.00', '6.00']), [40, 2200]),\n  ('regression: deduction base', (250, '11.85', ['6.50']), [15, 2555]),\n  ('variant scenario 1', (500, '7.88', ['15.89']), [0, 3940]),\n  ('variant scenario 2', (500, '10.66', ['1.80', '1.48', '2.50']), [75, 1707])]]\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":"be304468d8ddbda59edead5db844756f1a1b32b726917803d333240ac8eb7851","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(stake_cents, price, withdrawn):\n    TABLE = [('1.30', 75), ('1.40', 70), ('1.53', 65), ('1.62', 60), ('1.80', 55), ('1.95', 50), ('2.20', 45), ('2.50', 40), ('2.75', 35), ('3.25', 30), ('4.00', 25), ('5.00', 20), ('6.50', 15), ('10.00', 10), ('15.00', 5)]\n    def ded(p):\n        p = Fraction(p)\n        for limit, pence in TABLE:\n            if p <= Fraction(limit):\n                return pence\n        return 0\n    total = min(75, sum(ded(w) for w in withdrawn))\n    profit = stake_cents * (Fraction(price) - 1)\n    return [total, math.floor((stake_cents + profit) * (100 - total) / 100)]\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 no withdrawal', (1000, '5.00', []), [0, 5000]),\n  ('boundary price on band limit', (1000, '5.00', ['2.50']), [40, 3400]),\n  ('control long-shot withdrawal', (1000, '5.00', ['21.00']), [0, 5000]),\n  ('boundary cap at 75', (1000, '3.00', ['1.50', '1.50']), [75, 1500]),\n  ('control two withdrawals', (1000, '3.00', ['4.00', '6.00']), [40, 2200]),\n  ('regression: deduction base', (1000, '10.45', ['1.62', '2.75', '16.11']), [75, 3362]),\n  ('variant scenario 1', (250, '5.08', []), [0, 1270]),\n  ('variant scenario 2', (250, '10.79', []), [0, 2697])],\n [('control no withdrawal', (1000, '5.00', []), [0, 5000]),\n  ('boundary price on band limit', (1000, '5.00', ['2.50']), [40, 3400]),\n  ('control long-shot withdrawal', (1000, '5.00', ['21.00']), [0, 5000]),\n  ('boundary cap at 75', (1000, '3.00', ['1.50', '1.50']), [75, 1500]),\n  ('control two withdrawals', (1000, '3.00', ['4.00', '6.00']), [40, 2200]),\n  ('regression: deduction base', (250, '8.73', ['10.40', '2.50', '1.40']), [75, 733]),\n  ('variant scenario 1', (500, '1.61', ['4.18']), [20, 744]),\n  ('variant scenario 2', (1000, '8.66', []), [0, 8660])],\n [('control no withdrawal', (1000, '5.00', []), [0, 5000]),\n  ('boundary price on band limit', (1000, '5.00', ['2.50']), [40, 3400]),\n  ('control long-shot withdrawal', (1000, '5.00', ['21.00']), [0, 5000]),\n  ('boundary cap at 75', (1000, '3.00', ['1.50', '1.50']), [75, 1500]),\n  ('control two withdrawals', (1000, '3.00', ['4.00', '6.00']), [40, 2200]),\n  ('regression: deduction base', (500, '3.28', ['17.50', '17.84', '5.27']), [15, 1469]),\n  ('variant scenario 1', (500, '6.94', ['5.00', '6.50', '19.18']), [35, 2430]),\n  ('variant scenario 2', (500, '7.47', ['14.89', '3.00', '1.30']), [75, 1308])],\n [('control no withdrawal', (1000, '5.00', []), [0, 5000]),\n  ('boundary price on band limit', (1000, '5.00', ['2.50']), [40, 3400]),\n  ('control long-shot withdrawal', (1000, '5.00', ['21.00']), [0, 5000]),\n  ('boundary cap at 75', (1000, '3.00', ['1.50', '1.50']), [75, 1500]),\n  ('control two withdrawals', (1000, '3.00', ['4.00', '6.00']), [40, 2200]),\n  ('regression: deduction base', (1000, '7.16', ['16.19', '5.05', '2.50']), [55, 3772]),\n  ('variant scenario 1', (250, '11.49', ['2.75', '1.40', '12.13']), [75, 905]),\n  ('variant scenario 2', (1000, '5.49', []), [0, 5490])],\n [('control no withdrawal', (1000, '5.00', []), [0, 5000]),\n  ('boundary price on band limit', (1000, '5.00', ['2.50']), [40, 3400]),\n  ('control long-shot withdrawal', (1000, '5.00', ['21.00']), [0, 5000]),\n  ('boundary cap at 75', (1000, '3.00', ['1.50', '1.50']), [75, 1500]),\n  ('control two withdrawals', (1000, '3.00', ['4.00', '6.00']), [40, 2200]),\n  ('regression: deduction base', (250, '11.85', ['6.50']), [15, 2555]),\n  ('variant scenario 1', (500, '7.88', ['15.89']), [0, 3940]),\n  ('variant scenario 2', (500, '10.66', ['1.80', '1.48', '2.50']), [75, 1707])]]\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-non-runner-deduction-deduction-base","generated_at":"2026-09-29T14:50:33.163989+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Racing settlement reduces winnings when a runner is withdrawn after prices were struck.","root_cause":"The deduction is applied to the whole return.","sha256":"b5956e3683f454304a9d014341fe51d4525c5763c338729cf5f0390e998acffb","title":"Deduction taken from the stake as well as the winnings · 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":45.748,"exit_code":1,"observations":[{"actual":[0,5000],"check":"control no withdrawal","expected":[0,5000],"passed":true},{"actual":[40,4600],"check":"boundary price on band limit","expected":[40,3400],"passed":false},{"actual":[0,5000],"check":"control long-shot withdrawal","expected":[0,5000],"passed":true},{"actual":[75,2250],"check":"boundary cap at 75","expected":[75,1500],"passed":false},{"actual":[40,2600],"check":"control two withdrawals","expected":[40,2200],"passed":false},{"actual":[75,9700],"check":"regression: deduction base","expected":[75,3362],"passed":false},{"actual":[0,1270],"check":"variant scenario 1","expected":[0,1270],"passed":true},{"actual":[0,2697],"check":"variant scenario 2","expected":[0,2697],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control no withdrawal\", \"actual\": [0, 5000], \"expected\": [0, 5000], \"passed\": true}, {\"check\": \"boundary price on band limit\", \"actual\": [40, 4600], \"expected\": [40, 3400], \"passed\": false}, {\"check\": \"control long-shot withdrawal\", \"actual\": [0, 5000], \"expected\": [0, 5000], \"passed\": true}, {\"check\": \"boundary cap at 75\", \"actual\": [75, 2250], \"expected\": [75, 1500], \"passed\": false}, {\"check\": \"control two withdrawals\", \"actual\": [40, 2600], \"expected\": [40, 2200], \"passed\": false}, {\"check\": \"regression: deduction base\", \"actual\": [75, 9700], \"expected\": [75, 3362], \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": [0, 1270], \"expected\": [0, 1270], \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": [0, 2697], \"expected\": [0, 2697], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":54.464,"exit_code":1,"observations":[{"actual":[0,5000],"check":"control no withdrawal","expected":[0,5000],"passed":true},{"actual":[40,3000],"check":"boundary price on band limit","expected":[40,3400],"passed":false},{"actual":[0,5000],"check":"control long-shot withdrawal","expected":[0,5000],"passed":true},{"actual":[75,750],"check":"boundary cap at 75","expected":[75,1500],"passed":false},{"actual":[40,1800],"check":"control two withdrawals","expected":[40,2200],"passed":false},{"actual":[75,2612],"check":"regression: deduction base","expected":[75,3362],"passed":false},{"actual":[0,1270],"check":"variant scenario 1","expected":[0,1270],"passed":true},{"actual":[0,2697],"check":"variant scenario 2","expected":[0,2697],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control no withdrawal\", \"actual\": [0, 5000], \"expected\": [0, 5000], \"passed\": true}, {\"check\": \"boundary price on band limit\", \"actual\": [40, 3000], \"expected\": [40, 3400], \"passed\": false}, {\"check\": \"control long-shot withdrawal\", \"actual\": [0, 5000], \"expected\": [0, 5000], \"passed\": true}, {\"check\": \"boundary cap at 75\", \"actual\": [75, 750], \"expected\": [75, 1500], \"passed\": false}, {\"check\": \"control two withdrawals\", \"actual\": [40, 1800], \"expected\": [40, 2200], \"passed\": false}, {\"check\": \"regression: deduction base\", \"actual\": [75, 2612], \"expected\": [75, 3362], \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": [0, 1270], \"expected\": [0, 1270], \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": [0, 2697], \"expected\": [0, 2697], \"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."}}