FA-84771 / Betting odds conversion / Open access
Six-leg teaser looks up a missing payout row · case 01
Teasers with more than five winning legs crash or pay only the stake.
ROOT CAUSE
The table lookup is not capped at five legs.
VERIFIED REPAIR
Use the five-leg payout for five or more winners.
Unsuccessful approach: Defaulting missing rows to zero pays nothing extra.
Case contract
Point-spread teaser. legs rows are [team spread line, team margin of victory]; every line is moved in the bettor's favour by points (adjusted = line + points). A leg wins if margin + adjusted > 0, pushes if = 0, loses if < 0. Any losing leg loses the ticket. Pushed legs are dropped; fewer than 2 remaining winners refunds the stake. Payout by winning legs from the American table {2: -120, 3: +160, 4: +260, 5: +400} (5 or more pay +400). Return [status, return cents rounded down].
Why this case matters
Sportsbooks grade teasers with shifted lines, push reduction and a tiered payout table.
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(legs, points, stake_cents):
TABLE = {2: -120, 3: 160, 4: 260, 5: 400}
wins = 0
for line, margin in legs:
adj = Fraction(line) + Fraction(points)
v = margin + adj
if v < 0:
return ['lose', 0]
if v > 0:
wins += 1
if wins < 2:
return ['refund', stake_cents]
am = TABLE[wins]
dec = 1 + (Fraction(am, 100) if am > 0 else Fraction(100, -am))
return ['win', math.floor(stake_cents * dec)]
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 two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
('regression: table cap',
([['+2.5', 13], ['-7', 2], ['+1.5', -3], ['-7', 6], ['-10', 8], ['-1', -1]], '6', 1000),
['win', 5000]),
('variant scenario 1', ([['+2.5', 0], ['+2.5', 1], ['+3', -9]], '7', 500), ['win', 1300]),
('variant scenario 2',
([['+1.5', 9], ['-7', 2], ['-6', -1], ['-1', 8], ['+1.5', -10]], '7', 500),
['lose', 0])],
[('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
('regression: table cap',
([['+2.5', 6], ['-6', 11], ['-7', 1], ['-1', 8], ['-1', -5], ['+7', -7]], '6.5', 1100),
['win', 5500]),
('variant scenario 1',
([['-1', -12], ['-3', -7], ['+2.5', 8], ['+3', -8]], '6', 500),
['lose', 0]),
('variant scenario 2',
([['-1', -10], ['-7', -12], ['-7.5', -9], ['+2.5', 2], ['-1', 14], ['-7', -7]], '7', 500),
['lose', 0])],
[('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
('regression: table cap',
([['+7', -13], ['+1.5', -2], ['-1', -4], ['-3', -1], ['+1.5', -3], ['+3', 5]], '7', 500),
['win', 2500]),
('variant scenario 1',
([['-6', -7], ['-3', 3], ['-10', -2], ['+7', 2], ['-1', -8]], '6.5', 1000),
['lose', 0]),
('variant scenario 2',
([['-10', 0], ['+2.5', -4], ['+2.5', -1], ['-10', -13], ['+7', 10]], '6', 1100),
['lose', 0])],
[('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
('regression: table cap',
([['-3', 5], ['-3', 5], ['-3', 5], ['-3', 5], ['-3', 5], ['-3', 5]], '6', 1000),
['win', 5000]),
('variant scenario 1',
([['-3', -7], ['+7', -4], ['-7.5', -4], ['-3', 3]], '6.5', 1100),
['lose', 0]),
('variant scenario 2',
([['-3', 11], ['-10', 11], ['-7', -10], ['+7', -10]], '7', 1000),
['lose', 0])],
[('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
('regression: table cap',
([['+1.5', 11], ['-1', 3], ['-7.5', 10], ['-6', 13], ['+7', -8], ['-10', 8]], '6', 1000),
['win', 5000]),
('variant scenario 1',
([['+1.5', -2], ['+3', -12], ['+2.5', -1], ['-3', 6], ['+3', -2], ['+3', 3]], '6.5', 1100),
['lose', 0]),
('variant scenario 2',
([['+3', 0], ['+3', 14], ['-10', 11], ['+3', 2], ['+2.5', -8], ['-7', -6]], '6.5', 1000),
['lose', 0])]]
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 two-team teaser | ['win', 2200] | ['win', 2200] | Passed |
| boundary push drops a leg | ['win', 1833] | ['win', 1833] | Passed |
| boundary reduced to one leg | ['refund', 1000] | ['refund', 1000] | Passed |
| control losing leg | ['lose', 0] | ['lose', 0] | Passed |
| control three winners | ['win', 2600] | ['win', 2600] | Passed |
| regression: table cap | raised KeyError | ['win', 5000] | Failed |
| variant scenario 1 | ['win', 1300] | ['win', 1300] | Passed |
| variant scenario 2 | ['lose', 0] | ['lose', 0] | Passed |
SHA-256 / ee1e87fc2bd4508f6dc29a8b47b8b0867da43129e221dad63f02e1661f6eff7f
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(legs, points, stake_cents):
TABLE = {2: -120, 3: 160, 4: 260, 5: 400}
wins = 0
for line, margin in legs:
adj = Fraction(line) + Fraction(points)
v = margin + adj
if v < 0:
return ['lose', 0]
if v > 0:
wins += 1
if wins < 2:
return ['refund', stake_cents]
am = TABLE.get(wins, 0)
dec = 1 + (Fraction(am, 100) if am > 0 else Fraction(100, -am))
return ['win', math.floor(stake_cents * dec)]
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 two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
('regression: table cap',
([['+2.5', 13], ['-7', 2], ['+1.5', -3], ['-7', 6], ['-10', 8], ['-1', -1]], '6', 1000),
['win', 5000]),
('variant scenario 1', ([['+2.5', 0], ['+2.5', 1], ['+3', -9]], '7', 500), ['win', 1300]),
('variant scenario 2',
([['+1.5', 9], ['-7', 2], ['-6', -1], ['-1', 8], ['+1.5', -10]], '7', 500),
['lose', 0])],
[('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
('regression: table cap',
([['+2.5', 6], ['-6', 11], ['-7', 1], ['-1', 8], ['-1', -5], ['+7', -7]], '6.5', 1100),
['win', 5500]),
('variant scenario 1',
([['-1', -12], ['-3', -7], ['+2.5', 8], ['+3', -8]], '6', 500),
['lose', 0]),
('variant scenario 2',
([['-1', -10], ['-7', -12], ['-7.5', -9], ['+2.5', 2], ['-1', 14], ['-7', -7]], '7', 500),
['lose', 0])],
[('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
('regression: table cap',
([['+7', -13], ['+1.5', -2], ['-1', -4], ['-3', -1], ['+1.5', -3], ['+3', 5]], '7', 500),
['win', 2500]),
('variant scenario 1',
([['-6', -7], ['-3', 3], ['-10', -2], ['+7', 2], ['-1', -8]], '6.5', 1000),
['lose', 0]),
('variant scenario 2',
([['-10', 0], ['+2.5', -4], ['+2.5', -1], ['-10', -13], ['+7', 10]], '6', 1100),
['lose', 0])],
[('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
('regression: table cap',
([['-3', 5], ['-3', 5], ['-3', 5], ['-3', 5], ['-3', 5], ['-3', 5]], '6', 1000),
['win', 5000]),
('variant scenario 1',
([['-3', -7], ['+7', -4], ['-7.5', -4], ['-3', 3]], '6.5', 1100),
['lose', 0]),
('variant scenario 2',
([['-3', 11], ['-10', 11], ['-7', -10], ['+7', -10]], '7', 1000),
['lose', 0])],
[('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
('regression: table cap',
([['+1.5', 11], ['-1', 3], ['-7.5', 10], ['-6', 13], ['+7', -8], ['-10', 8]], '6', 1000),
['win', 5000]),
('variant scenario 1',
([['+1.5', -2], ['+3', -12], ['+2.5', -1], ['-3', 6], ['+3', -2], ['+3', 3]], '6.5', 1100),
['lose', 0]),
('variant scenario 2',
([['+3', 0], ['+3', 14], ['-10', 11], ['+3', 2], ['+2.5', -8], ['-7', -6]], '6.5', 1000),
['lose', 0])]]
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 two-team teaser | ['win', 2200] | ['win', 2200] | Passed |
| boundary push drops a leg | ['win', 1833] | ['win', 1833] | Passed |
| boundary reduced to one leg | ['refund', 1000] | ['refund', 1000] | Passed |
| control losing leg | ['lose', 0] | ['lose', 0] | Passed |
| control three winners | ['win', 2600] | ['win', 2600] | Passed |
| regression: table cap | raised ZeroDivisionError | ['win', 5000] | Failed |
| variant scenario 1 | ['win', 1300] | ['win', 1300] | Passed |
| variant scenario 2 | ['lose', 0] | ['lose', 0] | Passed |
SHA-256 / 79638069f22d4ddb6735a0cbb098901337c4b873b994feea9ce1008bed33a6b7
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(legs, points, stake_cents):
TABLE = {2: -120, 3: 160, 4: 260, 5: 400}
wins = 0
for line, margin in legs:
adj = Fraction(line) + Fraction(points)
v = margin + adj
if v < 0:
return ['lose', 0]
if v > 0:
wins += 1
if wins < 2:
return ['refund', stake_cents]
am = TABLE[min(wins, 5)]
dec = 1 + (Fraction(am, 100) if am > 0 else Fraction(100, -am))
return ['win', math.floor(stake_cents * dec)]
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 two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
('regression: table cap',
([['+2.5', 13], ['-7', 2], ['+1.5', -3], ['-7', 6], ['-10', 8], ['-1', -1]], '6', 1000),
['win', 5000]),
('variant scenario 1', ([['+2.5', 0], ['+2.5', 1], ['+3', -9]], '7', 500), ['win', 1300]),
('variant scenario 2',
([['+1.5', 9], ['-7', 2], ['-6', -1], ['-1', 8], ['+1.5', -10]], '7', 500),
['lose', 0])],
[('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
('regression: table cap',
([['+2.5', 6], ['-6', 11], ['-7', 1], ['-1', 8], ['-1', -5], ['+7', -7]], '6.5', 1100),
['win', 5500]),
('variant scenario 1',
([['-1', -12], ['-3', -7], ['+2.5', 8], ['+3', -8]], '6', 500),
['lose', 0]),
('variant scenario 2',
([['-1', -10], ['-7', -12], ['-7.5', -9], ['+2.5', 2], ['-1', 14], ['-7', -7]], '7', 500),
['lose', 0])],
[('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
('regression: table cap',
([['+7', -13], ['+1.5', -2], ['-1', -4], ['-3', -1], ['+1.5', -3], ['+3', 5]], '7', 500),
['win', 2500]),
('variant scenario 1',
([['-6', -7], ['-3', 3], ['-10', -2], ['+7', 2], ['-1', -8]], '6.5', 1000),
['lose', 0]),
('variant scenario 2',
([['-10', 0], ['+2.5', -4], ['+2.5', -1], ['-10', -13], ['+7', 10]], '6', 1100),
['lose', 0])],
[('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
('regression: table cap',
([['-3', 5], ['-3', 5], ['-3', 5], ['-3', 5], ['-3', 5], ['-3', 5]], '6', 1000),
['win', 5000]),
('variant scenario 1',
([['-3', -7], ['+7', -4], ['-7.5', -4], ['-3', 3]], '6.5', 1100),
['lose', 0]),
('variant scenario 2',
([['-3', 11], ['-10', 11], ['-7', -10], ['+7', -10]], '7', 1000),
['lose', 0])],
[('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
('regression: table cap',
([['+1.5', 11], ['-1', 3], ['-7.5', 10], ['-6', 13], ['+7', -8], ['-10', 8]], '6', 1000),
['win', 5000]),
('variant scenario 1',
([['+1.5', -2], ['+3', -12], ['+2.5', -1], ['-3', 6], ['+3', -2], ['+3', 3]], '6.5', 1100),
['lose', 0]),
('variant scenario 2',
([['+3', 0], ['+3', 14], ['-10', 11], ['+3', 2], ['+2.5', -8], ['-7', -6]], '6.5', 1000),
['lose', 0])]]
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 two-team teaser | ['win', 2200] | ['win', 2200] | Passed |
| boundary push drops a leg | ['win', 1833] | ['win', 1833] | Passed |
| boundary reduced to one leg | ['refund', 1000] | ['refund', 1000] | Passed |
| control losing leg | ['lose', 0] | ['lose', 0] | Passed |
| control three winners | ['win', 2600] | ['win', 2600] | Passed |
| regression: table cap | ['win', 5000] | ['win', 5000] | Passed |
| variant scenario 1 | ['win', 1300] | ['win', 1300] | Passed |
| variant scenario 2 | ['lose', 0] | ['lose', 0] | Passed |
SHA-256 / 1bd5f7ba862caf9f82e591ed7c8b5569a3474b26c1c994a494277b22b2149d1d
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.088851+00:00.
Case digest / b9d835cb9c8a5ca5462d62527427cdca6c8392f7cebdef1c9ad74f145c6c24c5