FA-84416 / Betting odds conversion / Open access
Fair prices shortened instead of lengthened · case 01
No-vig prices come out shorter than the quoted prices.
ROOT CAUSE
Fair prices divide by the book instead of multiplying.
VERIFIED REPAIR
Multiply each price by the book sum.
Unsuccessful approach: Adding the overround as a flat amount is the additive method, not proportional removal.
Case contract
Market book analysis for decimal prices (strings, each > 1, else "invalid"). Implied probability is 1/d; book = sum of implied probabilities. Return [overround percent (book - 1) * 100, bookmaker margin percent (1 - 1/book) * 100, fair prices d * book for proportional margin removal], every number rounded half up to two decimals (negative values are rounded toward +infinity at the half) and formatted with two decimals.
Why this case matters
Trading tools report overround and margin separately and derive no-vig fair prices.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(prices):
def fmt(x):
c = math.floor(x * 100 + Fraction(1, 2))
sign = '-' if c < 0 else ''
c = abs(c)
return sign + '%d.%02d' % (c // 100, c % 100)
ds = [Fraction(p) for p in prices]
if any(d <= 1 for d in ds):
return 'invalid'
book = sum(1 / d for d in ds)
over = (book - 1) * 100
margin = (1 - 1 / book) * 100
fair = [fmt(d / book) for d in ds]
return [fmt(over), fmt(margin), fair]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
try:
return solve(*args)
except Exception as exc:
return 'raised ' + type(exc).__name__
cases = [[('control fair coin', (['2.00', '2.00'],), ['0.00', '0.00', ['2.00', '2.00']]),
('control standard juice', (['1.91', '1.91'],), ['4.71', '4.50', ['2.00', '2.00']]),
('boundary three-way', (['2.50', '3.20', '2.90'],), ['5.73', '5.42', ['2.64', '3.38', '3.07']]),
('boundary no-profit price', (['1.00', '5.00'],), 'invalid'),
('regression: fair price direction',
(['4.28', '3.78', '1.86'],),
['3.58', '3.46', ['4.43', '3.92', '1.93']]),
('variant scenario 1',
(['2.38', '9.10', '1.69'],),
['12.18', '10.86', ['2.67', '10.21', '1.90']]),
('variant scenario 2', (['3.25', '2.80', '2.78'],), ['2.45', '2.40', ['3.33', '2.87', '2.85']])],
[('control fair coin', (['2.00', '2.00'],), ['0.00', '0.00', ['2.00', '2.00']]),
('control standard juice', (['1.91', '1.91'],), ['4.71', '4.50', ['2.00', '2.00']]),
('boundary three-way', (['2.50', '3.20', '2.90'],), ['5.73', '5.42', ['2.64', '3.38', '3.07']]),
('boundary no-profit price', (['1.00', '5.00'],), 'invalid'),
('regression: fair price direction',
(['4.98', '3.07', '3.86', '5.09'],),
['-1.79', '-1.83', ['4.89', '3.01', '3.79', '5.00']]),
('variant scenario 1', (['2.65', '9.18', '1.83'],), ['3.27', '3.17', ['2.74', '9.48', '1.89']]),
('variant scenario 2', (['2.11', '4.77', '2.91'],), ['2.72', '2.65', ['2.17', '4.90', '2.99']])],
[('control fair coin', (['2.00', '2.00'],), ['0.00', '0.00', ['2.00', '2.00']]),
('control standard juice', (['1.91', '1.91'],), ['4.71', '4.50', ['2.00', '2.00']]),
('boundary three-way', (['2.50', '3.20', '2.90'],), ['5.73', '5.42', ['2.64', '3.38', '3.07']]),
('boundary no-profit price', (['1.00', '5.00'],), 'invalid'),
('regression: fair price direction', (['1.36', '3.90'],), ['-0.83', '-0.84', ['1.35', '3.87']]),
('variant scenario 1', (['1.12', '6.59'],), ['4.46', '4.27', ['1.17', '6.88']]),
('variant scenario 2', (['1.86', '1.65'],), ['14.37', '12.56', ['2.13', '1.89']])],
[('control fair coin', (['2.00', '2.00'],), ['0.00', '0.00', ['2.00', '2.00']]),
('control standard juice', (['1.91', '1.91'],), ['4.71', '4.50', ['2.00', '2.00']]),
('boundary three-way', (['2.50', '3.20', '2.90'],), ['5.73', '5.42', ['2.64', '3.38', '3.07']]),
('boundary no-profit price', (['1.00', '5.00'],), 'invalid'),
('regression: fair price direction', (['1.99', '1.97'],), ['1.01', '1.00', ['2.01', '1.99']]),
('variant scenario 1', (['2.21', '2.07', '7.52'],), ['6.86', '6.42', ['2.36', '2.21', '8.04']]),
('variant scenario 2', (['1.37', '3.08'],), ['5.46', '5.18', ['1.44', '3.25']])],
[('control fair coin', (['2.00', '2.00'],), ['0.00', '0.00', ['2.00', '2.00']]),
('control standard juice', (['1.91', '1.91'],), ['4.71', '4.50', ['2.00', '2.00']]),
('boundary three-way', (['2.50', '3.20', '2.90'],), ['5.73', '5.42', ['2.64', '3.38', '3.07']]),
('boundary no-profit price', (['1.00', '5.00'],), 'invalid'),
('regression: fair price direction',
(['1.67', '6.50', '3.71'],),
['2.22', '2.17', ['1.71', '6.64', '3.79']]),
('variant scenario 1', (['5.20', '1.15'],), ['6.19', '5.83', ['5.52', '1.22']]),
('variant scenario 2',
(['7.11', '3.30', '9.10', '2.32'],),
['-1.54', '-1.56', ['7.00', '3.25', '8.96', '2.28']])]]
for label, args, expected in cases[N - 1]:
check(label, run(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| control fair coin | ['0.00', '0.00', ['2.00', '2.00']] | ['0.00', '0.00', ['2.00', '2.00']] | Passed |
| control standard juice | ['4.71', '4.50', ['1.82', '1.82']] | ['4.71', '4.50', ['2.00', '2.00']] | Failed |
| boundary three-way | ['5.73', '5.42', ['2.36', '3.03', '2.74']] | ['5.73', '5.42', ['2.64', '3.38', '3.07']] | Failed |
| boundary no-profit price | invalid | invalid | Passed |
| regression: fair price direction | ['3.58', '3.46', ['4.13', '3.65', '1.80']] | ['3.58', '3.46', ['4.43', '3.92', '1.93']] | Failed |
| variant scenario 1 | ['12.18', '10.86', ['2.12', '8.11', '1.51']] | ['12.18', '10.86', ['2.67', '10.21', '1.90']] | Failed |
| variant scenario 2 | ['2.45', '2.40', ['3.17', '2.73', '2.71']] | ['2.45', '2.40', ['3.33', '2.87', '2.85']] | Failed |
SHA-256 / a0c4f28a22862f0a4962b90db32ff8391d250457b393d0cc761f15b8c6e67cdd
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(prices):
def fmt(x):
c = math.floor(x * 100 + Fraction(1, 2))
sign = '-' if c < 0 else ''
c = abs(c)
return sign + '%d.%02d' % (c // 100, c % 100)
ds = [Fraction(p) for p in prices]
if any(d <= 1 for d in ds):
return 'invalid'
book = sum(1 / d for d in ds)
over = (book - 1) * 100
margin = (1 - 1 / book) * 100
fair = [fmt(d + (book - 1)) for d in ds]
return [fmt(over), fmt(margin), fair]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
try:
return solve(*args)
except Exception as exc:
return 'raised ' + type(exc).__name__
cases = [[('control fair coin', (['2.00', '2.00'],), ['0.00', '0.00', ['2.00', '2.00']]),
('control standard juice', (['1.91', '1.91'],), ['4.71', '4.50', ['2.00', '2.00']]),
('boundary three-way', (['2.50', '3.20', '2.90'],), ['5.73', '5.42', ['2.64', '3.38', '3.07']]),
('boundary no-profit price', (['1.00', '5.00'],), 'invalid'),
('regression: fair price direction',
(['4.28', '3.78', '1.86'],),
['3.58', '3.46', ['4.43', '3.92', '1.93']]),
('variant scenario 1',
(['2.38', '9.10', '1.69'],),
['12.18', '10.86', ['2.67', '10.21', '1.90']]),
('variant scenario 2', (['3.25', '2.80', '2.78'],), ['2.45', '2.40', ['3.33', '2.87', '2.85']])],
[('control fair coin', (['2.00', '2.00'],), ['0.00', '0.00', ['2.00', '2.00']]),
('control standard juice', (['1.91', '1.91'],), ['4.71', '4.50', ['2.00', '2.00']]),
('boundary three-way', (['2.50', '3.20', '2.90'],), ['5.73', '5.42', ['2.64', '3.38', '3.07']]),
('boundary no-profit price', (['1.00', '5.00'],), 'invalid'),
('regression: fair price direction',
(['4.98', '3.07', '3.86', '5.09'],),
['-1.79', '-1.83', ['4.89', '3.01', '3.79', '5.00']]),
('variant scenario 1', (['2.65', '9.18', '1.83'],), ['3.27', '3.17', ['2.74', '9.48', '1.89']]),
('variant scenario 2', (['2.11', '4.77', '2.91'],), ['2.72', '2.65', ['2.17', '4.90', '2.99']])],
[('control fair coin', (['2.00', '2.00'],), ['0.00', '0.00', ['2.00', '2.00']]),
('control standard juice', (['1.91', '1.91'],), ['4.71', '4.50', ['2.00', '2.00']]),
('boundary three-way', (['2.50', '3.20', '2.90'],), ['5.73', '5.42', ['2.64', '3.38', '3.07']]),
('boundary no-profit price', (['1.00', '5.00'],), 'invalid'),
('regression: fair price direction', (['1.36', '3.90'],), ['-0.83', '-0.84', ['1.35', '3.87']]),
('variant scenario 1', (['1.12', '6.59'],), ['4.46', '4.27', ['1.17', '6.88']]),
('variant scenario 2', (['1.86', '1.65'],), ['14.37', '12.56', ['2.13', '1.89']])],
[('control fair coin', (['2.00', '2.00'],), ['0.00', '0.00', ['2.00', '2.00']]),
('control standard juice', (['1.91', '1.91'],), ['4.71', '4.50', ['2.00', '2.00']]),
('boundary three-way', (['2.50', '3.20', '2.90'],), ['5.73', '5.42', ['2.64', '3.38', '3.07']]),
('boundary no-profit price', (['1.00', '5.00'],), 'invalid'),
('regression: fair price direction', (['1.99', '1.97'],), ['1.01', '1.00', ['2.01', '1.99']]),
('variant scenario 1', (['2.21', '2.07', '7.52'],), ['6.86', '6.42', ['2.36', '2.21', '8.04']]),
('variant scenario 2', (['1.37', '3.08'],), ['5.46', '5.18', ['1.44', '3.25']])],
[('control fair coin', (['2.00', '2.00'],), ['0.00', '0.00', ['2.00', '2.00']]),
('control standard juice', (['1.91', '1.91'],), ['4.71', '4.50', ['2.00', '2.00']]),
('boundary three-way', (['2.50', '3.20', '2.90'],), ['5.73', '5.42', ['2.64', '3.38', '3.07']]),
('boundary no-profit price', (['1.00', '5.00'],), 'invalid'),
('regression: fair price direction',
(['1.67', '6.50', '3.71'],),
['2.22', '2.17', ['1.71', '6.64', '3.79']]),
('variant scenario 1', (['5.20', '1.15'],), ['6.19', '5.83', ['5.52', '1.22']]),
('variant scenario 2',
(['7.11', '3.30', '9.10', '2.32'],),
['-1.54', '-1.56', ['7.00', '3.25', '8.96', '2.28']])]]
for label, args, expected in cases[N - 1]:
check(label, run(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| control fair coin | ['0.00', '0.00', ['2.00', '2.00']] | ['0.00', '0.00', ['2.00', '2.00']] | Passed |
| control standard juice | ['4.71', '4.50', ['1.96', '1.96']] | ['4.71', '4.50', ['2.00', '2.00']] | Failed |
| boundary three-way | ['5.73', '5.42', ['2.56', '3.26', '2.96']] | ['5.73', '5.42', ['2.64', '3.38', '3.07']] | Failed |
| boundary no-profit price | invalid | invalid | Passed |
| regression: fair price direction | ['3.58', '3.46', ['4.32', '3.82', '1.90']] | ['3.58', '3.46', ['4.43', '3.92', '1.93']] | Failed |
| variant scenario 1 | ['12.18', '10.86', ['2.50', '9.22', '1.81']] | ['12.18', '10.86', ['2.67', '10.21', '1.90']] | Failed |
| variant scenario 2 | ['2.45', '2.40', ['3.27', '2.82', '2.80']] | ['2.45', '2.40', ['3.33', '2.87', '2.85']] | Failed |
SHA-256 / 53cab83fc5458a98fc6ed5f34c84e520a1b0bb1bd63a6bf29da9bd9e0a9e9e90
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(prices):
def fmt(x):
c = math.floor(x * 100 + Fraction(1, 2))
sign = '-' if c < 0 else ''
c = abs(c)
return sign + '%d.%02d' % (c // 100, c % 100)
ds = [Fraction(p) for p in prices]
if any(d <= 1 for d in ds):
return 'invalid'
book = sum(1 / d for d in ds)
over = (book - 1) * 100
margin = (1 - 1 / book) * 100
fair = [fmt(d * book) for d in ds]
return [fmt(over), fmt(margin), fair]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
try:
return solve(*args)
except Exception as exc:
return 'raised ' + type(exc).__name__
cases = [[('control fair coin', (['2.00', '2.00'],), ['0.00', '0.00', ['2.00', '2.00']]),
('control standard juice', (['1.91', '1.91'],), ['4.71', '4.50', ['2.00', '2.00']]),
('boundary three-way', (['2.50', '3.20', '2.90'],), ['5.73', '5.42', ['2.64', '3.38', '3.07']]),
('boundary no-profit price', (['1.00', '5.00'],), 'invalid'),
('regression: fair price direction',
(['4.28', '3.78', '1.86'],),
['3.58', '3.46', ['4.43', '3.92', '1.93']]),
('variant scenario 1',
(['2.38', '9.10', '1.69'],),
['12.18', '10.86', ['2.67', '10.21', '1.90']]),
('variant scenario 2', (['3.25', '2.80', '2.78'],), ['2.45', '2.40', ['3.33', '2.87', '2.85']])],
[('control fair coin', (['2.00', '2.00'],), ['0.00', '0.00', ['2.00', '2.00']]),
('control standard juice', (['1.91', '1.91'],), ['4.71', '4.50', ['2.00', '2.00']]),
('boundary three-way', (['2.50', '3.20', '2.90'],), ['5.73', '5.42', ['2.64', '3.38', '3.07']]),
('boundary no-profit price', (['1.00', '5.00'],), 'invalid'),
('regression: fair price direction',
(['4.98', '3.07', '3.86', '5.09'],),
['-1.79', '-1.83', ['4.89', '3.01', '3.79', '5.00']]),
('variant scenario 1', (['2.65', '9.18', '1.83'],), ['3.27', '3.17', ['2.74', '9.48', '1.89']]),
('variant scenario 2', (['2.11', '4.77', '2.91'],), ['2.72', '2.65', ['2.17', '4.90', '2.99']])],
[('control fair coin', (['2.00', '2.00'],), ['0.00', '0.00', ['2.00', '2.00']]),
('control standard juice', (['1.91', '1.91'],), ['4.71', '4.50', ['2.00', '2.00']]),
('boundary three-way', (['2.50', '3.20', '2.90'],), ['5.73', '5.42', ['2.64', '3.38', '3.07']]),
('boundary no-profit price', (['1.00', '5.00'],), 'invalid'),
('regression: fair price direction', (['1.36', '3.90'],), ['-0.83', '-0.84', ['1.35', '3.87']]),
('variant scenario 1', (['1.12', '6.59'],), ['4.46', '4.27', ['1.17', '6.88']]),
('variant scenario 2', (['1.86', '1.65'],), ['14.37', '12.56', ['2.13', '1.89']])],
[('control fair coin', (['2.00', '2.00'],), ['0.00', '0.00', ['2.00', '2.00']]),
('control standard juice', (['1.91', '1.91'],), ['4.71', '4.50', ['2.00', '2.00']]),
('boundary three-way', (['2.50', '3.20', '2.90'],), ['5.73', '5.42', ['2.64', '3.38', '3.07']]),
('boundary no-profit price', (['1.00', '5.00'],), 'invalid'),
('regression: fair price direction', (['1.99', '1.97'],), ['1.01', '1.00', ['2.01', '1.99']]),
('variant scenario 1', (['2.21', '2.07', '7.52'],), ['6.86', '6.42', ['2.36', '2.21', '8.04']]),
('variant scenario 2', (['1.37', '3.08'],), ['5.46', '5.18', ['1.44', '3.25']])],
[('control fair coin', (['2.00', '2.00'],), ['0.00', '0.00', ['2.00', '2.00']]),
('control standard juice', (['1.91', '1.91'],), ['4.71', '4.50', ['2.00', '2.00']]),
('boundary three-way', (['2.50', '3.20', '2.90'],), ['5.73', '5.42', ['2.64', '3.38', '3.07']]),
('boundary no-profit price', (['1.00', '5.00'],), 'invalid'),
('regression: fair price direction',
(['1.67', '6.50', '3.71'],),
['2.22', '2.17', ['1.71', '6.64', '3.79']]),
('variant scenario 1', (['5.20', '1.15'],), ['6.19', '5.83', ['5.52', '1.22']]),
('variant scenario 2',
(['7.11', '3.30', '9.10', '2.32'],),
['-1.54', '-1.56', ['7.00', '3.25', '8.96', '2.28']])]]
for label, args, expected in cases[N - 1]:
check(label, run(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| control fair coin | ['0.00', '0.00', ['2.00', '2.00']] | ['0.00', '0.00', ['2.00', '2.00']] | Passed |
| control standard juice | ['4.71', '4.50', ['2.00', '2.00']] | ['4.71', '4.50', ['2.00', '2.00']] | Passed |
| boundary three-way | ['5.73', '5.42', ['2.64', '3.38', '3.07']] | ['5.73', '5.42', ['2.64', '3.38', '3.07']] | Passed |
| boundary no-profit price | invalid | invalid | Passed |
| regression: fair price direction | ['3.58', '3.46', ['4.43', '3.92', '1.93']] | ['3.58', '3.46', ['4.43', '3.92', '1.93']] | Passed |
| variant scenario 1 | ['12.18', '10.86', ['2.67', '10.21', '1.90']] | ['12.18', '10.86', ['2.67', '10.21', '1.90']] | Passed |
| variant scenario 2 | ['2.45', '2.40', ['3.33', '2.87', '2.85']] | ['2.45', '2.40', ['3.33', '2.87', '2.85']] | Passed |
SHA-256 / ed8eca29b0958383152ce63384da0957cd28fd6f58545c92a670bdb7b47e4b9d
Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:50:30.541955+00:00.
Case digest / 3a9070e2672a80c871cb315ecf58a01d7699989b38b04ad20b94f8bc98acad90