FAILURE MAP
← Case archive

FA-84631 / Betting odds conversion / Open access

Decimal price compared with fractions without removing the stake · case 01

A 3.00 price is displayed as 3/1 instead of 2/1.

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

ROOT CAUSE

The target is the decimal price itself instead of d - 1.

VERIFIED REPAIR

Compare ladder fractions against d - 1.

Unsuccessful approach: Using the reciprocal of the profit mixes odds-on and odds-against.

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
    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: profit offset', ('71.7',), '66/1'),
  ('regression: profit offset', ('19.1',), '18/1'),
  ('variant scenario 1', ('1.95',), '10/11'),
  ('variant scenario 2', ('85.5',), '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: profit offset', ('85.8',), '100/1'),
  ('regression: profit offset', ('1.95',), '10/11'),
  ('variant scenario 1', ('2.125',), '11/10'),
  ('variant scenario 2', ('6.42',), '11/2')],
 [('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: profit offset', ('1.201',), '1/5'),
  ('variant scenario 1', ('3.875',), '11/4'),
  ('variant scenario 2', ('5.53',), '9/2')],
 [('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: profit offset', ('1.95',), '10/11'),
  ('variant scenario 1', ('3.875',), '11/4'),
  ('variant scenario 2', ('11.07',), '10/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: profit offset', ('3.452',), '5/2'),
  ('variant scenario 1', ('1.95',), '10/11'),
  ('variant scenario 2', ('6.93',), '6/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 fixtureActualExpectedOutcome
control exact fraction7/25/2Failed
control evens2/1evensFailed
boundary odds-on13/84/6Failed
boundary midpoint tie4/111/4Failed
control long shot100/1100/1Passed
boundary no-profit priceinvalidinvalidPassed
regression: profit offset66/166/1Passed
regression: profit offset20/118/1Failed
variant scenario 12/110/11Failed
variant scenario 2100/1100/1Passed

SHA-256 / d3ed27f88dee39a6930b121c59ce54e5771c32069aa37fd6945a35420256bae9

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 = 1 / (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: profit offset', ('71.7',), '66/1'),
  ('regression: profit offset', ('19.1',), '18/1'),
  ('variant scenario 1', ('1.95',), '10/11'),
  ('variant scenario 2', ('85.5',), '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: profit offset', ('85.8',), '100/1'),
  ('regression: profit offset', ('1.95',), '10/11'),
  ('variant scenario 1', ('2.125',), '11/10'),
  ('variant scenario 2', ('6.42',), '11/2')],
 [('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: profit offset', ('1.201',), '1/5'),
  ('variant scenario 1', ('3.875',), '11/4'),
  ('variant scenario 2', ('5.53',), '9/2')],
 [('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: profit offset', ('1.95',), '10/11'),
  ('variant scenario 1', ('3.875',), '11/4'),
  ('variant scenario 2', ('11.07',), '10/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: profit offset', ('3.452',), '5/2'),
  ('variant scenario 1', ('1.95',), '10/11'),
  ('variant scenario 2', ('6.93',), '6/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 fixtureActualExpectedOutcome
control exact fraction2/55/2Failed
control evensevensevensPassed
boundary odds-on6/44/6Failed
boundary midpoint tie1/311/4Failed
control long shot1/10100/1Failed
boundary no-profit priceinvalidinvalidPassed
regression: profit offset1/1066/1Failed
regression: profit offset1/1018/1Failed
variant scenario 111/1010/11Failed
variant scenario 21/10100/1Failed

SHA-256 / ac288e3255a2fe92439fa6099f38032ecaaa0634a3431ed23992f5091b5e5d84

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: profit offset', ('71.7',), '66/1'),
  ('regression: profit offset', ('19.1',), '18/1'),
  ('variant scenario 1', ('1.95',), '10/11'),
  ('variant scenario 2', ('85.5',), '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: profit offset', ('85.8',), '100/1'),
  ('regression: profit offset', ('1.95',), '10/11'),
  ('variant scenario 1', ('2.125',), '11/10'),
  ('variant scenario 2', ('6.42',), '11/2')],
 [('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: profit offset', ('1.201',), '1/5'),
  ('variant scenario 1', ('3.875',), '11/4'),
  ('variant scenario 2', ('5.53',), '9/2')],
 [('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: profit offset', ('1.95',), '10/11'),
  ('variant scenario 1', ('3.875',), '11/4'),
  ('variant scenario 2', ('11.07',), '10/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: profit offset', ('3.452',), '5/2'),
  ('variant scenario 1', ('1.95',), '10/11'),
  ('variant scenario 2', ('6.93',), '6/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 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: profit offset66/166/1Passed
regression: profit offset18/118/1Passed
variant scenario 110/1110/11Passed
variant scenario 2100/1100/1Passed

SHA-256 / 19905053191d822f9d619c480540be0eeae54f0f7f6ef5b5a3ed65c1045f1002

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

Case digest / 4925ec31b11ca2efd28b0c1d7eb255edded17958613bfe2a96583688abd0ad2d