{"abstract":"Laying at 17 shows 1.062 instead of 1.063.","category":"Betting odds conversion","checks":8,"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":"Truncating to three decimals misreports values just below a boundary.","family":"w2-odds-conversion-lay-back-equivalence-third-decimal-rounding","id":"FA-84836","implementations":{"attempt":{"sha256":"2beea99b81c32357209a80781ca568e450ab20426b9a8879cb1abd9d30075888","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)\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: third decimal rounding', ('33', '5'), ['1.031', '1.030']),\n  ('regression: third decimal rounding', ('17', '2'), ['1.063', '1.061']),\n  ('variant scenario 1', ('9', '0'), ['1.125', '1.125']),\n  ('variant scenario 2', ('33', '6.5'), ['1.031', '1.029'])],\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: third decimal rounding', ('9', '6.5'), ['1.125', '1.117']),\n  ('regression: third decimal rounding', ('17', '6.5'), ['1.063', '1.058']),\n  ('variant scenario 1', ('2.00', '5'), ['2.000', '1.950']),\n  ('variant scenario 2', ('1.25', '0'), ['5.000', '5.000'])],\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: third decimal rounding', ('33', '2'), ['1.031', '1.031']),\n  ('regression: third decimal rounding', ('17', '5'), ['1.063', '1.059']),\n  ('variant scenario 1', ('9', '2'), ['1.125', '1.123']),\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: third decimal rounding', ('8.31', '5'), ['1.137', '1.130']),\n  ('regression: third decimal rounding', ('17', '2'), ['1.063', '1.061']),\n  ('variant scenario 1', ('33', '6.5'), ['1.031', '1.029']),\n  ('variant scenario 2', ('9', '2'), ['1.125', '1.123'])],\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: third decimal rounding', ('33', '5'), ['1.031', '1.030']),\n  ('regression: third decimal rounding', ('17', '5'), ['1.063', '1.059']),\n  ('variant scenario 1', ('9', '0'), ['1.125', '1.125']),\n  ('variant scenario 2', ('9', '6.5'), ['1.125', '1.117'])]]\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":"717c4c2b03ccd1fa48972e3308ea1ee281479a2a619a951bc6fdcbcf0cbd8a16","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        return '%.3f' % float(v)\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: third decimal rounding', ('33', '5'), ['1.031', '1.030']),\n  ('regression: third decimal rounding', ('17', '2'), ['1.063', '1.061']),\n  ('variant scenario 1', ('9', '0'), ['1.125', '1.125']),\n  ('variant scenario 2', ('33', '6.5'), ['1.031', '1.029'])],\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: third decimal rounding', ('9', '6.5'), ['1.125', '1.117']),\n  ('regression: third decimal rounding', ('17', '6.5'), ['1.063', '1.058']),\n  ('variant scenario 1', ('2.00', '5'), ['2.000', '1.950']),\n  ('variant scenario 2', ('1.25', '0'), ['5.000', '5.000'])],\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: third decimal rounding', ('33', '2'), ['1.031', '1.031']),\n  ('regression: third decimal rounding', ('17', '5'), ['1.063', '1.059']),\n  ('variant scenario 1', ('9', '2'), ['1.125', '1.123']),\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: third decimal rounding', ('8.31', '5'), ['1.137', '1.130']),\n  ('regression: third decimal rounding', ('17', '2'), ['1.063', '1.061']),\n  ('variant scenario 1', ('33', '6.5'), ['1.031', '1.029']),\n  ('variant scenario 2', ('9', '2'), ['1.125', '1.123'])],\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: third decimal rounding', ('33', '5'), ['1.031', '1.030']),\n  ('regression: third decimal rounding', ('17', '5'), ['1.063', '1.059']),\n  ('variant scenario 1', ('9', '0'), ['1.125', '1.125']),\n  ('variant scenario 2', ('9', '6.5'), ['1.125', '1.117'])]]\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":"6826e8ef12e8647f2e5a0fe9d0863c86d4bdafa6df9e4ee26d138481181169fa","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: third decimal rounding', ('33', '5'), ['1.031', '1.030']),\n  ('regression: third decimal rounding', ('17', '2'), ['1.063', '1.061']),\n  ('variant scenario 1', ('9', '0'), ['1.125', '1.125']),\n  ('variant scenario 2', ('33', '6.5'), ['1.031', '1.029'])],\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: third decimal rounding', ('9', '6.5'), ['1.125', '1.117']),\n  ('regression: third decimal rounding', ('17', '6.5'), ['1.063', '1.058']),\n  ('variant scenario 1', ('2.00', '5'), ['2.000', '1.950']),\n  ('variant scenario 2', ('1.25', '0'), ['5.000', '5.000'])],\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: third decimal rounding', ('33', '2'), ['1.031', '1.031']),\n  ('regression: third decimal rounding', ('17', '5'), ['1.063', '1.059']),\n  ('variant scenario 1', ('9', '2'), ['1.125', '1.123']),\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: third decimal rounding', ('8.31', '5'), ['1.137', '1.130']),\n  ('regression: third decimal rounding', ('17', '2'), ['1.063', '1.061']),\n  ('variant scenario 1', ('33', '6.5'), ['1.031', '1.029']),\n  ('variant scenario 2', ('9', '2'), ['1.125', '1.123'])],\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: third decimal rounding', ('33', '5'), ['1.031', '1.030']),\n  ('regression: third decimal rounding', ('17', '5'), ['1.063', '1.059']),\n  ('variant scenario 1', ('9', '0'), ['1.125', '1.125']),\n  ('variant scenario 2', ('9', '6.5'), ['1.125', '1.117'])]]\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-third-decimal-rounding","generated_at":"2026-09-29T14:50:34.684984+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":"Round the exact value half up.","root_cause":"The value is formatted with '%.3f' on a float.","sha256":"bee430ef6d5ffa6c339b11ae33fc911bf746afb2d008d41b48cb5cd2681fe64c","title":"Equivalent price rounded with binary floats or truncated · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.678,"exit_code":1,"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.062","1.062"],"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":["1.031","1.029"],"check":"regression: third decimal rounding","expected":["1.031","1.030"],"passed":false},{"actual":["1.062","1.061"],"check":"regression: third decimal rounding","expected":["1.063","1.061"],"passed":false},{"actual":["1.125","1.125"],"check":"variant scenario 1","expected":["1.125","1.125"],"passed":true},{"actual":["1.031","1.029"],"check":"variant scenario 2","expected":["1.031","1.029"],"passed":true}],"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.900\"], \"expected\": [\"3.000\", \"2.900\"], \"passed\": true}, {\"check\": \"boundary half-up third decimal\", \"actual\": [\"1.062\", \"1.062\"], \"expected\": [\"1.063\", \"1.063\"], \"passed\": false}, {\"check\": \"boundary no-profit lay\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"regression: third decimal rounding\", \"actual\": [\"1.031\", \"1.029\"], \"expected\": [\"1.031\", \"1.030\"], \"passed\": false}, {\"check\": \"regression: third decimal rounding\", \"actual\": [\"1.062\", \"1.061\"], \"expected\": [\"1.063\", \"1.061\"], \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": [\"1.125\", \"1.125\"], \"expected\": [\"1.125\", \"1.125\"], \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": [\"1.031\", \"1.029\"], \"expected\": [\"1.031\", \"1.029\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.748,"exit_code":1,"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.062","1.062"],"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":["1.031","1.030"],"check":"regression: third decimal rounding","expected":["1.031","1.030"],"passed":true},{"actual":["1.062","1.061"],"check":"regression: third decimal rounding","expected":["1.063","1.061"],"passed":false},{"actual":["1.125","1.125"],"check":"variant scenario 1","expected":["1.125","1.125"],"passed":true},{"actual":["1.031","1.029"],"check":"variant scenario 2","expected":["1.031","1.029"],"passed":true}],"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.900\"], \"expected\": [\"3.000\", \"2.900\"], \"passed\": true}, {\"check\": \"boundary half-up third decimal\", \"actual\": [\"1.062\", \"1.062\"], \"expected\": [\"1.063\", \"1.063\"], \"passed\": false}, {\"check\": \"boundary no-profit lay\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"regression: third decimal rounding\", \"actual\": [\"1.031\", \"1.030\"], \"expected\": [\"1.031\", \"1.030\"], \"passed\": true}, {\"check\": \"regression: third decimal rounding\", \"actual\": [\"1.062\", \"1.061\"], \"expected\": [\"1.063\", \"1.061\"], \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": [\"1.125\", \"1.125\"], \"expected\": [\"1.125\", \"1.125\"], \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": [\"1.031\", \"1.029\"], \"expected\": [\"1.031\", \"1.029\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":45.205,"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":["1.031","1.030"],"check":"regression: third decimal rounding","expected":["1.031","1.030"],"passed":true},{"actual":["1.063","1.061"],"check":"regression: third decimal rounding","expected":["1.063","1.061"],"passed":true},{"actual":["1.125","1.125"],"check":"variant scenario 1","expected":["1.125","1.125"],"passed":true},{"actual":["1.031","1.029"],"check":"variant scenario 2","expected":["1.031","1.029"],"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: third decimal rounding\", \"actual\": [\"1.031\", \"1.030\"], \"expected\": [\"1.031\", \"1.030\"], \"passed\": true}, {\"check\": \"regression: third decimal rounding\", \"actual\": [\"1.063\", \"1.061\"], \"expected\": [\"1.063\", \"1.061\"], \"passed\": true}, {\"check\": \"variant scenario 1\", \"actual\": [\"1.125\", \"1.125\"], \"expected\": [\"1.125\", \"1.125\"], \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": [\"1.031\", \"1.029\"], \"expected\": [\"1.031\", \"1.029\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}