FAILURE MAP
← Case archive

FA-84791 / Betting odds conversion / Open access

Leg priced exactly at the minimum odds does not qualify · case 01

A 1.20 leg is excluded from the bonus count.

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

ROOT CAUSE

The qualification test uses a strict greater-than.

VERIFIED REPAIR

Qualify legs priced at 1.20 or more.

Unsuccessful approach: Rounding prices to one decimal before comparing qualifies a 1.15 leg.

Case contract

Winning accumulator bonus. Every leg price multiplies the accumulator. Legs priced at 1.20 or more qualify; the bonus percentage by qualifying count is {3: 5, 4: 10, 5: 15, 6: 20, 7: 25} with 7 or more paying 25 and fewer than 3 paying 0. The bonus is applied to the profit only: return = stake + profit * (100 + pct) / 100, rounded down. Return [qualifying legs, bonus pct, return cents].

Why this case matters

Acca promotions depend on minimum-odds qualification and apply the bonus to winnings.

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, stake_cents):
    TABLE = {3: 5, 4: 10, 5: 15, 6: 20, 7: 25}
    factor = Fraction(1)
    q = 0
    for p in prices:
        d = Fraction(p)
        factor *= d
        if d > Fraction(120, 100):
            q += 1
    pct = TABLE.get(min(q, 7), 0)
    profit = stake_cents * (factor - 1)
    return [q, pct, math.floor(stake_cents + profit * (100 + pct) / 100)]
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 treble', (['2.00', '2.00', '2.00'], 100), [3, 5, 835]),
  ('boundary minimum odds leg', (['1.20', '2.00', '2.00'], 100), [3, 5, 499]),
  ('boundary short leg does not qualify', (['1.19', '2.00', '2.00'], 100), [2, 0, 476]),
  ('boundary eight legs capped',
   (['1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50'], 100),
   [8, 25, 3178]),
  ('regression: minimum odds boundary',
   (['2.24', '2.16', '1.94', '1.38', '1.58', '1.20', '1.15'], 1000),
   [6, 20, 33692]),
  ('variant scenario 1',
   (['1.81', '1.20', '1.25', '1.97', '1.84', '2.34', '1.19', '1.20', '1.20'], 500),
   [8, 25, 24538]),
  ('variant scenario 2', (['1.20', '1.19', '2.31', '1.60', '1.69'], 100), [4, 10, 971])],
 [('control treble', (['2.00', '2.00', '2.00'], 100), [3, 5, 835]),
  ('boundary minimum odds leg', (['1.20', '2.00', '2.00'], 100), [3, 5, 499]),
  ('boundary short leg does not qualify', (['1.19', '2.00', '2.00'], 100), [2, 0, 476]),
  ('boundary eight legs capped',
   (['1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50'], 100),
   [8, 25, 3178]),
  ('regression: minimum odds boundary', (['1.25', '1.64', '1.20'], 1000), [3, 5, 2533]),
  ('regression: minimum odds boundary', (['1.25', '1.15', '1.19', '2.50'], 500), [2, 0, 2138]),
  ('variant scenario 1', (['1.86', '1.45', '1.72', '1.20'], 100), [4, 10, 602]),
  ('variant scenario 2', (['1.25', '1.25'], 500), [2, 0, 781])],
 [('control treble', (['2.00', '2.00', '2.00'], 100), [3, 5, 835]),
  ('boundary minimum odds leg', (['1.20', '2.00', '2.00'], 100), [3, 5, 499]),
  ('boundary short leg does not qualify', (['1.19', '2.00', '2.00'], 100), [2, 0, 476]),
  ('boundary eight legs capped',
   (['1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50'], 100),
   [8, 25, 3178]),
  ('regression: minimum odds boundary', (['1.19', '1.25'], 500), [1, 0, 743]),
  ('regression: minimum odds boundary',
   (['1.15', '1.19', '1.15', '1.20', '2.77', '1.15', '1.19'], 100),
   [2, 0, 715]),
  ('variant scenario 1', (['1.70', '1.25', '1.25', '1.25', '1.19', '2.01'], 1000), [5, 15, 8983]),
  ('variant scenario 2',
   (['1.15', '1.25', '1.19', '1.92', '1.96', '1.25', '2.92', '1.10'], 500),
   [5, 15, 14786])],
 [('control treble', (['2.00', '2.00', '2.00'], 100), [3, 5, 835]),
  ('boundary minimum odds leg', (['1.20', '2.00', '2.00'], 100), [3, 5, 499]),
  ('boundary short leg does not qualify', (['1.19', '2.00', '2.00'], 100), [2, 0, 476]),
  ('boundary eight legs capped',
   (['1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50'], 100),
   [8, 25, 3178]),
  ('regression: minimum odds boundary', (['1.25', '1.15', '1.15'], 100), [1, 0, 165]),
  ('regression: minimum odds boundary',
   (['1.52', '1.19', '1.19', '1.25', '1.20', '1.44', '2.15'], 500),
   [5, 15, 5672]),
  ('variant scenario 1', (['1.25', '1.25', '1.62', '2.12', '1.25', '1.25'], 1000), [6, 20, 9861]),
  ('variant scenario 2',
   (['2.10', '1.19', '1.15', '1.53', '1.25', '1.15', '1.25'], 100),
   [4, 10, 859])],
 [('control treble', (['2.00', '2.00', '2.00'], 100), [3, 5, 835]),
  ('boundary minimum odds leg', (['1.20', '2.00', '2.00'], 100), [3, 5, 499]),
  ('boundary short leg does not qualify', (['1.19', '2.00', '2.00'], 100), [2, 0, 476]),
  ('boundary eight legs capped',
   (['1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50'], 100),
   [8, 25, 3178]),
  ('regression: minimum odds boundary',
   (['1.25', '1.19', '1.25', '2.32', '1.20', '2.77', '1.95'], 500),
   [6, 20, 16676]),
  ('variant scenario 1', (['1.19', '2.59', '1.19', '1.25', '1.75', '1.25'], 500), [4, 10, 5465]),
  ('variant scenario 2', (['1.15', '1.25', '2.35'], 500), [2, 0, 1689])]]
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 treble[3, 5, 835][3, 5, 835]Passed
boundary minimum odds leg[2, 0, 480][3, 5, 499]Failed
boundary short leg does not qualify[2, 0, 476][2, 0, 476]Passed
boundary eight legs capped[8, 25, 3178][8, 25, 3178]Passed
regression: minimum odds boundary[5, 15, 32330][6, 20, 33692]Failed
variant scenario 1[5, 15, 22615][8, 25, 24538]Failed
variant scenario 2[3, 5, 931][4, 10, 971]Failed

