FAILURE MAP
← Case archive

FA-71506 / Seismic magnitude estimation / Open access

Aki maximum-likelihood b-value: minimum event count · case 01

A single event above Mc produces a b-value.

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

ROOT CAUSE

The minimum sample guard accepts one event.

VERIFIED REPAIR

Require at least 2 events.

Unsuccessful approach: Requiring 3 rejects valid two-event estimates.

Case contract

Magnitudes, completeness and bin width in tenths. Use events with M >= Mc; fewer than 2 returns None. b = log10(e) / (mean(M) - (Mc - dM/2)); non-positive denominator returns None. Return [b rounded 0.001, n, sigma = b/sqrt(n) rounded 0.001].

Why this case matters

Gutenberg-Richter b-values feed hazard rates and foreshock studies.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(mags_x10, mc_x10, dm_x10):
    sel = [m for m in mags_x10 if m >= mc_x10]
    n = len(sel)
    if n < 1:
        return None
    mean = sum(sel) / n / 10.0
    denom = mean - (mc_x10 - dm_x10 / 2.0) / 10.0
    if denom <= 0:
        return None
    b = math.log10(math.e) / denom
    return [round(b, 3), n, round(b / math.sqrt(n), 3)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['catalogue 0', [[10, 41, 21, 20, 12], 20, 1], [0.554, 3, 0.32]], ['catalogue 1', [[18, 21, 15, 10, 25, 41, 34, 20, 20, 34, 30], 15, 1], [0.384, 10, 0.122]], ['catalogue 2', [[25, 25, 22], 15, 1], [0.457, 3, 0.264]], ['catalogue 3', [[15, 15, 25, 12, 22, 34, 20, 25], 15, 1], [0.558, 7, 0.211]], ['catalogue 4', [[25, 41, 25, 15, 25, 25, 30], 15, 1], [0.36, 7, 0.136]], ['catalogue 5', [[30, 12], 20, 1], None], ['catalogue 6', [[22, 25, 10], 15, 1], [0.483, 2, 0.341]], ['catalogue 9', [[34, 15, 20, 12, 15], 20, 1], [0.579, 2, 0.409]]], [['catalogue 7', [[34], 20, 1], None], ['catalogue 8', [[25, 25, 18, 15, 34], 15, 1], [0.488, 5, 0.218]], ['catalogue 9', [[34, 15, 20, 12, 15], 20, 1], [0.579, 2, 0.409]], ['catalogue 10', [[22, 21, 25, 30, 20, 15, 22], 15, 1], [0.568, 7, 0.215]], ['catalogue 11', [[30, 21, 25], 20, 1], [0.745, 3, 0.43]], ['catalogue 12', [[25, 15, 18, 25, 22, 15, 20, 12], 20, 1], [1.241, 4, 0.62]], ['catalogue 13', [[34, 20, 12, 18, 20, 15, 25, 25, 41], 20, 1], [0.543, 6, 0.222]], ['catalogue 21', [[20], 15, 1], None]], [['catalogue 9', [[34, 15, 20, 12, 15], 20, 1], [0.579, 2, 0.409]], ['catalogue 14', [[15], 15, 1], None], ['catalogue 15', [[20, 12, 25, 25, 22, 25, 20, 21, 30, 10, 41, 25], 15, 1], [0.398, 10, 0.126]], ['catalogue 16', [[10, 15, 20, 22], 20, 1], [2.895, 2, 2.047]], ['catalogue 17', [[22, 10, 20, 18, 25, 10, 15], 20, 1], [1.533, 3, 0.885]], ['catalogue 18', [[22, 34, 20, 18], 15, 1], [0.483, 4, 0.241]], ['catalogue 19', [[20, 41, 25, 30], 15, 1], [0.3, 4, 0.15]], ['single event above Mc', [[10, 25], 20, 1], None]], [['catalogue 9', [[34, 15, 20, 12, 15], 20, 1], [0.579, 2, 0.409]], ['catalogue 14', [[15], 15, 1], None], ['catalogue 21', [[20], 15, 1], None], ['catalogue 22', [[15, 25, 15, 21, 22, 41, 18, 20, 10, 10], 15, 1], [0.57, 8, 0.201]], ['catalogue 23', [[21, 34, 18], 20, 1], [0.543, 2, 0.384]], ['catalogue 24', [[20], 20, 1], None], ['catalogue 25', [[25, 34, 34, 20, 12], 20, 1], [0.496, 4, 0.248]], ['catalogue 26', [[25, 18, 25, 10, 10, 41, 20, 12, 34, 25], 15, 1], [0.351, 7, 0.133]]], [['catalogue 9', [[34, 15, 20, 12, 15], 20, 1], [0.579, 2, 0.409]], ['catalogue 28', [[22, 18, 21, 25, 20, 15], 15, 1], [0.766, 6, 0.313]], ['catalogue 29', [[12, 25, 15, 20, 22, 41], 15, 1], [0.43, 5, 0.192]], ['catalogue 30', [[22], 20, 1], None], ['catalogue 31', [[10, 18, 22, 41, 30, 18, 41, 20, 25, 10, 22, 34], 15, 1], [0.345, 10, 0.109]], ['catalogue 32', [[20, 20, 25], 15, 1], [0.606, 3, 0.35]], ['catalogue 33', [[34, 18, 15, 12, 25, 34, 21, 30, 15, 41], 15, 1], [0.381, 9, 0.127]], ['event one bin below Mc', [[19, 20, 25, 30], 20, 1], [0.79, 3, 0.456]]]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*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
