FAILURE MAP
← Case archive

FA-84626 / Betting odds conversion / Open access

Traditional display picks the next shorter fraction · case 01

A 3.40 price displays as 9/4 instead of 5/2.

Verified by executionVariant 1 · 10 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The scan keeps the largest ladder fraction not above the target instead of the nearest.

VERIFIED REPAIR

Choose the ladder entry with the smallest absolute distance.

Unsuccessful approach: Taking the first ladder entry at or above the target always rounds toward the longer price.

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 val(s) <= target:
            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: nearest versus floor', ('1.95',), '10/11'),
  ('regression: nearest versus floor', ('2.70',), '7/4'),
  ('variant scenario 1', ('1.50',), '1/2'),
  ('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: nearest versus floor', ('1.95',), '10/11'),
  ('regression: nearest versus floor', ('1.48',), '1/2'),
  ('variant scenario 1', ('2.125',), '11/10'),
  ('variant scenario 2', ('3.875',), '11/4')],
 [('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: nearest versus floor', ('3.875',), '11/4'),
  ('regression: nearest versus floor', ('3.703',), '11/4'),
  ('variant scenario 1', ('1.118',), '1/8'),
  ('variant scenario 2', ('2.29',), '5/4')],
 [('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: nearest versus floor', ('6.79',), '6/1'),
  ('regression: nearest versus floor', ('3.875',), '11/4'),
  ('variant scenario 1', ('12.1',), '11/1'),
  ('variant scenario 2', ('93.4',), '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: nearest versus floor', ('1.95',), '10/11'),
  ('regression: nearest versus floor', ('61.2',), '66/1'),
  ('variant scenario 1', ('3.875',), '11/4'),
  ('variant scenario 2', ('2.125',), '11/10')]]
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 fixtureActualExpectedOutcome
control exact fraction5/25/2Passed
control evensevensevensPassed
boundary odds-on4/64/6Passed
boundary midpoint tie11/411/4Passed
control long shot100/1100/1Passed
boundary no-profit priceinvalidinvalidPassed
regression: nearest versus floor10/1110/11Passed
regression: nearest versus floor13/87/4Failed
variant scenario 11/21/2Passed
variant scenario 211/1011/10Passed

SHA-256 / 8a5b3a9061355625b047617d2df48aca68d2234c1e13da074e703b776e74f3a4

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 (val(s) >= target and best[0] != 0 and val(best[1]) < target):
            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: nearest versus floor', ('1.95',), '10/11'),
  ('regression: nearest versus floor', ('2.70',), '7/4'),
  ('variant scenario 1', ('1.50',), '1/2'),
  ('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: nearest versus floor', ('1.95',), '10/11'),
  ('regression: nearest versus floor', ('1.48',), '1/2'),
  ('variant scenario 1', ('2.125',), '11/10'),
  ('variant scenario 2', ('3.875',), '11/4')],
 [('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: nearest versus floor', ('3.875',), '11/4'),
  ('regression: nearest versus floor', ('3.703',), '11/4'),
  ('variant scenario 1', ('1.118',), '1/8'),
  ('variant scenario 2', ('2.29',), '5/4')],
 [('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: nearest versus floor', ('6.79',), '6/1'),
  ('regression: nearest versus floor', ('3.875',), '11/4'),
  ('variant scenario 1', ('12.1',), '11/1'),
  ('variant scenario 2', ('93.4',), '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: nearest versus floor', ('1.95',), '10/11'),
  ('regression: nearest versus floor', ('61.2',), '66/1'),
  ('variant scenario 1', ('3.875',), '11/4'),
  ('variant scenario 2', ('2.125',), '11/10')]]
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 fixtureActualExpectedOutcome
control exact fraction5/25/2Passed
control evensevensevensPassed
boundary odds-on8/114/6Failed
boundary midpoint tie3/111/4Failed
control long shot1/10100/1Failed
boundary no-profit priceinvalidinvalidPassed
regression: nearest versus floorevens10/11Failed
regression: nearest versus floor7/47/4Passed
variant scenario 11/21/2Passed
variant scenario 26/511/10Failed

SHA-256 / 6043dffbfb03195406eb171713851a0d0cfde92cde3c4b0ba42408934d9d9119

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: nearest versus floor', ('1.95',), '10/11'),
  ('regression: nearest versus floor', ('2.70',), '7/4'),
  ('variant scenario 1', ('1.50',), '1/2'),
  ('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: nearest versus floor', ('1.95',), '10/11'),
  ('regression: nearest versus floor', ('1.48',), '1/2'),
  ('variant scenario 1', ('2.125',), '11/10'),
  ('variant scenario 2', ('3.875',), '11/4')],
 [('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: nearest versus floor', ('3.875',), '11/4'),
  ('regression: nearest versus floor', ('3.703',), '11/4'),
  ('variant scenario 1', ('1.118',), '1/8'),
  ('variant scenario 2', ('2.29',), '5/4')],
 [('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: nearest versus floor', ('6.79',), '6/1'),
  ('regression: nearest versus floor', ('3.875',), '11/4'),
  ('variant scenario 1', ('12.1',), '11/1'),
  ('variant scenario 2', ('93.4',), '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: nearest versus floor', ('1.95',), '10/11'),
  ('regression: nearest versus floor', ('61.2',), '66/1'),
  ('variant scenario 1', ('3.875',), '11/4'),
  ('variant scenario 2', ('2.125',), '11/10')]]
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 fixtureActualExpectedOutcome
control exact fraction5/25/2Passed
control evensevensevensPassed
boundary odds-on4/64/6Passed
boundary midpoint tie11/411/4Passed
control long shot100/1100/1Passed
boundary no-profit priceinvalidinvalidPassed
regression: nearest versus floor10/1110/11Passed
regression: nearest versus floor7/47/4Passed
variant scenario 11/21/2Passed
variant scenario 211/1011/10Passed

SHA-256 / 67aca8dad3e6e503a251e6224d876009ad96794efc6fd7808b0489377fd37b8b

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.612649+00:00.

Case digest / ad1874deda46b07848922f3b15c4c2846b2a42bdc3a3db69501317b350bef789