{"abstract":"Laying at 3.00 is shown as backing the field at 2.00.","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.","evaluation_group":"w2-odds-conversion-lay-back-equivalence","failed_approach":"Using 1 / (L - 1) gives the fractional odds of the field without the returned stake.","family":"w2-odds-conversion-lay-back-equivalence-equivalence-formula","id":"FA-84826","implementations":{"attempt":{"sha256":"93635c2c1275c29e1e8ec5da041e2f83b2d15da436a982c1d445da73e55f4eb0","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 = 1 / (L - 1)\n    eff = 1 + (eq - 1) * (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: equivalence formula', ('1.25', '0'), ['5.000', '5.000']),\n  ('variant scenario 1', ('17', '2'), ['1.063', '1.061']),\n  ('variant scenario 2', ('17', '5'), ['1.063', '1.059'])],\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: equivalence formula', ('1.25', '5'), ['5.000', '4.800']),\n  ('variant scenario 1', ('17', '6.5'), ['1.063', '1.058']),\n  ('variant scenario 2', ('2.00', '5'), ['2.000', '1.950'])],\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: equivalence formula', ('1.58', '2'), ['2.724', '2.690']),\n  ('variant scenario 1', ('5.64', '2'), ['1.216', '1.211']),\n  ('variant scenario 2', ('9', '0'), ['1.125', '1.125'])],\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: equivalence formula', ('33', '2'), ['1.031', '1.031']),\n  ('variant scenario 1', ('1.25', '6.5'), ['5.000', '4.740']),\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: equivalence formula', ('17', '6.5'), ['1.063', '1.058']),\n  ('variant scenario 1', ('33', '0'), ['1.031', '1.031']),\n  ('variant scenario 2', ('17', '5'), ['1.063', '1.059'])]]\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":"1b6e5cb727ae19fea840b911fd758b8aaeac2245a9eb94e1c8cc490e297885cd","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 - 1\n    eff = 1 + (eq - 1) * (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: equivalence formula', ('1.25', '0'), ['5.000', '5.000']),\n  ('variant scenario 1', ('17', '2'), ['1.063', '1.061']),\n  ('variant scenario 2', ('17', '5'), ['1.063', '1.059'])],\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: equivalence formula', ('1.25', '5'), ['5.000', '4.800']),\n  ('variant scenario 1', ('17', '6.5'), ['1.063', '1.058']),\n  ('variant scenario 2', ('2.00', '5'), ['2.000', '1.950'])],\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: equivalence formula', ('1.58', '2'), ['2.724', '2.690']),\n  ('variant scenario 1', ('5.64', '2'), ['1.216', '1.211']),\n  ('variant scenario 2', ('9', '0'), ['1.125', '1.125'])],\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: equivalence formula', ('33', '2'), ['1.031', '1.031']),\n  ('variant scenario 1', ('1.25', '6.5'), ['5.000', '4.740']),\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: equivalence formula', ('17', '6.5'), ['1.063', '1.058']),\n  ('variant scenario 1', ('33', '0'), ['1.031', '1.031']),\n  ('variant scenario 2', ('17', '5'), ['1.063', '1.059'])]]\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":"63268498bb430bcfd610fd9a79f800e246a07f4f3fdcdb5eb3f5a32dce591549","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 = 1 + (eq - 1) * (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: equivalence formula', ('1.25', '0'), ['5.000', '5.000']),\n  ('variant scenario 1', ('17', '2'), ['1.063', '1.061']),\n  ('variant scenario 2', ('17', '5'), ['1.063', '1.059'])],\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: equivalence formula', ('1.25', '5'), ['5.000', '4.800']),\n  ('variant scenario 1', ('17', '6.5'), ['1.063', '1.058']),\n  ('variant scenario 2', ('2.00', '5'), ['2.000', '1.950'])],\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: equivalence formula', ('1.58', '2'), ['2.724', '2.690']),\n  ('variant scenario 1', ('5.64', '2'), ['1.216', '1.211']),\n  ('variant scenario 2', ('9', '0'), ['1.125', '1.125'])],\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: equivalence formula', ('33', '2'), ['1.031', '1.031']),\n  ('variant scenario 1', ('1.25', '6.5'), ['5.000', '4.740']),\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: equivalence formula', ('17', '6.5'), ['1.063', '1.058']),\n  ('variant scenario 1', ('33', '0'), ['1.031', '1.031']),\n  ('variant scenario 2', ('17', '5'), ['1.063', '1.059'])]]\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-equivalence-formula","generated_at":"2026-09-29T14:50:34.682970+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.","repair":"Use L / (L - 1).","root_cause":"The equivalent price is computed as L - 1.","sha256":"5c70e5f825175a8e886f03268f66e3f7aed45241e24c18cec924769b8696e127","title":"Lay price converted with the profit instead of the ratio · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.261,"exit_code":1,"observations":[{"actual":["1.000","1.000"],"check":"control lay evens","expected":["2.000","2.000"],"passed":false},{"actual":["2.000","1.950"],"check":"control lay favourite","expected":["3.000","2.900"],"passed":false},{"actual":["0.063","0.063"],"check":"boundary half-up third decimal","expected":["1.063","1.063"],"passed":false},{"actual":"invalid","check":"boundary no-profit lay","expected":"invalid","passed":true},{"actual":["4.000","4.000"],"check":"regression: equivalence formula","expected":["5.000","5.000"],"passed":false},{"actual":["0.063","0.081"],"check":"variant scenario 1","expected":["1.063","1.061"],"passed":false},{"actual":["0.063","0.109"],"check":"variant scenario 2","expected":["1.063","1.059"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control lay evens\", \"actual\": [\"1.000\", \"1.000\"], \"expected\": [\"2.000\", \"2.000\"], \"passed\": false}, {\"check\": \"control lay favourite\", \"actual\": [\"2.000\", \"1.950\"], \"expected\": [\"3.000\", \"2.900\"], \"passed\": false}, {\"check\": \"boundary half-up third decimal\", \"actual\": [\"0.063\", \"0.063\"], \"expected\": [\"1.063\", \"1.063\"], \"passed\": false}, {\"check\": \"boundary no-profit lay\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"regression: equivalence formula\", \"actual\": [\"4.000\", \"4.000\"], \"expected\": [\"5.000\", \"5.000\"], \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": [\"0.063\", \"0.081\"], \"expected\": [\"1.063\", \"1.061\"], \"passed\": false}, {\"check\": \"variant scenario 2\", \"actual\": [\"0.063\", \"0.109\"], \"expected\": [\"1.063\", \"1.059\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.132,"exit_code":1,"observations":[{"actual":["1.000","1.000"],"check":"control lay evens","expected":["2.000","2.000"],"passed":false},{"actual":["0.500","0.525"],"check":"control lay favourite","expected":["3.000","2.900"],"passed":false},{"actual":["16.000","16.000"],"check":"boundary half-up third decimal","expected":["1.063","1.063"],"passed":false},{"actual":"invalid","check":"boundary no-profit lay","expected":"invalid","passed":true},{"actual":["0.250","0.250"],"check":"regression: equivalence formula","expected":["5.000","5.000"],"passed":false},{"actual":["16.000","15.700"],"check":"variant scenario 1","expected":["1.063","1.061"],"passed":false},{"actual":["16.000","15.250"],"check":"variant scenario 2","expected":["1.063","1.059"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control lay evens\", \"actual\": [\"1.000\", \"1.000\"], \"expected\": [\"2.000\", \"2.000\"], \"passed\": false}, {\"check\": \"control lay favourite\", \"actual\": [\"0.500\", \"0.525\"], \"expected\": [\"3.000\", \"2.900\"], \"passed\": false}, {\"check\": \"boundary half-up third decimal\", \"actual\": [\"16.000\", \"16.000\"], \"expected\": [\"1.063\", \"1.063\"], \"passed\": false}, {\"check\": \"boundary no-profit lay\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"regression: equivalence formula\", \"actual\": [\"0.250\", \"0.250\"], \"expected\": [\"5.000\", \"5.000\"], \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": [\"16.000\", \"15.700\"], \"expected\": [\"1.063\", \"1.061\"], \"passed\": false}, {\"check\": \"variant scenario 2\", \"actual\": [\"16.000\", \"15.250\"], \"expected\": [\"1.063\", \"1.059\"], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.208,"exit_code":0,"observations":[{"actual":["2.000","2.000"],"check":"control lay evens","expected":["2.000","2.000"],"passed":true},{"actual":["3.000","2.900"],"check":"control lay favourite","expected":["3.000","2.900"],"passed":true},{"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":["5.000","5.000"],"check":"regression: equivalence formula","expected":["5.000","5.000"],"passed":true},{"actual":["1.063","1.061"],"check":"variant scenario 1","expected":["1.063","1.061"],"passed":true},{"actual":["1.063","1.059"],"check":"variant scenario 2","expected":["1.063","1.059"],"passed":true}],"passed":true,"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.900\"], \"expected\": [\"3.000\", \"2.900\"], \"passed\": true}, {\"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: equivalence formula\", \"actual\": [\"5.000\", \"5.000\"], \"expected\": [\"5.000\", \"5.000\"], \"passed\": true}, {\"check\": \"variant scenario 1\", \"actual\": [\"1.063\", \"1.061\"], \"expected\": [\"1.063\", \"1.061\"], \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": [\"1.063\", \"1.059\"], \"expected\": [\"1.063\", \"1.059\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}