catalogue 0[0.554, 3, 0.32][0.554, 3, 0.32]Passed
catalogue 1[0.384, 10, 0.122][0.384, 10, 0.122]Passed
catalogue 2[0.457, 3, 0.264][0.457, 3, 0.264]Passed
catalogue 3[0.558, 7, 0.211][0.558, 7, 0.211]Passed
catalogue 4[0.36, 7, 0.136][0.36, 7, 0.136]Passed
catalogue 5[0.414, 1, 0.414]NoneFailed
catalogue 6[0.483, 2, 0.341][0.483, 2, 0.341]Passed
catalogue 9[0.579, 2, 0.409][0.579, 2, 0.409]Passed

SHA-256 / ccb6bbfbb513847e6d4e071b4d088e9fc2395bc2d11b69cb31b2100733d13e4d

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(mags_x10, mc_x10, dm_x10):
    sel = [m for m in mags_x10 if m >= mc_x10]
    n = len(sel)
    if n <= 2:
        return None
    mean = sum(sel) / n / 10.0
    denom = mean - (mc_x10 - dm_x10 / 2.0) / 10.0
    if denom <= 0:
        return None
    b = math.log10(math.e) / denom
    return [round(b, 3), n, round(b / math.sqrt(n), 3)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['catalogue 0', [[10, 41, 21, 20, 12], 20, 1], [0.554, 3, 0.32]], ['catalogue 1', [[18, 21, 15, 10, 25, 41, 34, 20, 20, 34, 30], 15, 1], [0.384, 10, 0.122]], ['catalogue 2', [[25, 25, 22], 15, 1], [0.457, 3, 0.264]], ['catalogue 3', [[15, 15, 25, 12, 22, 34, 20, 25], 15, 1], [0.558, 7, 0.211]], ['catalogue 4', [[25, 41, 25, 15, 25, 25, 30], 15, 1], [0.36, 7, 0.136]], ['catalogue 5', [[30, 12], 20, 1], None], ['catalogue 6', [[22, 25, 10], 15, 1], [0.483, 2, 0.341]], ['catalogue 9', [[34, 15, 20, 12, 15], 20, 1], [0.579, 2, 0.409]]], [['catalogue 7', [[34], 20, 1], None], ['catalogue 8', [[25, 25, 18, 15, 34], 15, 1], [0.488, 5, 0.218]], ['catalogue 9', [[34, 15, 20, 12, 15], 20, 1], [0.579, 2, 0.409]], ['catalogue 10', [[22, 21, 25, 30, 20, 15, 22], 15, 1], [0.568, 7, 0.215]], ['catalogue 11', [[30, 21, 25], 20, 1], [0.745, 3, 0.43]], ['catalogue 12', [[25, 15, 18, 25, 22, 15, 20, 12], 20, 1], [1.241, 4, 0.62]], ['catalogue 13', [[34, 20, 12, 18, 20, 15, 25, 25, 41], 20, 1], [0.543, 6, 0.222]], ['catalogue 21', [[20], 15, 1], None]], [['catalogue 9', [[34, 15, 20, 12, 15], 20, 1], [0.579, 2, 0.409]], ['catalogue 14', [[15], 15, 1], None], ['catalogue 15', [[20, 12, 25, 25, 22, 25, 20, 21, 30, 10, 41, 25], 15, 1], [0.398, 10, 0.126]], ['catalogue 16', [[10, 15, 20, 22], 20, 1], [2.895, 2, 2.047]], ['catalogue 17', [[22, 10, 20, 18, 25, 10, 15], 20, 1], [1.533, 3, 0.885]], ['catalogue 18', [[22, 34, 20, 18], 15, 1], [0.483, 4, 0.241]], ['catalogue 19', [[20, 41, 25, 30], 15, 1], [0.3, 4, 0.15]], ['single event above Mc', [[10, 25], 20, 1], None]], [['catalogue 9', [[34, 15, 20, 12, 15], 20, 1], [0.579, 2, 0.409]], ['catalogue 14', [[15], 15, 1], None], ['catalogue 21', [[20], 15, 1], None], ['catalogue 22', [[15, 25, 15, 21, 22, 41, 18, 20, 10, 10], 15, 1], [0.57, 8, 0.201]], ['catalogue 23', [[21, 34, 18], 20, 1], [0.543, 2, 0.384]], ['catalogue 24', [[20], 20, 1], None], ['catalogue 25', [[25, 34, 34, 20, 12], 20, 1], [0.496, 4, 0.248]], ['catalogue 26', [[25, 18, 25, 10, 10, 41, 20, 12, 34, 25], 15, 1], [0.351, 7, 0.133]]], [['catalogue 9', [[34, 15, 20, 12, 15], 20, 1], [0.579, 2, 0.409]], ['catalogue 28', [[22, 18, 21, 25, 20, 15], 15, 1], [0.766, 6, 0.313]], ['catalogue 29', [[12, 25, 15, 20, 22, 41], 15, 1], [0.43, 5, 0.192]], ['catalogue 30', [[22], 20, 1], None], ['catalogue 31', [[10, 18, 22, 41, 30, 18, 41, 20, 25, 10, 22, 34], 15, 1], [0.345, 10, 0.109]], ['catalogue 32', [[20, 20, 25], 15, 1], [0.606, 3, 0.35]], ['catalogue 33', [[34, 18, 15, 12, 25, 34, 21, 30, 15, 41], 15, 1], [0.381, 9, 0.127]], ['event one bin below Mc', [[19, 20, 25, 30], 20, 1], [0.79, 3, 0.456]]]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*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
