FA-84806 / Betting odds conversion / Open access
Non-qualifying legs counted towards the bonus · case 01
Short-priced legs push the accumulator into a higher bonus band.
ROOT CAUSE
Every leg increments the qualifying count.
VERIFIED REPAIR
Count only legs meeting the minimum odds.
Unsuccessful approach: Excluding the short legs from the price as well as the count underpays the accumulator.
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
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: qualification count', (['1.45', '1.25', '1.19'], 500), [2, 0, 1078]),
('variant scenario 1',
(['1.74', '1.15', '1.20', '1.34', '1.25', '1.39', '1.20'], 100),
[6, 20, 785]),
('variant scenario 2', (['1.19', '1.20'], 1000), [1, 0, 1428])],
[('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: qualification count',
(['1.15', '1.33', '1.25', '1.19', '1.84', '1.50', '2.96', '1.25'], 500),
[6, 20, 13840]),
('variant scenario 1', (['1.19', '1.44', '1.20', '1.20', '1.19'], 500), [3, 5, 1516]),
('variant scenario 2', (['2.11', '1.19', '2.26', '1.15'], 1000), [2, 0, 6525])],
[('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: qualification count',
(['1.20', '1.30', '1.19', '1.25', '1.74', '1.15'], 500),
[4, 10, 2503]),
('variant scenario 1', (['2.94', '2.63', '1.25', '1.54', '1.20'], 1000), [5, 15, 20390]),
('variant scenario 2', (['1.49', '1.25', '1.15', '1.25', '1.20'], 500), [4, 10, 1717])],
[('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: qualification count', (['1.20', '1.19'], 500), [1, 0, 714]),
('variant scenario 1',
(['1.72', '1.25', '1.20', '1.25', '1.19', '1.19', '1.15', '1.15'], 1000),
[4, 10, 6543]),
('variant scenario 2',
(['2.88', '1.32', '1.15', '1.38', '1.62', '2.77', '1.19'], 100),
[5, 15, 3689])],
[('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: qualification count',
(['1.19', '1.87', '1.25', '1.20', '1.20', '1.25'], 1000),
[5, 15, 5607]),
('variant scenario 1', (['1.25', '1.15', '1.20', '1.25', '1.25'], 100), [4, 10, 286]),
('variant scenario 2',
(['1.20', '1.15', '1.20', '1.42', '2.58', '1.15', '1.25'], 100),
[5, 15, 987])]]
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 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: qualification count | [3, 5, 1107] | [2, 0, 1078] | Failed |
| variant scenario 1 | [7, 25, 813] | [6, 20, 785] | Failed |
| variant scenario 2 | [2, 0, 1428] | [1, 0, 1428] | Failed |
SHA-256 / ec50c5016da37a3b3de2b28c2a592ca017f7e5f5a79a5db89e39e4063082dfaf
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)
if d >= Fraction(120, 100):
factor *= d
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: qualification count', (['1.45', '1.25', '1.19'], 500), [2, 0, 1078]),
('variant scenario 1',
(['1.74', '1.15', '1.20', '1.34', '1.25', '1.39', '1.20'], 100),
[6, 20, 785]),
('variant scenario 2', (['1.19', '1.20'], 1000), [1, 0, 1428])],
[('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: qualification count',
(['1.15', '1.33', '1.25', '1.19', '1.84', '1.50', '2.96', '1.25'], 500),
[6, 20, 13840]),
('variant scenario 1', (['1.19', '1.44', '1.20', '1.20', '1.19'], 500), [3, 5, 1516]),
('variant scenario 2', (['2.11', '1.19', '2.26', '1.15'], 1000), [2, 0, 6525])],
[('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: qualification count',
(['1.20', '1.30', '1.19', '1.25', '1.74', '1.15'], 500),
[4, 10, 2503]),
('variant scenario 1', (['2.94', '2.63', '1.25', '1.54', '1.20'], 1000), [5, 15, 20390]),
('variant scenario 2', (['1.49', '1.25', '1.15', '1.25', '1.20'], 500), [4, 10, 1717])],
[('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: qualification count', (['1.20', '1.19'], 500), [1, 0, 714]),
('variant scenario 1',
(['1.72', '1.25', '1.20', '1.25', '1.19', '1.19', '1.15', '1.15'], 1000),
[4, 10, 6543]),
('variant scenario 2',
(['2.88', '1.32', '1.15', '1.38', '1.62', '2.77', '1.19'], 100),
[5, 15, 3689])],
[('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: qualification count',
(['1.19', '1.87', '1.25', '1.20', '1.20', '1.25'], 1000),
[5, 15, 5607]),
('variant scenario 1', (['1.25', '1.15', '1.20', '1.25', '1.25'], 100), [4, 10, 286]),
('variant scenario 2',
(['1.20', '1.15', '1.20', '1.42', '2.58', '1.15', '1.25'], 100),
[5, 15, 987])]]
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 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, 400] | [2, 0, 476] | Failed |
| boundary eight legs capped | [8, 25, 3178] | [8, 25, 3178] | Passed |
| regression: qualification count | [2, 0, 906] | [2, 0, 1078] | Failed |
| variant scenario 1 | [6, 20, 680] | [6, 20, 785] | Failed |
| variant scenario 2 | [1, 0, 1200] | [1, 0, 1428] | Failed |
SHA-256 / 6235f91479ee6a860d4cbfd7633b1dfd069bb28e2235dc330cceea80d5d7f515
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: qualification count', (['1.45', '1.25', '1.19'], 500), [2, 0, 1078]),
('variant scenario 1',
(['1.74', '1.15', '1.20', '1.34', '1.25', '1.39', '1.20'], 100),
[6, 20, 785]),
('variant scenario 2', (['1.19', '1.20'], 1000), [1, 0, 1428])],
[('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: qualification count',
(['1.15', '1.33', '1.25', '1.19', '1.84', '1.50', '2.96', '1.25'], 500),
[6, 20, 13840]),
('variant scenario 1', (['1.19', '1.44', '1.20', '1.20', '1.19'], 500), [3, 5, 1516]),
('variant scenario 2', (['2.11', '1.19', '2.26', '1.15'], 1000), [2, 0, 6525])],
[('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: qualification count',
(['1.20', '1.30', '1.19', '1.25', '1.74', '1.15'], 500),
[4, 10, 2503]),
('variant scenario 1', (['2.94', '2.63', '1.25', '1.54', '1.20'], 1000), [5, 15, 20390]),
('variant scenario 2', (['1.49', '1.25', '1.15', '1.25', '1.20'], 500), [4, 10, 1717])],
[('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: qualification count', (['1.20', '1.19'], 500), [1, 0, 714]),
('variant scenario 1',
(['1.72', '1.25', '1.20', '1.25', '1.19', '1.19', '1.15', '1.15'], 1000),
[4, 10, 6543]),
('variant scenario 2',
(['2.88', '1.32', '1.15', '1.38', '1.62', '2.77', '1.19'], 100),
[5, 15, 3689])],
[('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: qualification count',
(['1.19', '1.87', '1.25', '1.20', '1.20', '1.25'], 1000),
[5, 15, 5607]),
('variant scenario 1', (['1.25', '1.15', '1.20', '1.25', '1.25'], 100), [4, 10, 286]),
('variant scenario 2',
(['1.20', '1.15', '1.20', '1.42', '2.58', '1.15', '1.25'], 100),
[5, 15, 987])]]
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 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: qualification count | [2, 0, 1078] | [2, 0, 1078] | Passed |
| variant scenario 1 | [6, 20, 785] | [6, 20, 785] | Passed |
| variant scenario 2 | [1, 0, 1428] | [1, 0, 1428] | Passed |
SHA-256 / a9349544db397be9eea29290869470e9b2e685ee0e9b2e517d9b634cc600b695
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.547618+00:00.
Case digest / aafb24e2d34a3f85335d7dc2a9f0be53abbff731c8722bc4f3a3a340a61a9806