FA-84636 / Betting odds conversion / Open access
Midpoint prices resolved to the longer fraction · case 01
A price exactly between 11/4 and 3/1 displays as 3/1.
ROOT CAUSE
The comparison uses <= so later ladder entries win ties.
VERIFIED REPAIR
Keep the earlier entry on equal distance.
Unsuccessful approach: Preferring the shorter string on ties is not the stated rule.
Case contract
Display a decimal price (> 1, else "invalid") as the nearest traditional fraction from the ascending ladder ['1/10', '1/8', '1/5', '2/9', '1/4', '2/7', '1/3', '4/11', '2/5', '4/9', '1/2', '8/15', '4/7', '8/13', '4/6', '8/11', '4/5', '5/6', '10/11', 'evens', '11/10', '6/5', '5/4', '11/8', '6/4', '13/8', '7/4', '15/8', '2/1', '9/4', '5/2', '11/4', '3/1', '10/3', '7/2', '4/1', '9/2', '5/1', '11/2', '6/1', '13/2', '7/1', '15/2', '8/1', '17/2', '9/1', '10/1', '11/1', '12/1', '14/1', '16/1', '18/1', '20/1', '25/1', '33/1', '40/1', '50/1', '66/1', '100/1']. Distance is |fraction value - (d - 1)| with "evens" = 1; ties go to the earlier (shorter) ladder entry. Return the ladder string.
Why this case matters
UK-facing sites display decimal model prices as familiar traditional fractions.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(decimal):
LADDER = ['1/10', '1/8', '1/5', '2/9', '1/4', '2/7', '1/3', '4/11', '2/5', '4/9', '1/2', '8/15', '4/7', '8/13', '4/6', '8/11', '4/5', '5/6', '10/11', 'evens', '11/10', '6/5', '5/4', '11/8', '6/4', '13/8', '7/4', '15/8', '2/1', '9/4', '5/2', '11/4', '3/1', '10/3', '7/2', '4/1', '9/2', '5/1', '11/2', '6/1', '13/2', '7/1', '15/2', '8/1', '17/2', '9/1', '10/1', '11/1', '12/1', '14/1', '16/1', '18/1', '20/1', '25/1', '33/1', '40/1', '50/1', '66/1', '100/1']
def val(s):
return Fraction(1) if s == 'evens' else Fraction(s)
d = Fraction(decimal)
if d <= 1:
return 'invalid'
target = d - 1
best = None
for s in LADDER:
dist = abs(val(s) - target)
if best is None or dist <= best[0]:
best = (dist, s)
return best[1]
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 exact fraction', ('3.50',), '5/2'),
('control evens', ('2.00',), 'evens'),
('boundary odds-on', ('1.67',), '4/6'),
('boundary midpoint tie', ('3.875',), '11/4'),
('control long shot', ('120.0',), '100/1'),
('boundary no-profit price', ('1.00',), 'invalid'),
('regression: tie direction', ('3.875',), '11/4'),
('variant scenario 1', ('108.0',), '100/1'),
('variant scenario 2', ('106.8',), '100/1')],
[('control exact fraction', ('3.50',), '5/2'),
('control evens', ('2.00',), 'evens'),
('boundary odds-on', ('1.67',), '4/6'),
('boundary midpoint tie', ('3.875',), '11/4'),
('control long shot', ('120.0',), '100/1'),
('boundary no-profit price', ('1.00',), 'invalid'),
('regression: tie direction', ('3.875',), '11/4'),
('variant scenario 1', ('1.528',), '8/15'),
('variant scenario 2', ('2.125',), '11/10')],
[('control exact fraction', ('3.50',), '5/2'),
('control evens', ('2.00',), 'evens'),
('boundary odds-on', ('1.67',), '4/6'),
('boundary midpoint tie', ('3.875',), '11/4'),
('control long shot', ('120.0',), '100/1'),
('boundary no-profit price', ('1.00',), 'invalid'),
('regression: tie direction', ('3.875',), '11/4'),
('variant scenario 1', ('2.26',), '5/4'),
('variant scenario 2', ('7.86',), '7/1')],
[('control exact fraction', ('3.50',), '5/2'),
('control evens', ('2.00',), 'evens'),
('boundary odds-on', ('1.67',), '4/6'),
('boundary midpoint tie', ('3.875',), '11/4'),
('control long shot', ('120.0',), '100/1'),
('boundary no-profit price', ('1.00',), 'invalid'),
('regression: tie direction', ('3.875',), '11/4'),
('variant scenario 1', ('2.125',), '11/10'),
('variant scenario 2', ('51.4',), '50/1')],
[('control exact fraction', ('3.50',), '5/2'),
('control evens', ('2.00',), 'evens'),
('boundary odds-on', ('1.67',), '4/6'),
('boundary midpoint tie', ('3.875',), '11/4'),
('control long shot', ('120.0',), '100/1'),
('boundary no-profit price', ('1.00',), 'invalid'),
('regression: tie direction', ('3.875',), '11/4'),
('variant scenario 1', ('1.910',), '10/11'),
('variant scenario 2', ('10.61',), '10/1')]]
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 exact fraction | 5/2 | 5/2 | Passed |
| control evens | evens | evens | Passed |
| boundary odds-on | 4/6 | 4/6 | Passed |
| boundary midpoint tie | 3/1 | 11/4 | Failed |
| control long shot | 100/1 | 100/1 | Passed |
| boundary no-profit price | invalid | invalid | Passed |
| regression: tie direction | 3/1 | 11/4 | Failed |
| variant scenario 1 | 100/1 | 100/1 | Passed |
| variant scenario 2 | 100/1 | 100/1 | Passed |
SHA-256 / 5a4729b1cb58ac1a4955141a5ea8f1afacd4d2dd100b0df04765d5449bd7c69a
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(decimal):
LADDER = ['1/10', '1/8', '1/5', '2/9', '1/4', '2/7', '1/3', '4/11', '2/5', '4/9', '1/2', '8/15', '4/7', '8/13', '4/6', '8/11', '4/5', '5/6', '10/11', 'evens', '11/10', '6/5', '5/4', '11/8', '6/4', '13/8', '7/4', '15/8', '2/1', '9/4', '5/2', '11/4', '3/1', '10/3', '7/2', '4/1', '9/2', '5/1', '11/2', '6/1', '13/2', '7/1', '15/2', '8/1', '17/2', '9/1', '10/1', '11/1', '12/1', '14/1', '16/1', '18/1', '20/1', '25/1', '33/1', '40/1', '50/1', '66/1', '100/1']
def val(s):
return Fraction(1) if s == 'evens' else Fraction(s)
d = Fraction(decimal)
if d <= 1:
return 'invalid'
target = d - 1
best = None
for s in LADDER:
dist = abs(val(s) - target)
if best is None or dist < best[0] or (dist == best[0] and len(s) < len(best[1])):
best = (dist, s)
return best[1]
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 exact fraction', ('3.50',), '5/2'),
('control evens', ('2.00',), 'evens'),
('boundary odds-on', ('1.67',), '4/6'),
('boundary midpoint tie', ('3.875',), '11/4'),
('control long shot', ('120.0',), '100/1'),
('boundary no-profit price', ('1.00',), 'invalid'),
('regression: tie direction', ('3.875',), '11/4'),
('variant scenario 1', ('108.0',), '100/1'),
('variant scenario 2', ('106.8',), '100/1')],
[('control exact fraction', ('3.50',), '5/2'),
('control evens', ('2.00',), 'evens'),
('boundary odds-on', ('1.67',), '4/6'),
('boundary midpoint tie', ('3.875',), '11/4'),
('control long shot', ('120.0',), '100/1'),
('boundary no-profit price', ('1.00',), 'invalid'),
('regression: tie direction', ('3.875',), '11/4'),
('variant scenario 1', ('1.528',), '8/15'),
('variant scenario 2', ('2.125',), '11/10')],
[('control exact fraction', ('3.50',), '5/2'),
('control evens', ('2.00',), 'evens'),
('boundary odds-on', ('1.67',), '4/6'),
('boundary midpoint tie', ('3.875',), '11/4'),
('control long shot', ('120.0',), '100/1'),
('boundary no-profit price', ('1.00',), 'invalid'),
('regression: tie direction', ('3.875',), '11/4'),
('variant scenario 1', ('2.26',), '5/4'),
('variant scenario 2', ('7.86',), '7/1')],
[('control exact fraction', ('3.50',), '5/2'),
('control evens', ('2.00',), 'evens'),
('boundary odds-on', ('1.67',), '4/6'),
('boundary midpoint tie', ('3.875',), '11/4'),
('control long shot', ('120.0',), '100/1'),
('boundary no-profit price', ('1.00',), 'invalid'),
('regression: tie direction', ('3.875',), '11/4'),
('variant scenario 1', ('2.125',), '11/10'),
('variant scenario 2', ('51.4',), '50/1')],
[('control exact fraction', ('3.50',), '5/2'),
('control evens', ('2.00',), 'evens'),
('boundary odds-on', ('1.67',), '4/6'),
('boundary midpoint tie', ('3.875',), '11/4'),
('control long shot', ('120.0',), '100/1'),
('boundary no-profit price', ('1.00',), 'invalid'),
('regression: tie direction', ('3.875',), '11/4'),
('variant scenario 1', ('1.910',), '10/11'),
('variant scenario 2', ('10.61',), '10/1')]]
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 exact fraction | 5/2 | 5/2 | Passed |
| control evens | evens | evens | Passed |
| boundary odds-on | 4/6 | 4/6 | Passed |
| boundary midpoint tie | 3/1 | 11/4 | Failed |
| control long shot | 100/1 | 100/1 | Passed |
| boundary no-profit price | invalid | invalid | Passed |
| regression: tie direction | 3/1 | 11/4 | Failed |
| variant scenario 1 | 100/1 | 100/1 | Passed |
| variant scenario 2 | 100/1 | 100/1 | Passed |
SHA-256 / b12d219990b871de43b0774f828f21cf5e45192e279b897dd9dea5225e346da3
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(decimal):
LADDER = ['1/10', '1/8', '1/5', '2/9', '1/4', '2/7', '1/3', '4/11', '2/5', '4/9', '1/2', '8/15', '4/7', '8/13', '4/6', '8/11', '4/5', '5/6', '10/11', 'evens', '11/10', '6/5', '5/4', '11/8', '6/4', '13/8', '7/4', '15/8', '2/1', '9/4', '5/2', '11/4', '3/1', '10/3', '7/2', '4/1', '9/2', '5/1', '11/2', '6/1', '13/2', '7/1', '15/2', '8/1', '17/2', '9/1', '10/1', '11/1', '12/1', '14/1', '16/1', '18/1', '20/1', '25/1', '33/1', '40/1', '50/1', '66/1', '100/1']
def val(s):
return Fraction(1) if s == 'evens' else Fraction(s)
d = Fraction(decimal)
if d <= 1:
return 'invalid'
target = d - 1
best = None
for s in LADDER:
dist = abs(val(s) - target)
if best is None or dist < best[0]:
best = (dist, s)
return best[1]
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 exact fraction', ('3.50',), '5/2'),
('control evens', ('2.00',), 'evens'),
('boundary odds-on', ('1.67',), '4/6'),
('boundary midpoint tie', ('3.875',), '11/4'),
('control long shot', ('120.0',), '100/1'),
('boundary no-profit price', ('1.00',), 'invalid'),
('regression: tie direction', ('3.875',), '11/4'),
('variant scenario 1', ('108.0',), '100/1'),
('variant scenario 2', ('106.8',), '100/1')],
[('control exact fraction', ('3.50',), '5/2'),
('control evens', ('2.00',), 'evens'),
('boundary odds-on', ('1.67',), '4/6'),
('boundary midpoint tie', ('3.875',), '11/4'),
('control long shot', ('120.0',), '100/1'),
('boundary no-profit price', ('1.00',), 'invalid'),
('regression: tie direction', ('3.875',), '11/4'),
('variant scenario 1', ('1.528',), '8/15'),
('variant scenario 2', ('2.125',), '11/10')],
[('control exact fraction', ('3.50',), '5/2'),
('control evens', ('2.00',), 'evens'),
('boundary odds-on', ('1.67',), '4/6'),
('boundary midpoint tie', ('3.875',), '11/4'),
('control long shot', ('120.0',), '100/1'),
('boundary no-profit price', ('1.00',), 'invalid'),
('regression: tie direction', ('3.875',), '11/4'),
('variant scenario 1', ('2.26',), '5/4'),
('variant scenario 2', ('7.86',), '7/1')],
[('control exact fraction', ('3.50',), '5/2'),
('control evens', ('2.00',), 'evens'),
('boundary odds-on', ('1.67',), '4/6'),
('boundary midpoint tie', ('3.875',), '11/4'),
('control long shot', ('120.0',), '100/1'),
('boundary no-profit price', ('1.00',), 'invalid'),
('regression: tie direction', ('3.875',), '11/4'),
('variant scenario 1', ('2.125',), '11/10'),
('variant scenario 2', ('51.4',), '50/1')],
[('control exact fraction', ('3.50',), '5/2'),
('control evens', ('2.00',), 'evens'),
('boundary odds-on', ('1.67',), '4/6'),
('boundary midpoint tie', ('3.875',), '11/4'),
('control long shot', ('120.0',), '100/1'),
('boundary no-profit price', ('1.00',), 'invalid'),
('regression: tie direction', ('3.875',), '11/4'),
('variant scenario 1', ('1.910',), '10/11'),
('variant scenario 2', ('10.61',), '10/1')]]
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 exact fraction | 5/2 | 5/2 | Passed |
| control evens | evens | evens | Passed |
| boundary odds-on | 4/6 | 4/6 | Passed |
| boundary midpoint tie | 11/4 | 11/4 | Passed |
| control long shot | 100/1 | 100/1 | Passed |
| boundary no-profit price | invalid | invalid | Passed |
| regression: tie direction | 11/4 | 11/4 | Passed |
| variant scenario 1 | 100/1 | 100/1 | Passed |
| variant scenario 2 | 100/1 | 100/1 | Passed |
SHA-256 / ce7adba3cad8a7dc7a02f722cf954ebcfde84825645759994d5e1dbd51bb26ef
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:32.787475+00:00.
Case digest / 00bc4fa01db39c776d29ba14e2ae15fc99091a1b6e811e4abc230bfdc52f0d53