catalogue 0[0.554, 3, 0.32][0.554, 3, 0.32]Passed
catalogue 1[0.384, 10, 0.122][0.384, 10, 0.122]Passed
catalogue 2[0.457, 3, 0.264][0.457, 3, 0.264]Passed
catalogue 3[0.558, 7, 0.211][0.558, 7, 0.211]Passed
catalogue 4[0.36, 7, 0.136][0.36, 7, 0.136]Passed
catalogue 5NoneNonePassed
catalogue 6None[0.483, 2, 0.341]Failed
catalogue 9None[0.579, 2, 0.409]Failed

SHA-256 / ce6698f0de762742bb0210963f4f62a69efd1f9246d308c49a834821f064bae6

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(mags_x10, mc_x10, dm_x10):
    sel = [m for m in mags_x10 if m >= mc_x10]
    n = len(sel)
    if n < 2:
        return None
    mean = sum(sel) / n / 10.0
    denom = mean - (mc_x10 - dm_x10 / 2.0) / 10.0
    if denom <= 0:
        return None
    b = math.log10(math.e) / denom
    return [round(b, 3), n, round(b / math.sqrt(n), 3)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['catalogue 0', [[10, 41, 21, 20, 12], 20, 1], [0.554, 3, 0.32]], ['catalogue 1', [[18, 21, 15, 10, 25, 41, 34, 20, 20, 34, 30], 15, 1], [0.384, 10, 0.122]], ['catalogue 2', [[25, 25, 22], 15, 1], [0.457, 3, 0.264]], ['catalogue 3', [[15, 15, 25, 12, 22, 34, 20, 25], 15, 1], [0.558, 7, 0.211]], ['catalogue 4', [[25, 41, 25, 15, 25, 25, 30], 15, 1], [0.36, 7, 0.136]], ['catalogue 5', [[30, 12], 20, 1], None], ['catalogue 6', [[22, 25, 10], 15, 1], [0.483, 2, 0.341]], ['catalogue 9', [[34, 15, 20, 12, 15], 20, 1], [0.579, 2, 0.409]]], [['catalogue 7', [[34], 20, 1], None], ['catalogue 8', [[25, 25, 18, 15, 34], 15, 1], [0.488, 5, 0.218]], ['catalogue 9', [[34, 15, 20, 12, 15], 20, 1], [0.579, 2, 0.409]], ['catalogue 10', [[22, 21, 25, 30, 20, 15, 22], 15, 1], [0.568, 7, 0.215]], ['catalogue 11', [[30, 21, 25], 20, 1], [0.745, 3, 0.43]], ['catalogue 12', [[25, 15, 18, 25, 22, 15, 20, 12], 20, 1], [1.241, 4, 0.62]], ['catalogue 13', [[34, 20, 12, 18, 20, 15, 25, 25, 41], 20, 1], [0.543, 6, 0.222]], ['catalogue 21', [[20], 15, 1], None]], [['catalogue 9', [[34, 15, 20, 12, 15], 20, 1], [0.579, 2, 0.409]], ['catalogue 14', [[15], 15, 1], None], ['catalogue 15', [[20, 12, 25, 25, 22, 25, 20, 21, 30, 10, 41, 25], 15, 1], [0.398, 10, 0.126]], ['catalogue 16', [[10, 15, 20, 22], 20, 1], [2.895, 2, 2.047]], ['catalogue 17', [[22, 10, 20, 18, 25, 10, 15], 20, 1], [1.533, 3, 0.885]], ['catalogue 18', [[22, 34, 20, 18], 15, 1], [0.483, 4, 0.241]], ['catalogue 19', [[20, 41, 25, 30], 15, 1], [0.3, 4, 0.15]], ['single event above Mc', [[10, 25], 20, 1], None]], [['catalogue 9', [[34, 15, 20, 12, 15], 20, 1], [0.579, 2, 0.409]], ['catalogue 14', [[15], 15, 1], None], ['catalogue 21', [[20], 15, 1], None], ['catalogue 22', [[15, 25, 15, 21, 22, 41, 18, 20, 10, 10], 15, 1], [0.57, 8, 0.201]], ['catalogue 23', [[21, 34, 18], 20, 1], [0.543, 2, 0.384]], ['catalogue 24', [[20], 20, 1], None], ['catalogue 25', [[25, 34, 34, 20, 12], 20, 1], [0.496, 4, 0.248]], ['catalogue 26', [[25, 18, 25, 10, 10, 41, 20, 12, 34, 25], 15, 1], [0.351, 7, 0.133]]], [['catalogue 9', [[34, 15, 20, 12, 15], 20, 1], [0.579, 2, 0.409]], ['catalogue 28', [[22, 18, 21, 25, 20, 15], 15, 1], [0.766, 6, 0.313]], ['catalogue 29', [[12, 25, 15, 20, 22, 41], 15, 1], [0.43, 5, 0.192]], ['catalogue 30', [[22], 20, 1], None], ['catalogue 31', [[10, 18, 22, 41, 30, 18, 41, 20, 25, 10, 22, 34], 15, 1], [0.345, 10, 0.109]], ['catalogue 32', [[20, 20, 25], 15, 1], [0.606, 3, 0.35]], ['catalogue 33', [[34, 18, 15, 12, 25, 34, 21, 30, 15, 41], 15, 1], [0.381, 9, 0.127]], ['event one bin below Mc', [[19, 20, 25, 30], 20, 1], [0.79, 3, 0.456]]]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*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
catalogue 0[0.554, 3, 0.32][0.554, 3, 0.32]Passed
catalogue 1[0.384, 10, 0.122][0.384, 10, 0.122]Passed
catalogue 2[0.457, 3, 0.264][0.457, 3, 0.264]Passed
catalogue 3[0.558, 7, 0.211][0.558, 7, 0.211]Passed
catalogue 4[0.36, 7, 0.136][0.36, 7, 0.136]Passed
catalogue 5NoneNonePassed
catalogue 6[0.483, 2, 0.341][0.483, 2, 0.341]Passed
catalogue 9[0.579, 2, 0.409][0.579, 2, 0.409]Passed

SHA-256 / 1750e2ab2e9ee76d75e966718cd2bd19a7b7d393d2247a42ea9c138f35f5f283

Verification & scope

Stipulated deterministic teaching model of a seismological magnitude procedure; constants and tables are fixed by the contract and no claim of agency or standards conformance is made. 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:48:30.292484+00:00.

Case digest / 69e11d88d4da0f186a34039104044d109a38aad5062d3b6e7bf501398c821201