FA-84366 / Betting odds conversion / Open access
Negative moneyline profit computed from the wrong ratio · case 01
A -200 favourite is expanded as a 3.00 decimal price.
ROOT CAUSE
The sign is ignored and the magnitude is always divided by 100.
THE FAILURE
The sign is ignored and the magnitude is always divided by 100.
Unsuccessful approach: Using 100 / (N + 100) mixes in the implied-probability formula and understates the profit.
Case contract
Expand an American moneyline ("+150", "150" or "-200"; magnitude at least 100, otherwise "invalid"). Profit per unit is N/100 for positive or unsigned lines and 100/N for negative lines. Return [decimal price with two decimals, reduced fractional profit "a/b", implied probability percent with one decimal], all computed exactly and rounded half up.
Why this case matters
Odds screens show American, decimal, fractional and implied-probability columns for one price.
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(american):
s = american.strip()
neg = s.startswith('-')
n = int(s.lstrip('+-'))
if n < 100:
return 'invalid'
profit = Fraction(n, 100)
dec = 1 + profit
def fmt(x, places):
q = 10 ** places
v = math.floor(x * q + Fraction(1, 2))
return '%d.%0*d' % (v // q, places, v % q)
prob = Fraction(n, n + 100) * 100 if neg else Fraction(100, n + 100) * 100
return [fmt(dec, 2), '%d/%d' % (profit.numerator, profit.denominator), fmt(prob, 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 underdog', ('+150',), ['2.50', '3/2', '40.0']),
('control favourite', ('-200',), ['1.50', '1/2', '66.7']),
('boundary even money', ('+100',), ['2.00', '1/1', '50.0']),
('boundary unsigned line', ('250',), ['3.50', '5/2', '28.6']),
('boundary below minimum', ('+50',), 'invalid'),
('control half-up decimal', ('-800',), ['1.13', '1/8', '88.9']),
('regression: favourite profit', ('-105',), ['1.95', '20/21', '51.2']),
('variant scenario 1', ('162',), ['2.62', '81/50', '38.2']),
('variant scenario 2', ('-277',), ['1.36', '100/277', '73.5'])],
[('control underdog', ('+150',), ['2.50', '3/2', '40.0']),
('control favourite', ('-200',), ['1.50', '1/2', '66.7']),
('boundary even money', ('+100',), ['2.00', '1/1', '50.0']),
('boundary unsigned line', ('250',), ['3.50', '5/2', '28.6']),
('boundary below minimum', ('+50',), 'invalid'),
('control half-up decimal', ('-800',), ['1.13', '1/8', '88.9']),
('regression: favourite profit', ('-474',), ['1.21', '50/237', '82.6']),
('variant scenario 1', ('+1140',), ['12.40', '57/5', '8.1']),
('variant scenario 2', ('+1195',), ['12.95', '239/20', '7.7'])],
[('control underdog', ('+150',), ['2.50', '3/2', '40.0']),
('control favourite', ('-200',), ['1.50', '1/2', '66.7']),
('boundary even money', ('+100',), ['2.00', '1/1', '50.0']),
('boundary unsigned line', ('250',), ['3.50', '5/2', '28.6']),
('boundary below minimum', ('+50',), 'invalid'),
('control half-up decimal', ('-800',), ['1.13', '1/8', '88.9']),
('regression: favourite profit', ('-1020',), ['1.10', '5/51', '91.1']),
('variant scenario 1', ('110',), ['2.10', '11/10', '47.6']),
('variant scenario 2', ('-225',), ['1.44', '4/9', '69.2'])],
[('control underdog', ('+150',), ['2.50', '3/2', '40.0']),
('control favourite', ('-200',), ['1.50', '1/2', '66.7']),
('boundary even money', ('+100',), ['2.00', '1/1', '50.0']),
('boundary unsigned line', ('250',), ['3.50', '5/2', '28.6']),
('boundary below minimum', ('+50',), 'invalid'),
('control half-up decimal', ('-800',), ['1.13', '1/8', '88.9']),
('regression: favourite profit', ('-397',), ['1.25', '100/397', '79.9']),
('variant scenario 1', ('+355',), ['4.55', '71/20', '22.0']),
('variant scenario 2', ('-179',), ['1.56', '100/179', '64.2'])],
[('control underdog', ('+150',), ['2.50', '3/2', '40.0']),
('control favourite', ('-200',), ['1.50', '1/2', '66.7']),
('boundary even money', ('+100',), ['2.00', '1/1', '50.0']),
('boundary unsigned line', ('250',), ['3.50', '5/2', '28.6']),
('boundary below minimum', ('+50',), 'invalid'),
('control half-up decimal', ('-800',), ['1.13', '1/8', '88.9']),
('regression: favourite profit', ('-363',), ['1.28', '100/363', '78.4']),
('variant scenario 1', ('267',), ['3.67', '267/100', '27.2']),
('variant scenario 2', ('+486',), ['5.86', '243/50', '17.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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| control underdog | ['2.50', '3/2', '40.0'] | ['2.50', '3/2', '40.0'] | Passed |
| control favourite | ['3.00', '2/1', '66.7'] | ['1.50', '1/2', '66.7'] | Failed |
| boundary even money | ['2.00', '1/1', '50.0'] | ['2.00', '1/1', '50.0'] | Passed |
| boundary unsigned line | ['3.50', '5/2', '28.6'] | ['3.50', '5/2', '28.6'] | Passed |
| boundary below minimum | invalid | invalid | Passed |
| control half-up decimal | ['9.00', '8/1', '88.9'] | ['1.13', '1/8', '88.9'] | Failed |
| regression: favourite profit | ['2.05', '21/20', '51.2'] | ['1.95', '20/21', '51.2'] | Failed |
| variant scenario 1 | ['2.62', '81/50', '38.2'] | ['2.62', '81/50', '38.2'] | Passed |
| variant scenario 2 | ['3.77', '277/100', '73.5'] | ['1.36', '100/277', '73.5'] | Failed |
SHA-256 / 8830d5fe2291a698bd6f410e5800095dbb301e676cc3c2d1d6cbbb897558bd1f
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(american):
s = american.strip()
neg = s.startswith('-')
n = int(s.lstrip('+-'))
if n < 100:
return 'invalid'
profit = Fraction(100, n + 100) if neg else Fraction(n, 100)
dec = 1 + profit
def fmt(x, places):
q = 10 ** places
v = math.floor(x * q + Fraction(1, 2))
return '%d.%0*d' % (v // q, places, v % q)
prob = Fraction(n, n + 100) * 100 if neg else Fraction(100, n + 100) * 100
return [fmt(dec, 2), '%d/%d' % (profit.numerator, profit.denominator), fmt(prob, 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 underdog', ('+150',), ['2.50', '3/2', '40.0']),
('control favourite', ('-200',), ['1.50', '1/2', '66.7']),
('boundary even money', ('+100',), ['2.00', '1/1', '50.0']),
('boundary unsigned line', ('250',), ['3.50', '5/2', '28.6']),
('boundary below minimum', ('+50',), 'invalid'),
('control half-up decimal', ('-800',), ['1.13', '1/8', '88.9']),
('regression: favourite profit', ('-105',), ['1.95', '20/21', '51.2']),
('variant scenario 1', ('162',), ['2.62', '81/50', '38.2']),
('variant scenario 2', ('-277',), ['1.36', '100/277', '73.5'])],
[('control underdog', ('+150',), ['2.50', '3/2', '40.0']),
('control favourite', ('-200',), ['1.50', '1/2', '66.7']),
('boundary even money', ('+100',), ['2.00', '1/1', '50.0']),
('boundary unsigned line', ('250',), ['3.50', '5/2', '28.6']),
('boundary below minimum', ('+50',), 'invalid'),
('control half-up decimal', ('-800',), ['1.13', '1/8', '88.9']),
('regression: favourite profit', ('-474',), ['1.21', '50/237', '82.6']),
('variant scenario 1', ('+1140',), ['12.40', '57/5', '8.1']),
('variant scenario 2', ('+1195',), ['12.95', '239/20', '7.7'])],
[('control underdog', ('+150',), ['2.50', '3/2', '40.0']),
('control favourite', ('-200',), ['1.50', '1/2', '66.7']),
('boundary even money', ('+100',), ['2.00', '1/1', '50.0']),
('boundary unsigned line', ('250',), ['3.50', '5/2', '28.6']),
('boundary below minimum', ('+50',), 'invalid'),
('control half-up decimal', ('-800',), ['1.13', '1/8', '88.9']),
('regression: favourite profit', ('-1020',), ['1.10', '5/51', '91.1']),
('variant scenario 1', ('110',), ['2.10', '11/10', '47.6']),
('variant scenario 2', ('-225',), ['1.44', '4/9', '69.2'])],
[('control underdog', ('+150',), ['2.50', '3/2', '40.0']),
('control favourite', ('-200',), ['1.50', '1/2', '66.7']),
('boundary even money', ('+100',), ['2.00', '1/1', '50.0']),
('boundary unsigned line', ('250',), ['3.50', '5/2', '28.6']),
('boundary below minimum', ('+50',), 'invalid'),
('control half-up decimal', ('-800',), ['1.13', '1/8', '88.9']),
('regression: favourite profit', ('-397',), ['1.25', '100/397', '79.9']),
('variant scenario 1', ('+355',), ['4.55', '71/20', '22.0']),
('variant scenario 2', ('-179',), ['1.56', '100/179', '64.2'])],
[('control underdog', ('+150',), ['2.50', '3/2', '40.0']),
('control favourite', ('-200',), ['1.50', '1/2', '66.7']),
('boundary even money', ('+100',), ['2.00', '1/1', '50.0']),
('boundary unsigned line', ('250',), ['3.50', '5/2', '28.6']),
('boundary below minimum', ('+50',), 'invalid'),
('control half-up decimal', ('-800',), ['1.13', '1/8', '88.9']),
('regression: favourite profit', ('-363',), ['1.28', '100/363', '78.4']),
('variant scenario 1', ('267',), ['3.67', '267/100', '27.2']),
('variant scenario 2', ('+486',), ['5.86', '243/50', '17.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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| control underdog | ['2.50', '3/2', '40.0'] | ['2.50', '3/2', '40.0'] | Passed |
| control favourite | ['1.33', '1/3', '66.7'] | ['1.50', '1/2', '66.7'] | Failed |
| boundary even money | ['2.00', '1/1', '50.0'] | ['2.00', '1/1', '50.0'] | Passed |
| boundary unsigned line | ['3.50', '5/2', '28.6'] | ['3.50', '5/2', '28.6'] | Passed |
| boundary below minimum | invalid | invalid | Passed |
| control half-up decimal | ['1.11', '1/9', '88.9'] | ['1.13', '1/8', '88.9'] | Failed |
| regression: favourite profit | ['1.49', '20/41', '51.2'] | ['1.95', '20/21', '51.2'] | Failed |
| variant scenario 1 | ['2.62', '81/50', '38.2'] | ['2.62', '81/50', '38.2'] | Passed |
| variant scenario 2 | ['1.27', '100/377', '73.5'] | ['1.36', '100/277', '73.5'] | Failed |
SHA-256 / aa949d2b87d9badc85c83f40c1c086414bd5bea8c07824051ee4fa96c6234a8a
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 9 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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:30.283778+00:00.
Case digest / cf94529f93081043bf7dc72ed071416dd0e4ed1153f5850349b143ed09359194