{"abstract":"Effective prices are reduced by commission on the stake as well as winnings.","category":"Betting odds conversion","checks":7,"contract":"Laying a selection at price L (> 1, else \"invalid\") is equivalent to backing \"not this selection\" at L / (L - 1). After exchange commission c percent on winnings, the effective price is 1 + (equivalent - 1) * (100 - c) / 100. Return both, rounded half up to three decimals.","contract_signature":"lay_price, commission_pct","evaluation_group":"w2-odds-conversion-lay-back-equivalence","failed_approach":"Subtracting the commission rate as price points does not scale with the winnings.","family":"w2-odds-conversion-lay-back-equivalence-commission-scope","id":"FA-84831","implementations":{"attempt":{"sha256":"c827713c1e0f949f43e823032372b14fea632a3df43b1df714ac91e4a5138a11","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(lay_price, commission_pct):\n    L = Fraction(lay_price)\n    if L <= 1:\n        return 'invalid'\n    eq = L / (L - 1)\n    eff = eq - Fraction(commission_pct) / 100\n    def fmt(v):\n        c = math.floor(v * 1000 + Fraction(1, 2))\n        return '%d.%03d' % (c // 1000, c % 1000)\n    return [fmt(eq), fmt(eff)]\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 lay evens', ('2.00', '0'), ['2.000', '2.000']),\n  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),\n  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),\n  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),\n  ('regression: commission scope', ('8.46', '6.5'), ['1.134', '1.125']),\n  ('variant scenario 1', ('33', '0'), ['1.031', '1.031']),\n  ('variant scenario 2', ('9', '6.5'), ['1.125', '1.117'])],\n [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),\n  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),\n  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),\n  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),\n  ('regression: commission scope', ('9', '2'), ['1.125', '1.123']),\n  ('variant scenario 1', ('17', '0'), ['1.063', '1.063']),\n  ('variant scenario 2', ('5.35', '2'), ['1.230', '1.225'])],\n [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),\n  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),\n  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),\n  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),\n  ('regression: commission scope', ('1.25', '6.5'), ['5.000', '4.740']),\n  ('variant scenario 1', ('1.25', '5'), ['5.000', '4.800']),\n  ('variant scenario 2', ('2.03', '0'), ['1.971', '1.971'])],\n [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),\n  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),\n  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),\n  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),\n  ('regression: commission scope', ('9', '6.5'), ['1.125', '1.117']),\n  ('variant scenario 1', ('1.99', '5'), ['2.010', '1.960']),\n  ('variant scenario 2', ('33', '5'), ['1.031', '1.030'])],\n [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),\n  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),\n  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),\n  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),\n  ('regression: commission scope', ('1.25', '2'), ['5.000', '4.920']),\n  ('variant scenario 1', ('33', '2'), ['1.031', '1.031']),\n  ('variant scenario 2', ('9', '5'), ['1.125', '1.119'])]]\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":"f93540988c9fae8701ff38f1719450cc3d51427794cca959e3332a8c999ad8f8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(lay_price, commission_pct):\n    L = Fraction(lay_price)\n    if L <= 1:\n        return 'invalid'\n    eq = L / (L - 1)\n    eff = eq * (100 - Fraction(commission_pct)) / 100\n    def fmt(v):\n        c = math.floor(v * 1000 + Fraction(1, 2))\n        return '%d.%03d' % (c // 1000, c % 1000)\n    return [fmt(eq), fmt(eff)]\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 lay evens', ('2.00', '0'), ['2.000', '2.000']),\n  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),\n  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),\n  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),\n  ('regression: commission scope', ('8.46', '6.5'), ['1.134', '1.125']),\n  ('variant scenario 1', ('33', '0'), ['1.031', '1.031']),\n  ('variant scenario 2', ('9', '6.5'), ['1.125', '1.117'])],\n [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),\n  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),\n  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),\n  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),\n  ('regression: commission scope', ('9', '2'), ['1.125', '1.123']),\n  ('variant scenario 1', ('17', '0'), ['1.063', '1.063']),\n  ('variant scenario 2', ('5.35', '2'), ['1.230', '1.225'])],\n [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),\n  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),\n  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),\n  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),\n  ('regression: commission scope', ('1.25', '6.5'), ['5.000', '4.740']),\n  ('variant scenario 1', ('1.25', '5'), ['5.000', '4.800']),\n  ('variant scenario 2', ('2.03', '0'), ['1.971', '1.971'])],\n [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),\n  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),\n  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),\n  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),\n  ('regression: commission scope', ('9', '6.5'), ['1.125', '1.117']),\n  ('variant scenario 1', ('1.99', '5'), ['2.010', '1.960']),\n  ('variant scenario 2', ('33', '5'), ['1.031', '1.030'])],\n [('control lay evens', ('2.00', '0'), ['2.000', '2.000']),\n  ('control lay favourite', ('1.50', '5'), ['3.000', '2.900']),\n  ('boundary half-up third decimal', ('17', '0'), ['1.063', '1.063']),\n  ('boundary no-profit lay', ('1.00', '5'), 'invalid'),\n  ('regression: commission scope', ('1.25', '2'), ['5.000', '4.920']),\n  ('variant scenario 1', ('33', '2'), ['1.031', '1.031']),\n  ('variant scenario 2', ('9', '5'), ['1.125', '1.119'])]]\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-lay-back-equivalence-commission-scope","generated_at":"2026-09-29T14:50:34.685796+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Matched-betting and trading calculators compare lay prices with bookmaker back prices.","root_cause":"Commission multiplies the full equivalent price.","sha256":"2669ae389e49dfc73e0e5174813e6f3a64e9d97e08a9827a8afc567c1f3b44d0","title":"Commission deducted from the whole price · 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":41.247,"exit_code":1,"observations":[{"actual":["2.000","2.000"],"check":"control lay evens","expected":["2.000","2.000"],"passed":true},{"actual":["3.000","2.950"],"check":"control lay favourite","expected":["3.000","2.900"],"passed":false},{"actual":["1.063","1.063"],"check":"boundary half-up third decimal","expected":["1.063","1.063"],"passed":true},{"actual":"invalid","check":"boundary no-profit lay","expected":"invalid","passed":true},{"actual":["1.134","1.069"],"check":"regression: commission scope","expected":["1.134","1.125"],"passed":false},{"actual":["1.031","1.031"],"check":"variant scenario 1","expected":["1.031","1.031"],"passed":true},{"actual":["1.125","1.060"],"check":"variant scenario 2","expected":["1.125","1.117"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control lay evens\", \"actual\": [\"2.000\", \"2.000\"], \"expected\": [\"2.000\", \"2.000\"], \"passed\": true}, {\"check\": \"control lay favourite\", \"actual\": [\"3.000\", \"2.950\"], \"expected\": [\"3.000\", \"2.900\"], \"passed\": false}, {\"check\": \"boundary half-up third decimal\", \"actual\": [\"1.063\", \"1.063\"], \"expected\": [\"1.063\", \"1.063\"], \"passed\": true}, {\"check\": \"boundary no-profit lay\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"regression: commission scope\", \"actual\": [\"1.134\", \"1.069\"], \"expected\": [\"1.134\", \"1.125\"], \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": [\"1.031\", \"1.031\"], \"expected\": [\"1.031\", \"1.031\"], \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": [\"1.125\", \"1.060\"], \"expected\": [\"1.125\", \"1.117\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.795,"exit_code":1,"observations":[{"actual":["2.000","2.000"],"check":"control lay evens","expected":["2.000","2.000"],"passed":true},{"actual":["3.000","2.850"],"check":"control lay favourite","expected":["3.000","2.900"],"passed":false},{"actual":["1.063","1.063"],"check":"boundary half-up third decimal","expected":["1.063","1.063"],"passed":true},{"actual":"invalid","check":"boundary no-profit lay","expected":"invalid","passed":true},{"actual":["1.134","1.060"],"check":"regression: commission scope","expected":["1.134","1.125"],"passed":false},{"actual":["1.031","1.031"],"check":"variant scenario 1","expected":["1.031","1.031"],"passed":true},{"actual":["1.125","1.052"],"check":"variant scenario 2","expected":["1.125","1.117"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control lay evens\", \"actual\": [\"2.000\", \"2.000\"], \"expected\": [\"2.000\", \"2.000\"], \"passed\": true}, {\"check\": \"control lay favourite\", \"actual\": [\"3.000\", \"2.850\"], \"expected\": [\"3.000\", \"2.900\"], \"passed\": false}, {\"check\": \"boundary half-up third decimal\", \"actual\": [\"1.063\", \"1.063\"], \"expected\": [\"1.063\", \"1.063\"], \"passed\": true}, {\"check\": \"boundary no-profit lay\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"regression: commission scope\", \"actual\": [\"1.134\", \"1.060\"], \"expected\": [\"1.134\", \"1.125\"], \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": [\"1.031\", \"1.031\"], \"expected\": [\"1.031\", \"1.031\"], \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": [\"1.125\", \"1.052\"], \"expected\": [\"1.125\", \"1.117\"], \"passed\": false}], \"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."}}