SHA-256 / 52b095d6851cba26a1dc0c71b347717f86f5b3a73606b23724e9809e9359ec76

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, stake_cents):
    TABLE = {3: 5, 4: 10, 5: 15, 6: 20, 7: 25}
    factor = Fraction(1)
    q = 0
    for p in prices:
        d = Fraction(p)
        factor *= d
        if round(d, 1) >= Fraction(12, 10):
            q += 1
    pct = TABLE.get(min(q, 7), 0)
    profit = stake_cents * (factor - 1)
    return [q, pct, math.floor(stake_cents + profit * (100 + pct) / 100)]
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 treble', (['2.00', '2.00', '2.00'], 100), [3, 5, 835]),
  ('boundary minimum odds leg', (['1.20', '2.00', '2.00'], 100), [3, 5, 499]),
  ('boundary short leg does not qualify', (['1.19', '2.00', '2.00'], 100), [2, 0, 476]),
  ('boundary eight legs capped',
   (['1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50'], 100),
   [8, 25, 3178]),
  ('regression: minimum odds boundary',
   (['2.24', '2.16', '1.94', '1.38', '1.58', '1.20', '1.15'], 1000),
   [6, 20, 33692]),
  ('variant scenario 1',
   (['1.81', '1.20', '1.25', '1.97', '1.84', '2.34', '1.19', '1.20', '1.20'], 500),
   [8, 25, 24538]),
  ('variant scenario 2', (['1.20', '1.19', '2.31', '1.60', '1.69'], 100), [4, 10, 971])],
 [('control treble', (['2.00', '2.00', '2.00'], 100), [3, 5, 835]),
  ('boundary minimum odds leg', (['1.20', '2.00', '2.00'], 100), [3, 5, 499]),
  ('boundary short leg does not qualify', (['1.19', '2.00', '2.00'], 100), [2, 0, 476]),
  ('boundary eight legs capped',
   (['1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50'], 100),
   [8, 25, 3178]),
  ('regression: minimum odds boundary', (['1.25', '1.64', '1.20'], 1000), [3, 5, 2533]),
  ('regression: minimum odds boundary', (['1.25', '1.15', '1.19', '2.50'], 500), [2, 0, 2138]),
  ('variant scenario 1', (['1.86', '1.45', '1.72', '1.20'], 100), [4, 10, 602]),
  ('variant scenario 2', (['1.25', '1.25'], 500), [2, 0, 781])],
 [('control treble', (['2.00', '2.00', '2.00'], 100), [3, 5, 835]),
  ('boundary minimum odds leg', (['1.20', '2.00', '2.00'], 100), [3, 5, 499]),
  ('boundary short leg does not qualify', (['1.19', '2.00', '2.00'], 100), [2, 0, 476]),
  ('boundary eight legs capped',
   (['1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50'], 100),
   [8, 25, 3178]),
  ('regression: minimum odds boundary', (['1.19', '1.25'], 500), [1, 0, 743]),
  ('regression: minimum odds boundary',
   (['1.15', '1.19', '1.15', '1.20', '2.77', '1.15', '1.19'], 100),
   [2, 0, 715]),
  ('variant scenario 1', (['1.70', '1.25', '1.25', '1.25', '1.19', '2.01'], 1000), [5, 15, 8983]),
  ('variant scenario 2',
   (['1.15', '1.25', '1.19', '1.92', '1.96', '1.25', '2.92', '1.10'], 500),
   [5, 15, 14786])],
 [('control treble', (['2.00', '2.00', '2.00'], 100), [3, 5, 835]),
  ('boundary minimum odds leg', (['1.20', '2.00', '2.00'], 100), [3, 5, 499]),
  ('boundary short leg does not qualify', (['1.19', '2.00', '2.00'], 100), [2, 0, 476]),
  ('boundary eight legs capped',
   (['1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50'], 100),
   [8, 25, 3178]),
  ('regression: minimum odds boundary', (['1.25', '1.15', '1.15'], 100), [1, 0, 165]),
  ('regression: minimum odds boundary',
   (['1.52', '1.19', '1.19', '1.25', '1.20', '1.44', '2.15'], 500),
   [5, 15, 5672]),
  ('variant scenario 1', (['1.25', '1.25', '1.62', '2.12', '1.25', '1.25'], 1000), [6, 20, 9861]),
  ('variant scenario 2',
   (['2.10', '1.19', '1.15', '1.53', '1.25', '1.15', '1.25'], 100),
   [4, 10, 859])],
 [('control treble', (['2.00', '2.00', '2.00'], 100), [3, 5, 835]),
  ('boundary minimum odds leg', (['1.20', '2.00', '2.00'], 100), [3, 5, 499]),
  ('boundary short leg does not qualify', (['1.19', '2.00', '2.00'], 100), [2, 0, 476]),
  ('boundary eight legs capped',
   (['1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50'], 100),
   [8, 25, 3178]),
  ('regression: minimum odds boundary',
   (['1.25', '1.19', '1.25', '2.32', '1.20', '2.77', '1.95'], 500),
   [6, 20, 16676]),
  ('variant scenario 1', (['1.19', '2.59', '1.19', '1.25', '1.75', '1.25'], 500), [4, 10, 5465]),
  ('variant scenario 2', (['1.15', '1.25', '2.35'], 500), [2, 0, 1689])]]
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 treble[3, 5, 835][3, 5, 835]Passed
boundary minimum odds leg[3, 5, 499][3, 5, 499]Passed
boundary short leg does not qualify[3, 5, 494][2, 0, 476]Failed
boundary eight legs capped[8, 25, 3178][8, 25, 3178]Passed
regression: minimum odds boundary[7, 25, 35054][6, 20, 33692]Failed
variant scenario 1[9, 25, 24538][8, 25, 24538]Failed
variant scenario 2[5, 15, 1010][4, 10, 971]Failed

SHA-256 / 7605e627173f946d53457d641f22ac3b6acd11681e841a63ffa93327fa5a80f1

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, stake_cents):
    TABLE = {3: 5, 4: 10, 5: 15, 6: 20, 7: 25}
    factor = Fraction(1)
    q = 0
    for p in prices:
        d = Fraction(p)
        factor *= d
        if d >= Fraction(120, 100):
            q += 1
    pct = TABLE.get(min(q, 7), 0)
    profit = stake_cents * (factor - 1)
    return [q, pct, math.floor(stake_cents + profit * (100 + pct) / 100)]
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 treble', (['2.00', '2.00', '2.00'], 100), [3, 5, 835]),
  ('boundary minimum odds leg', (['1.20', '2.00', '2.00'], 100), [3, 5, 499]),
  ('boundary short leg does not qualify', (['1.19', '2.00', '2.00'], 100), [2, 0, 476]),
  ('boundary eight legs capped',
   (['1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50'], 100),
   [8, 25, 3178]),
  ('regression: minimum odds boundary',
   (['2.24', '2.16', '1.94', '1.38', '1.58', '1.20', '1.15'], 1000),
   [6, 20, 33692]),
  ('variant scenario 1',
   (['1.81', '1.20', '1.25', '1.97', '1.84', '2.34', '1.19', '1.20', '1.20'], 500),
   [8, 25, 24538]),
  ('variant scenario 2', (['1.20', '1.19', '2.31', '1.60', '1.69'], 100), [4, 10, 971])],
 [('control treble', (['2.00', '2.00', '2.00'], 100), [3, 5, 835]),
  ('boundary minimum odds leg', (['1.20', '2.00', '2.00'], 100), [3, 5, 499]),
  ('boundary short leg does not qualify', (['1.19', '2.00', '2.00'], 100), [2, 0, 476]),
  ('boundary eight legs capped',
   (['1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50'], 100),
   [8, 25, 3178]),
  ('regression: minimum odds boundary', (['1.25', '1.64', '1.20'], 1000), [3, 5, 2533]),
  ('regression: minimum odds boundary', (['1.25', '1.15', '1.19', '2.50'], 500), [2, 0, 2138]),
  ('variant scenario 1', (['1.86', '1.45', '1.72', '1.20'], 100), [4, 10, 602]),
  ('variant scenario 2', (['1.25', '1.25'], 500), [2, 0, 781])],
 [('control treble', (['2.00', '2.00', '2.00'], 100), [3, 5, 835]),
  ('boundary minimum odds leg', (['1.20', '2.00', '2.00'], 100), [3, 5, 499]),
  ('boundary short leg does not qualify', (['1.19', '2.00', '2.00'], 100), [2, 0, 476]),
  ('boundary eight legs capped',
   (['1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50'], 100),
   [8, 25, 3178]),
  ('regression: minimum odds boundary', (['1.19', '1.25'], 500), [1, 0, 743]),
  ('regression: minimum odds boundary',
   (['1.15', '1.19', '1.15', '1.20', '2.77', '1.15', '1.19'], 100),
   [2, 0, 715]),
  ('variant scenario 1', (['1.70', '1.25', '1.25', '1.25', '1.19', '2.01'], 1000), [5, 15, 8983]),
  ('variant scenario 2',
   (['1.15', '1.25', '1.19', '1.92', '1.96', '1.25', '2.92', '1.10'], 500),
   [5, 15, 14786])],
 [('control treble', (['2.00', '2.00', '2.00'], 100), [3, 5, 835]),
  ('boundary minimum odds leg', (['1.20', '2.00', '2.00'], 100), [3, 5, 499]),
  ('boundary short leg does not qualify', (['1.19', '2.00', '2.00'], 100), [2, 0, 476]),
  ('boundary eight legs capped',
   (['1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50'], 100),
   [8, 25, 3178]),
  ('regression: minimum odds boundary', (['1.25', '1.15', '1.15'], 100), [1, 0, 165]),
  ('regression: minimum odds boundary',
   (['1.52', '1.19', '1.19', '1.25', '1.20', '1.44', '2.15'], 500),
   [5, 15, 5672]),
  ('variant scenario 1', (['1.25', '1.25', '1.62', '2.12', '1.25', '1.25'], 1000), [6, 20, 9861]),
  ('variant scenario 2',
   (['2.10', '1.19', '1.15', '1.53', '1.25', '1.15', '1.25'], 100),
   [4, 10, 859])],
 [('control treble', (['2.00', '2.00', '2.00'], 100), [3, 5, 835]),
  ('boundary minimum odds leg', (['1.20', '2.00', '2.00'], 100), [3, 5, 499]),
  ('boundary short leg does not qualify', (['1.19', '2.00', '2.00'], 100), [2, 0, 476]),
  ('boundary eight legs capped',
   (['1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50', '1.50'], 100),
   [8, 25, 3178]),
  ('regression: minimum odds boundary',
   (['1.25', '1.19', '1.25', '2.32', '1.20', '2.77', '1.95'], 500),
   [6, 20, 16676]),
  ('variant scenario 1', (['1.19', '2.59', '1.19', '1.25', '1.75', '1.25'], 500), [4, 10, 5465]),
  ('variant scenario 2', (['1.15', '1.25', '2.35'], 500), [2, 0, 1689])]]
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 treble[3, 5, 835][3, 5, 835]Passed
boundary minimum odds leg[3, 5, 499][3, 5, 499]Passed
boundary short leg does not qualify[2, 0, 476][2, 0, 476]Passed
boundary eight legs capped[8, 25, 3178][8, 25, 3178]Passed
regression: minimum odds boundary[6, 20, 33692][6, 20, 33692]Passed
variant scenario 1[8, 25, 24538][8, 25, 24538]Passed
variant scenario 2[4, 10, 971][4, 10, 971]Passed

SHA-256 / aaee990e96cfb2ad55ce78824f522b869dd80ac1fcef8262b200b6311b71b26b

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

Case digest / da7e5511141f5d154b6ddc9453ee69faf12b2ac36da7b5c81eddb66a0449818c