Skip to content

Vol. II, Ch. 10

DCT Laboratory — Volume II, Chapter 10

Neuro-Fuzzy Robust Enterprise Optimization

Seed 26210 · Companion to Chapter 10 and AXIOM Lab 2.10 (module AXIOM-10) · Mirrored in DCT_V2_Ch10_Lab.xlsx

This laboratory reproduces Worked Example 10.1, What Can Meridian Guarantee Without Odds?, with the book's declarations, and works the five steps of AXIOM Lab 2.10: declare and solve, grade, judge against the law, learn rules, and certify. The levers, their prices and the floor are Chapter 9's. The new declarations have owners and no odds: the engineering office's bound on deviations and the treasury's bound on a closure, stated crisply and in graded words, and the board's graded goal for cost. Robust packages come in closed form (Proposition 10.1(ii)). They are judged under Chapter 9's law on the book's 100,000 paths, drawn from Volume I, Chapter 8's stream with seed 8, and on the book's 100,000 fresh paths, seed 26209; the lab's own seed, 26210, draws nothing new, because every chance in the chapter comes from those two streams. Every Meridian number below is the book's (Table 10.3, Figures 10.1–10.3, Online Appendix Example 10.B.2); the final cell checks them. Money is in $ million.

The declarations (Worked Example 10.1, Step 1)

Chapter 9's law, levers and floor. Planned liquidity follows the Chapter 1 plan, whose draw dips to $482 million in quarter 7 of the program's 12; the board's floor is $350 million. Execution and market deviations EE move it, E′=0.6E+wE' = 0.6E + w with ww of standard deviation $50 million a quarter; funding windows close about once a decade (0.10 a year), each removing a gamma-distributed amount (mean $120 million, standard deviation $50 million) that is never recovered. A standby line ll covers up to ll of each closure, for fees of 0.03 l0.03\,l over the program; a quarter of committed delay ϕ\phi makes the draw 4 index points shallower, at $8 million, and lifts liquidity in quarter kk by ℓk=4×6.2 Sk\ell_k = 4 \times 6.2\,S_k, with Sk=(t/2)e1−t/2S_k = (t/2)e^{1 - t/2} at t=k/4t = k/4 years. Chapter 9 kept the board's appetite, at most a 5 percent chance of a breach in some quarter, with Volume I's package: a $170 million line and two-thirds of a quarter of delay, $10.44 million.

The new declarations. The engineering office declares that deviations stay within DD of plan in every quarter, Ek≥−DE_k \ge -D; the treasury, that at most one funding window closes during the program, removing at most SS. The floor must hold in every quarter on every such future, the set U(D,S)U(D, S). In their own words, deviations are "usually within $50 million of plan, never beyond $200 million", and a closure is "most plausibly about $120 million, never above $300 million": each bound has possibility 1 up to the usual value and 0 beyond the extreme, linear between. The board states its goal for cost the same way: a guarantee "should cost about $5 million or less and surely no more than $20 million". A bank may cap the line at $100 million.

Python Code
import numpy as np
from scipy import optimize, stats
import matplotlib.pyplot as plt
plt.rcParams.update({"figure.dpi": 110, "axes.spines.top": False, "axes.spines.right": False})
SEED = 26210        # the lab's seed; nothing new is drawn: every chance in the chapter uses the two streams below
BOOK_SEED = 8       # Volume I, Chapter 8's stream: the book's 100,000 paths (Online Appendix 1.B.4)
FRESH_SEED = 26209  # the book's 100,000 fresh paths (Chapter 9's lab seed)

N, Q = 100_000, 12
FLOOR = 350.0                               # the board's floor ($m)
A_E, SD_W = 0.6, 50.0                       # execution and market: E' = 0.6 E + w, w with sd $50m a quarter
LAM, J_MEAN, J_SD = 0.10, 120.0, 50.0       # funding-window closures: 0.10 a year, gamma sizes, never recovered
DEPTH0, DPQ = 28.0, 4.0                     # the draw's depth (index points); a quarter of delay: 4 points shallower
FEE, VQ, ALPHA = 0.03, 8.0, 0.05            # line fees over the program; a quarter of delay ($m); the appetite
CAP = 100.0                                 # a bank's cap on the line ($m)

def relax(x0, x_inf, k, t):
    return x_inf + (x0 - x_inf) * np.exp(-k * t)

def trough(depth, tau, t):
    return depth * (t / tau) * np.exp(1 - t / tau)

TQ = np.arange(1, Q + 1) / 4                # the twelve quarters, in years
BASE = 6.2 * relax(100, 112, 0.35, TQ)      # planned liquidity without the draw ($m; index 100 = $620 million)
SK = trough(1.0, 2.0, TQ)                   # the draw's shape, 1 at two years
SHAPE = 6.2 * SK                            # the draw, $m per index point of depth
PLAN = BASE - DEPTH0 * SHAPE                # the plan's liquidity, no levers
# m_k, the plan's margin above the floor, and l_k, what a quarter of delay adds in quarter k, are computed in
# $ billion, as the book's engine computes them, then turned into $ million: the neuro-fuzzy training of Panel 4
# is sensitive to the last digit of its data, and this way it follows the book's digit for digit
BASE_BN, SHAPE_BN = 0.62 * relax(100, 112, 0.35, TQ) / 100.0, 0.62 * SK / 100.0
MARGIN = 1000.0 * (BASE_BN - DEPTH0 * SHAPE_BN - FLOOR / 1000.0)
LIFT = 1000.0 * DPQ * SHAPE_BN

# the offices' graded words and the board's graded goal (linear memberships)
def D_cut(a):                               # deviations: usually within 50, never beyond 200
    return 200.0 - 150.0 * a
def S_cut(a):                               # a closure: most plausibly about 120, never above 300
    return 300.0 - 180.0 * a
def mu_goal(c, full=5.0, none=20.0):        # a guarantee: about $5m or less, surely no more than $20m
    return float(np.clip((none - c) / (none - full), 0.0, 1.0))

def draw_paths(seed, n=N):
    # Volume I's random stream in the book's order: each quarter the execution shocks, the closure counts, then
    # the closure sizes path by path (Chapter 9's transcription)
    rng = np.random.default_rng(seed)
    W, closures = np.empty((n, Q)), []
    for k in range(Q):
        W[:, k] = rng.normal(0.0, SD_W, n)
        count = rng.poisson(LAM / 4, n)
        size = rng.gamma((J_MEAN / J_SD) ** 2, J_SD ** 2 / J_MEAN, count.sum())
        closures.append((np.repeat(np.arange(n), count), size))
    E, e = np.empty((n, Q)), np.zeros(n)
    for k in range(Q):
        e = A_E * e + W[:, k]
        E[:, k] = e
    return E, closures

class Paths:
    # A line l covers up to l of each closure; phi quarters of delay make the draw 28 - 4 phi deep. A path stays above
    # the floor exactly when the draw is no deeper than its critical depth, so chances are exact counts.
    def __init__(self, seed, n=N):
        self.seed, self.n = seed, n
        self.E, self.closures = draw_paths(seed, n)
        self.deepest = self.E.min(axis=1)                   # the deepest deviation below plan over the program
        self.count, self.largest = np.zeros(n, int), np.zeros(n)
        for path, size in self.closures:
            np.add.at(self.count, path, 1)
            np.maximum.at(self.largest, path, size)
    def lost(self, line):                   # cumulative closures not covered by the line ($m), quarter by quarter
        out, cum = np.empty((self.n, Q)), np.zeros(self.n)
        for k, (path, size) in enumerate(self.closures):
            cum = cum + np.bincount(path, np.maximum(size - line, 0.0), self.n)
            out[:, k] = cum
        return out
    def crit(self, line):                   # each path's critical depth
        return ((BASE + self.E - self.lost(line) - FLOOR) / SHAPE).min(axis=1)
    def odds(self, line, phi):              # the chance of a breach in some quarter
        return float(np.mean(self.crit(line) < DEPTH0 - DPQ * phi))
    def inside(self, D, S):                 # the paths that lie in U(D, S)
        return (self.deepest >= -D) & (self.count <= 1) & (self.largest <= S)

def cost(line, phi):
    return FEE * line + VQ * phi

BOOK = Paths(BOOK_SEED)                     # the book's 100,000 paths
FRESH = Paths(FRESH_SEED)                   # the book's 100,000 fresh paths
k7 = int(np.argmin(MARGIN))
print("the plan's margin above the floor by quarter ($m):", " ".join(f"{x:.1f}" for x in MARGIN))
print(f"least in quarter {k7 + 1}: planned liquidity {PLAN[k7]:.0f}, margin {MARGIN[k7]:.1f}")
print("a quarter of delay lifts liquidity by ($m):", " ".join(f"{x:.1f}" for x in LIFT),
      f"-> {LIFT[k7]:.1f} in quarter {k7 + 1}")
print(f"a dollar of closure costs {FEE:.2f} on the line; a dollar of quarter {k7 + 1}'s liquidity costs "
      f"8 / {LIFT[k7]:.1f} = {VQ / LIFT[k7]:.3f} by delay")
noise_only = float(((PLAN + BOOK.E) < FLOOR).any(axis=1).mean())
print(f"Chapter 9: deviations alone breach the floor in some quarter on {100 * noise_only:.2f}% of the book's paths")
the plan's margin above the floor by quarter ($m): 224.2 190.1 165.6 148.9 138.5 133.2 132.0 133.9 138.2 144.4 151.9 160.4
least in quarter 7: planned liquidity 482, margin 132.0
a quarter of delay lifts liquidity by ($m): 7.4 13.1 17.4 20.4 22.6 23.9 24.6 24.8 24.6 24.1 23.4 22.6 -> 24.6 in quarter 7
a dollar of closure costs 0.03 on the line; a dollar of quarter 7's liquidity costs 8 / 24.6 = 0.325 by delay
Chapter 9: deviations alone breach the floor in some quarter on 8.40% of the book's paths

Panel 1 — Declare and solve: the binding quarter and the worst case (Proposition 10.1; Worked Example 10.1, Steps 1–2: $132m in quarter 7; $55m line, $1.65m, 17.4%; $203m line, $6.09m, 8.6%)

AXIOM Lab 2.10, step 1. On U(D,S)U(D, S) the floor is a commitment linear in the deviations and in the closure beyond the line, so its worst case has a simple shape (Proposition 10.1(ii)): the deviation at −D-D and the closure in the first quarter, felt in every quarter after. The robust commitment in quarter kk reads mk+ℓkϕ−D−(S−l)+≥0m_k + \ell_k\phi - D - (S - l)^+ \ge 0. A line covers a dollar of closure for 3 cents and delay costs about 33 cents a dollar, so the cheapest package takes the least delay the deviations need, ϕ∗=max⁡k(D−mk)+/ℓk\phi^* = \max_k(D - m_k)^+/\ell_k, lets the margin absorb u∗=min⁡(S,min⁡k(mk−D+ℓkϕ∗))u^* = \min(S, \min_k(m_k - D + \ell_k\phi^*)) of the closure, and covers the rest with the line, l∗=S−u∗l^* = S - u^*; with a cap on the line, the delay carries what the line cannot. The closed form is checked against the linear program it solves and against every quarter in which the closure could come. Volume I's joint check is the set D=0D = 0, S=$187S = \$187 million (a closure's 90th percentile); asked for single numbers, the offices name $125 million and $210 million. Each package is then judged under Chapter 9's law: a set holding a share 1−α1 - \alpha of the paths promises at most the chance α\alpha (Theorem 10.1(iii)). Last, Proposition 10.3(iii): a future quiet through quarter 6 with all the damage in quarter 7 is as bad, and gives a rule that reads cash nothing to read in time.

Python Code
def robust(D, S, cap=None):
    # Proposition 10.1(ii): the least delay the deviations need; the margin absorbs what it can; the line the rest
    ph = max(0.0, float(np.max((D - MARGIN) / LIFT)))
    u = min(S, float(np.min(MARGIN - D + LIFT * ph)))
    if cap is not None and S - u > cap:         # a capped line: the delay must carry the uncovered part
        u = S - cap
        ph = max(0.0, float(np.max((D + u - MARGIN) / LIFT)))
    if ph > DEPTH0 / DPQ + 1e-12:
        return None
    need = (D + u - MARGIN) / LIFT
    return dict(D=float(D), S=float(S), line=float(S - u), delay=ph, cost=float(cost(S - u, ph)), absorbed=float(u),
                binding=int(np.argmax(need)) + 1)

def robust_lp(D, S):
    # the same package as a linear program: min 0.03 l + 8 phi subject to l + l_k phi >= D + S - m_k, 0 <= l <= S
    res = optimize.linprog([FEE, VQ], A_ub=np.column_stack([-np.ones(Q), -LIFT]), b_ub=MARGIN - D - S,
                           bounds=[(0, S), (0, DEPTH0 / DPQ)], method="highs")
    return float(res.fun)

def judge(pk):
    # under Chapter 9's law: the share of the book's paths inside the set, the chance of a breach on the book's and
    # the fresh paths, and the breaches inside the set (none: that is the guarantee)
    depth = DEPTH0 - DPQ * pk["delay"]
    c_book = BOOK.crit(pk["line"])
    inside = BOOK.inside(pk["D"], pk["S"])
    pk.update(coverage=float(inside.mean()), p=float(np.mean(c_book < depth)),
              p_fresh=float(np.mean(FRESH.crit(pk["line"]) < depth)), inside_breach=int((inside & (c_book < depth)).sum()))
    return pk

def slack_by_quarter(pk, D, S, first):
    # deviations at -D in every quarter, one closure of S in quarter `first`: liquidity less the floor, by quarter
    felt = np.arange(1, Q + 1) >= first
    return MARGIN + LIFT * pk["delay"] - D - felt * max(S - pk["line"], 0.0)

S90 = float(stats.gamma.ppf(0.9, (J_MEAN / J_SD) ** 2, scale=J_SD ** 2 / J_MEAN))
JOINT = judge(robust(0.0, 187.0))
CRISP = judge(robust(D_cut(0.5), S_cut(0.5)))
print(f"a closure's 90th percentile under Chapter 9's law: {S90:.1f}")
for name, pk in (("Volume I's joint check", JOINT), ("the crisp set, the 0.5-cut", CRISP)):
    print(f"\n{name} (D {pk['D']:.0f}, S {pk['S']:.0f}): delay {pk['delay']:.3f}; the margin absorbs {pk['absorbed']:.1f} of "
          f"a closure; line {pk['line']:.1f}; cost {pk['cost']:.2f}; binding quarter {pk['binding']}")
    print(f"  the linear program: {robust_lp(pk['D'], pk['S']):.4f} (closed form {pk['cost']:.4f})")
    print(f"  the set holds {100 * pk['coverage']:.1f}% of the book's paths: Theorem 10.1(iii) promises a chance of at most "
          f"{100 * (1 - pk['coverage']):.1f}%; under the law {100 * pk['p']:.2f}% (fresh {100 * pk['p_fresh']:.2f}%); "
          f"paths inside the set that breach: {pk['inside_breach']}")
print(f"\nthe crisp set: deviations use {CRISP['D']:.0f} of quarter 7's {MARGIN[k7]:.1f}; the closure's first "
      f"{CRISP['absorbed']:.1f} fits in the rest; the line covers {CRISP['line']:.1f}")

print("\nworst case on the crisp set (deviations at -125 in every quarter): the least slack over the 12 quarters, by the "
      "quarter of the closure")
worst = [slack_by_quarter(CRISP, CRISP["D"], CRISP["S"], j).min() for j in range(1, Q + 1)]
print("  closure in quarter " + " ".join(f"{j:6d}" for j in range(1, Q + 1)))
print("  least slack ($m)   " + " ".join(f"{x:6.1f}" for x in worst))
print(f"  a closure in quarters 1-7 is felt in quarter 7 and leaves it exactly at the floor; later ones are felt only "
      f"where the margin is larger")

# Proposition 10.3(iii): a future quiet through quarter 6, then E_7 = -D and the closure of S in quarter 7
quiet = PLAN + LIFT * CRISP["delay"]
damage = quiet.copy()
damage[k7:] -= CRISP["D"] + max(CRISP["S"] - CRISP["line"], 0.0)
same_cash = bool(np.allclose(quiet[:k7], damage[:k7]))
print(f"\nProposition 10.3(iii): cash at the end of quarters 1-6 is the quiet path's ({same_cash}); quarter 7 lands at "
      f"{damage[k7]:.2f}, the floor. A slowdown decided after quarter 6 cannot lift quarter 7: reading cash saves nothing.")

qs = np.arange(1, Q + 1)
fig, ax = plt.subplots(figsize=(7.6, 3.6))
ax.bar(qs, np.minimum(MARGIN, CRISP["D"]), width=0.62, color="#1F4E79", label="used by deviations of \\$125m (the 0.5-cut)")
ax.bar(qs, MARGIN - np.minimum(MARGIN, CRISP["D"]), bottom=np.minimum(MARGIN, CRISP["D"]), width=0.62, color="#999999",
       label="left for a closure; the line covers the rest")
ax.axhline(143.0, color="#B71C1C", lw=1.1, ls="--", label="deviations of \\$143m (the max-min cut)")
ax.annotate(f"quarter 7: \\${MARGIN[k7]:.0f}m, \\${MARGIN[k7] - CRISP['D']:.0f}m left after \\$125m", xy=(7, MARGIN[k7]),
            xytext=(3.3, 238), fontsize=8, ha="center", arrowprops=dict(arrowstyle="-", lw=0.6, color="#333333"))
ax.set(xlim=(0.4, 12.6), ylim=(0, 262), xticks=qs, xlabel="quarter of the program",
       ylabel="plan's margin above the floor ($ million)", title="Quarter 7's \\$132m margin binds every robust package (seed 26210)")
ax.legend(frameon=False, fontsize=8, loc="upper right"); plt.tight_layout(); plt.show()
a closure's 90th percentile under Chapter 9's law: 186.9

Volume I's joint check (D 0, S 187): delay 0.000; the margin absorbs 132.0 of a closure; line 55.0; cost 1.65; binding quarter 7
  the linear program: 1.6515 (closed form 1.6515)
  the set holds 1.5% of the book's paths: Theorem 10.1(iii) promises a chance of at most 98.5%; under the law 17.39% (fresh 17.12%); paths inside the set that breach: 0

the crisp set, the 0.5-cut (D 125, S 210): delay 0.000; the margin absorbs 7.0 of a closure; line 203.0; cost 6.09; binding quarter 7
  the linear program: 6.0915 (closed form 6.0915)
  the set holds 78.9% of the book's paths: Theorem 10.1(iii) promises a chance of at most 21.1%; under the law 8.64% (fresh 8.43%); paths inside the set that breach: 0

the crisp set: deviations use 125 of quarter 7's 132.0; the closure's first 7.0 fits in the rest; the line covers 203.0

worst case on the crisp set (deviations at -125 in every quarter): the least slack over the 12 quarters, by the quarter of the closure
  closure in quarter      1      2      3      4      5      6      7      8      9     10     11     12
  least slack ($m)      0.0    0.0    0.0    0.0    0.0    0.0    0.0    1.9    6.2    7.0    7.0    7.0
  a closure in quarters 1-7 is felt in quarter 7 and leaves it exactly at the floor; later ones are felt only where the margin is larger

Proposition 10.3(iii): cash at the end of quarters 1-6 is the quiet path's (True); quarter 7 lands at 350.00, the floor. A slowdown decided after quarter 6 cannot lift quarter 7: reading cash saves nothing.
Quarter 7's $132m margin binds every robust package (seed 26210)

Panel 2 — Grade: the cuts, a graded price, and the max-min choice (Theorem 10.2; Proposition 10.2; Figure 10.1; Worked Example 10.1, Step 3: $1.14m to $31.37m; the cut at 0.38, $232m line, 0.45 quarter, $10.54m)

AXIOM Lab 2.10, step 2. Combined by the minimum, the offices' words have as cut at possibility α\alpha the product of their cuts (Theorem 10.2(i)): deviations within 200−150α200 - 150\alpha and a closure within 300−180α300 - 180\alpha. Each cut is a crisp set, solved as in Panel 1, on the book's grid of α\alpha in steps of 0.01 (Online Appendix Example 10.B.2). A package robust on the cut at α\alpha breaches only in futures graded below α\alpha: the necessity of safety is 1−α1 - \alpha (Theorem 10.2(ii)). The board's goal grades the cost, μG(c)=1\mu_G(c) = 1 up to $5 million, (20−c)/15(20 - c)/15 up to $20 million, 0 beyond; the max-min choice maximizes the smaller of the goal and the necessity (Theorem 10.2(iii)), the decision of Bellman and Zadeh. The theorem finds it by bisection on the level λ\lambda, one robust problem per step; on the book's grid it is the best cut. A graded price is computed cut by cut (Proposition 10.2(i)), so its 0.5-cut is Step 2's crisp answer. The panel ends with Proposition 10.2(iii)'s hedges on the board's goal, an illustration of this lab: "very cheap" squares the goal, "somewhat cheap" takes its root.

Python Code
ALPHAS = np.round(np.arange(0.0, 1.0001, 0.01), 2)
ROWS = []
for a in ALPHAS:
    pk = robust(D_cut(a), S_cut(a))
    pk.update(alpha=float(a), goal=mu_goal(pk["cost"]), safety=1.0 - float(a))
    ROWS.append(pk)
C_ALPHA = np.array([r["cost"] for r in ROWS])
MAXMIN = max(ROWS, key=lambda r: (min(r["goal"], r["safety"]), -r["alpha"]))   # ties: the larger cut
lp_gap = max(abs(robust_lp(r["D"], r["S"]) - r["cost"]) for r in ROWS)
print("cut     D      S     line   delay    cost  binding   goal  safety")
for r in ROWS[::-10]:
    print(f"{r['alpha']:3.1f} {r['D']:6.0f} {r['S']:6.0f} {r['line']:8.1f} {r['delay']:7.3f} {r['cost']:7.2f} "
          f"{r['binding']:6d} {r['goal']:8.3f} {r['safety']:6.2f}")
print(f"\nthe graded price runs from {C_ALPHA[-1]:.2f} at possibility 1 to {C_ALPHA[0]:.2f} at 0; it never falls as the "
      f"cut grows: {bool(np.all(np.diff(C_ALPHA) <= 1e-12))}; its 0.5-cut is the crisp set's {CRISP['cost']:.2f}")
print(f"every cut's closed form equals its linear program (largest gap {lp_gap:.1e})")
print(f"\nmax-min choice: the cut at {MAXMIN['alpha']:.2f}, necessity of safety {MAXMIN['safety']:.2f}, goal "
      f"{MAXMIN['goal']:.3f}: deviations within {MAXMIN['D']:.1f}, a closure within {MAXMIN['S']:.1f}, a "
      f"{MAXMIN['line']:.1f} line and {MAXMIN['delay']:.3f} quarter of delay, {MAXMIN['cost']:.2f}")

def cut_cost(a):
    return robust(D_cut(a), S_cut(a))["cost"]
lo, hi = 0.0, 1.0                           # Theorem 10.2(iii): the levels lambda with mu_G(C(1 - lambda)) >= lambda
for _ in range(50):
    mid = 0.5 * (lo + hi)
    lo, hi = (mid, hi) if mu_goal(cut_cost(1 - mid)) >= mid else (lo, mid)
LAM_STAR = lo
print(f"bisection on the level: lambda* = {LAM_STAR:.4f}, the cut at {1 - LAM_STAR:.4f}, cost {cut_cost(1 - LAM_STAR):.2f}; "
      f"on the book's grid of 0.01, the cut at {MAXMIN['alpha']:.2f}")

def maxmin_hedged(power):                   # the board's goal raised to a power: 2 is "very cheap", 1/2 "somewhat"
    return max(ROWS, key=lambda r: (min(r["goal"] ** power, r["safety"]), -r["alpha"]))
HEDGE = {p_: maxmin_hedged(p_) for p_ in (2.0, 1.0, 0.5)}
for p_, word in ((2.0, "very cheap"), (1.0, "the board's goal"), (0.5, "somewhat cheap")):
    r = HEDGE[p_]
    print(f"  {word:16s}: level {min(r['goal'] ** p_, r['safety']):.2f} at the cut {r['alpha']:.2f}, cost {r['cost']:.2f}")
hedge_order = (min(HEDGE[2.0]["goal"] ** 2, HEDGE[2.0]["safety"]) <= min(MAXMIN["goal"], MAXMIN["safety"])
               <= min(HEDGE[0.5]["goal"] ** 0.5, HEDGE[0.5]["safety"]))
print(f"a stronger goal can only lower the level (Proposition 10.2(iii)): {hedge_order} (the lab's illustration)")

saf = np.array([r["safety"] for r in ROWS])
gl = np.array([r["goal"] for r in ROWS])
fig, ax = plt.subplots(figsize=(7.6, 3.6))
ax.plot(saf, saf, color="#1F4E79", lw=1.8, label="necessity of safety, 1 - alpha")
ax.plot(saf, gl, color="#B71C1C", lw=1.8, label="the board's goal for the cut's cost")
lev = min(MAXMIN["goal"], MAXMIN["safety"])
ax.plot([MAXMIN["safety"]], [lev], "o", color="#333333", ms=6, zorder=5)
ax.annotate(f"max-min: {MAXMIN['safety']:.2f} at \\${MAXMIN['cost']:.2f}m", xy=(MAXMIN["safety"], lev), xytext=(0.70, 0.22),
            fontsize=8, arrowprops=dict(arrowstyle="-", lw=0.6, color="#333333"))
ax2 = ax.twinx()
ax2.plot(saf, C_ALPHA, color="#616161", lw=1.1, ls=":", label="the cut's robust cost (right)")
ax2.set_ylabel("robust package's cost ($ million)")
ax2.set_ylim(0, 33)
ax.set(xlim=(0, 1), ylim=(0, 1.05), xlabel="necessity of safety, 1 - alpha", ylabel="degree",
       title="The max-min choice: necessity 0.62 at \\$10.54m (seed 26210)")
h1, l1 = ax.get_legend_handles_labels(); h2, l2 = ax2.get_legend_handles_labels()
ax.legend(h1 + h2, l1 + l2, frameon=False, fontsize=8, loc="upper left", bbox_to_anchor=(0.0, 0.80))
plt.tight_layout(); plt.show()
cut     D      S     line   delay    cost  binding   goal  safety
1.0     50    120     38.0   0.000    1.14      7    1.000   0.00
0.9     65    138     71.0   0.000    2.13      7    1.000   0.10
0.8     80    156    104.0   0.000    3.12      7    1.000   0.20
0.7     95    174    137.0   0.000    4.11      7    1.000   0.30
0.6    110    192    170.0   0.000    5.10      7    0.993   0.40
0.5    125    210    203.0   0.000    6.09      7    0.927   0.50
0.4    140    228    228.0   0.327    9.46      7    0.703   0.60
0.3    155    246    246.0   0.937   14.88      7    0.341   0.70
0.2    170    264    264.0   1.547   20.30      7    0.000   0.80
0.1    185    282    282.0   2.169   25.81      6    0.000   0.90
0.0    200    300    300.0   2.797   31.37      6    0.000   1.00

the graded price runs from 1.14 at possibility 1 to 31.37 at 0; it never falls as the cut grows: True; its 0.5-cut is the crisp set's 6.09
every cut's closed form equals its linear program (largest gap 2.8e-14)

max-min choice: the cut at 0.38, necessity of safety 0.62, goal 0.630: deviations within 143.0, a closure within 231.6, a 231.6 line and 0.449 quarter of delay, 10.54
bisection on the level: lambda* = 0.6223, the cut at 0.3777, cost 10.67; on the book's grid of 0.01, the cut at 0.38
  very cheap      : level 0.58 at the cut 0.42, cost 8.37
  the board's goal: level 0.62 at the cut 0.38, cost 10.54
  somewhat cheap  : level 0.67 at the cut 0.33, cost 13.25
a stronger goal can only lower the level (Proposition 10.2(iii)): True (the lab's illustration)
The max-min choice: necessity 0.62 at $10.54m (seed 26210)

Panel 3 — Judge against the law: guarantees beside chances (Theorem 10.1(iii); Table 10.3; Figure 10.3; Worked Example 10.1, Step 4: 5.6% at $10.54m; the cut at 0.35, $12.17m; 95% of paths, $26.92m and 0.8%; $37.23m under a $100m cap)

AXIOM Lab 2.10, step 3. Every cut's package is evaluated on the book's 100,000 paths and the 100,000 fresh ones, with the share of the paths its set holds. Chapter 9's frontier is the cheapest committed package for each appetite under the law, the line on a $5 million grid from 0 to $300 million and the delay continuous; its 5 percent point is Volume I's package. Two cuts answer the law in its own terms: the cheapest one whose package meets 5 percent, and the first whose set holds 95 percent of the paths, which Theorem 10.1(iii) turns into a promise of the appetite. Last, the bank's cap of $100 million on the line, on Step 2's set. Every chance here has a standard error p(1−p)/N\sqrt{p(1 - p)/N} on N=100,000N = 100{,}000 paths.

Python Code
for r in ROWS:
    judge(r)
MEETS5 = max([r for r in ROWS if r["p"] <= ALPHA], key=lambda r: r["alpha"])
COVERS95 = max([r for r in ROWS if r["coverage"] >= 0.95], key=lambda r: r["alpha"])
CAPPED = judge(robust(D_cut(0.5), S_cut(0.5), cap=CAP))
QUERY = judge(robust(140.0, 230.0))
inside_breaches = sum(r["inside_breach"] for r in ROWS) + JOINT["inside_breach"] + CRISP["inside_breach"]
promise_broken = sum(r["p"] > 1 - r["coverage"] for r in ROWS)

def frontier(P, ps=(0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.08, 0.10, 0.125, 0.15), lines=np.arange(0.0, 300.01, 5.0)):
    # Chapter 9: for each appetite, the cheapest committed package (the line on a $5m grid, the delay continuous)
    best = {p: None for p in ps}
    for l in lines:
        c = np.sort(P.crit(l))
        for p in ps:
            d = min(DEPTH0, c[int(np.floor(p * P.n + 1e-9))])
            if d < 0:
                continue
            ph = (DEPTH0 - d) / DPQ
            if best[p] is None or cost(l, ph) < best[p][2]:
                best[p] = (float(l), float(ph), float(cost(l, ph)))
    return [dict(p=p, line=b[0], delay=b[1], cost=b[2]) for p, b in best.items()]

FRONT = frontier(BOOK)
V1 = [f for f in FRONT if abs(f["p"] - ALPHA) < 1e-12][0]
V1.update(p_book=BOOK.odds(V1["line"], V1["delay"]), p_fresh=FRESH.odds(V1["line"], V1["delay"]))
print("Chapter 9's frontier: appetite, line, delay, cost")
for f in FRONT:
    print(f"  {100 * f['p']:5.1f}% {f['line']:6.0f} {f['delay']:7.3f} {f['cost']:7.2f}")
print(f"Volume I's package: {V1['line']:.0f}, {V1['delay']:.4f}, {V1['cost']:.2f}; book {100 * V1['p_book']:.2f}%, "
      f"fresh {100 * V1['p_fresh']:.3f}%")

print("\nevery cut under the law: cut, coverage, chance on the book's paths (fresh)")
for r in ROWS[::-10]:
    print(f"  {r['alpha']:3.1f} {100 * r['coverage']:6.1f}% {100 * r['p']:7.2f}% ({100 * r['p_fresh']:.2f}%)")
print(f"paths inside a cut's set that breach, all {len(ROWS)} cuts and both crisp sets: {inside_breaches}; cuts whose chance "
      f"exceeds the share of paths outside their set: {promise_broken}")
print(f"the max-min package: {100 * MAXMIN['p']:.2f}% (fresh {100 * MAXMIN['p_fresh']:.2f}%), coverage "
      f"{100 * MAXMIN['coverage']:.1f}%, at {MAXMIN['cost']:.2f}; Volume I's package {100 * V1['p_book']:.1f}% at {V1['cost']:.2f}")
print(f"the cheapest cut meeting 5%: {MEETS5['alpha']:.2f} ({MEETS5['D']:.1f}, {MEETS5['S']:.1f}): line {MEETS5['line']:.1f}, "
      f"delay {MEETS5['delay']:.3f}, {MEETS5['cost']:.2f}; {100 * MEETS5['p']:.2f}% (fresh {100 * MEETS5['p_fresh']:.2f}%); "
      f"coverage {100 * MEETS5['coverage']:.1f}%")
print(f"the first cut holding 95% of paths: {COVERS95['alpha']:.2f} ({COVERS95['D']:.1f}, {COVERS95['S']:.1f}): line "
      f"{COVERS95['line']:.1f}, delay {COVERS95['delay']:.3f}, {COVERS95['cost']:.2f}; coverage {100 * COVERS95['coverage']:.2f}%; "
      f"{100 * COVERS95['p']:.2f}%")
print(f"a $100m cap on the line, the crisp set: delay {CAPPED['delay']:.3f}, {CAPPED['cost']:.2f}; {100 * CAPPED['p']:.2f}%")

print("\nTable 10.3: packages robust on declared sets, and their chance of a breach under Chapter 9's law")
print(f"{'set':30s} {'D':>5s} {'S':>5s} {'line':>6s} {'delay':>6s} {'cost':>6s} {'paths':>6s} {'breach':>7s} {'fresh':>6s}")
T103 = [("Volume I's joint check", JOINT), ("Crisp set (the 0.5-cut)", CRISP), ("Max-min choice (0.38-cut)", MAXMIN),
        ("Meeting 5% (0.35-cut)", MEETS5), ("95% of paths (0.08-cut)", COVERS95), ("The whole support (0-cut)", ROWS[0])]
for name, r in T103:
    print(f"{name:30s} {r['D']:5.0f} {r['S']:5.0f} {r['line']:6.0f} {r['delay']:6.2f} {r['cost']:6.2f} "
          f"{100 * r['coverage']:6.1f} {100 * r['p']:7.1f} {100 * r['p_fresh']:6.1f}")
v1_name = "Volume I's package (law)"
print(f"{v1_name:30s} {'':11s} {V1['line']:6.0f} {V1['delay']:6.2f} {V1['cost']:6.2f} {'':6s} "
      f"{100 * V1['p_book']:7.1f}")
fresh_gap = max(abs(r["p"] - r["p_fresh"]) for _, r in T103)
chances = [r["p"] for r in ROWS] + [r["p_fresh"] for r in ROWS] + [JOINT["p"], CAPPED["p"], QUERY["p"]]
se_max = max(np.sqrt(p * (1 - p) / N) for p in chances)
print(f"fresh paths within {100 * fresh_gap:.2f} points of the book's; the largest standard error of a chance: "
      f"{100 * se_max:.3f} points")

fig, ax = plt.subplots(figsize=(7.6, 3.6))
ax.plot([100 * f["p"] for f in FRONT], [f["cost"] for f in FRONT], "o-", color="#1F4E79", lw=1.8, ms=4,
        label="Chapter 9: the cheapest package for each appetite (law)")
ax.plot([100 * r["p"] for r in ROWS], C_ALPHA, color="#B71C1C", lw=1.6, label="robust on the graded cuts (no odds)")
for r, txt, xy in ((JOINT, "joint check", (14.2, 7.5)), (CRISP, "0.5-cut", (10.6, 11.0)), (MAXMIN, "max-min", (7.2, 15.0)),
                   (COVERS95, "95% of paths", (2.2, 29.5))):
    ax.plot([100 * r["p"]], [r["cost"]], "o", color="#333333", ms=5, zorder=5)
    ax.annotate(f"{txt}: \\${r['cost']:.2f}m, {100 * r['p']:.1f}%", xy=(100 * r["p"], r["cost"]), xytext=xy, fontsize=8,
                arrowprops=dict(arrowstyle="-", lw=0.6, color="#333333"))
ax.plot([100 * V1["p_book"]], [V1["cost"]], "s", color="#1F4E79", ms=6, zorder=6)
ax.annotate(f"Volume I's package: \\${V1['cost']:.2f}m, 5.0%", xy=(5.0, V1["cost"]), xytext=(0.6, 4.0), fontsize=8,
            color="#1F4E79", arrowprops=dict(arrowstyle="-", lw=0.6, color="#1F4E79"))
ax.set(xlim=(0, 20.5), ylim=(0, 33), xlabel="chance of a breach under Chapter 9's law (%)", ylabel="cost ($ million)",
       title="Graded packages lie just above Chapter 9's frontier (seed 26210)")
ax.legend(frameon=False, fontsize=8, loc="upper right", bbox_to_anchor=(1.0, 0.80)); plt.tight_layout(); plt.show()
Chapter 9's frontier: appetite, line, delay, cost
    1.0%    190   2.174   23.09
    2.0%    170   1.595   17.86
    3.0%    180   1.161   14.68
    4.0%    165   0.925   12.35
    5.0%    170   0.668   10.44
    6.0%    160   0.502    8.82
    8.0%    160   0.182    6.25
   10.0%    135   0.015    4.17
   12.5%    100   0.000    3.00
   15.0%     75   0.000    2.25
Volume I's package: 170, 0.6676, 10.44; book 5.00%, fresh 4.907%

every cut under the law: cut, coverage, chance on the book's paths (fresh)
  1.0   17.8%   19.73% (19.48%)
  0.9   29.3%   15.38% (15.08%)
  0.8   43.0%   12.05% (11.82%)
  0.7   56.8%   10.05% (9.85%)
  0.6   69.1%    9.07% (8.86%)
  0.5   78.9%    8.64% (8.43%)
  0.4   85.9%    6.34% (6.14%)
  0.3   90.6%    3.45% (3.43%)
  0.2   93.4%    1.79% (1.75%)
  0.1   94.8%    0.87% (0.83%)
  0.0   95.6%    0.39% (0.39%)
paths inside a cut's set that breach, all 101 cuts and both crisp sets: 0; cuts whose chance exceeds the share of paths outside their set: 0
the max-min package: 5.64% (fresh 5.51%), coverage 87.0%, at 10.54; Volume I's package 5.0% at 10.44
the cheapest cut meeting 5%: 0.35 (147.5, 237.0): line 237.0, delay 0.632, 12.17; 4.71% (fresh 4.62%); coverage 88.5%
the first cut holding 95% of paths: 0.08 (188.0, 285.6): line 285.6, delay 2.294, 26.92; coverage 95.02%; 0.76%
a $100m cap on the line, the crisp set: delay 4.279, 37.23; 0.64%

Table 10.3: packages robust on declared sets, and their chance of a breach under Chapter 9's law
set                                D     S   line  delay   cost  paths  breach  fresh
Volume I's joint check             0   187     55   0.00   1.65    1.5    17.4   17.1
Crisp set (the 0.5-cut)          125   210    203   0.00   6.09   78.9     8.6    8.4
Max-min choice (0.38-cut)        143   232    232   0.45  10.54   87.0     5.6    5.5
Meeting 5% (0.35-cut)            148   237    237   0.63  12.17   88.5     4.7    4.6
95% of paths (0.08-cut)          188   286    286   2.29  26.92   95.0     0.8    0.7
The whole support (0-cut)        200   300    300   2.80  31.37   95.6     0.4    0.4
Volume I's package (law)                      170   0.67  10.44            5.0
fresh paths within 0.26 points of the book's; the largest standard error of a chance: 0.126 points
Graded packages lie just above Chapter 9's frontier (seed 26210)

Panel 4 — Learn rules: eight rules in the offices' words (Theorem 10.3(i)–(ii); Section 10.4; Online Appendix Example 10.B.2: 3 cents a dollar of closure, 33 and 35 cents a dollar of deviation; six rules that cancel)

AXIOM Lab 2.10, step 4. A first-order Sugeno system writes the price of a guarantee as rules: rule rr fires at the product of its terms' memberships and concludes an affine value of the declaration; the output is the firing-weighted average of the conclusions (Equation 10.2). The inputs are normalized, u=(D−25)/225u = (D - 25)/225 and v=S/350v = S/350. The terms are Gaussian, centred at the anchors the offices named: deviations mild ($25 million), moderate ($100 million), severe ($175 million) or extreme ($250 million); closures small ($0) or large ($350 million); one rule for each pair. The data are 150 exact robust costs on the grid D=25,50,…,250D = 25, 50, \ldots, 250 by S=0,25,…,350S = 0, 25, \ldots, 350. Hybrid learning (Theorem 10.3(ii)): each rule's conclusion by least squares weighted by its own firing (local learning, so that each rule describes its own region and can be read alone), and the widths by 300 projected Armijo steps within [0.03,0.6][0.03, 0.6], the gradient by forward differences. For comparison, six rules trained for accuracy alone: all conclusions in one least-squares fit, centres and widths free.

Python Code
D_LO, D_HI, S_LO, S_HI = 25.0, 250.0, 0.0, 350.0
TERMS = (("mild", "moderate", "severe", "extreme"), ("small", "large"))
ANCHORS = ((25.0, 100.0, 175.0, 250.0), (0.0, 350.0))
CENTRES = [(np.array(ANCHORS[0]) - D_LO) / (D_HI - D_LO), (np.array(ANCHORS[1]) - S_LO) / (S_HI - S_LO)]
N1 = len(CENTRES[0])

def norm(D, S):
    return (np.atleast_1d(np.asarray(D, float)) - D_LO) / (D_HI - D_LO), (np.atleast_1d(np.asarray(S, float)) - S_LO) / (S_HI - S_LO)

def firing(u, v, s, c=CENTRES):             # rule (i, j): term i of deviations and term j of closures, product
    m1 = np.exp(-((u[:, None] - c[0][None, :]) ** 2) / (2 * s[0][None, :] ** 2))
    m2 = np.exp(-((v[:, None] - c[1][None, :]) ** 2) / (2 * s[1][None, :] ** 2))
    return (m1[:, :, None] * m2[:, None, :]).reshape(len(u), -1)

def sugeno(u, v, s, th, c=CENTRES):         # Equation 10.2: the firing-weighted average of affine conclusions
    W = firing(u, v, s, c)
    Wn = W / W.sum(axis=1, keepdims=True)
    X = np.stack([np.ones_like(u), u, v], axis=1)
    return ((Wn[:, :, None] * X[:, None, :]).reshape(len(u), -1)) @ th

def local_conclusions(u, v, y, s):          # each rule's least squares, weighted by its own firing
    W, X, th = firing(u, v, s), np.stack([np.ones_like(u), u, v], axis=1), []
    for r in range(W.shape[1]):
        sw = np.sqrt(W[:, r])
        t, *_ = np.linalg.lstsq(X * sw[:, None], y * sw, rcond=None)
        th.append(t)
    return np.concatenate(th)

def local_loss(u, v, y, s):
    th = local_conclusions(u, v, y, s)
    e = sugeno(u, v, s, th) - y
    return th, float(e @ e / len(y))

def train(u, v, y, width=(0.08, 0.5), iters=300, h=1e-6, lo=0.03, hi=0.6):
    s = [np.full(N1, width[0]), np.full(len(CENTRES[1]), width[1])]
    th, loss = local_loss(u, v, y, s)
    hist, step = [loss], 0.01
    for _ in range(iters):
        p0 = np.concatenate(s)
        g = np.zeros_like(p0)
        for i in range(p0.size):            # the gradient of the error in the widths, by forward differences
            q = p0.copy(); q[i] += h
            g[i] = (local_loss(u, v, y, [q[:N1], q[N1:]])[1] - loss) / h
        t = step
        while True:                         # projected Armijo step, halved until the error falls enough
            q = np.clip(p0 - t * g, lo, hi)
            thq, lq = local_loss(u, v, y, [q[:N1], q[N1:]])
            if lq <= loss - 1e-4 * float(g @ (p0 - q)) or t < 1e-10:
                break
            t *= 0.5
        if lq >= loss - 1e-12:
            break
        s, th, loss = [q[:N1], q[N1:]], thq, lq
        hist.append(loss)
        step = min(4 * t, 1.0)
    return s, th, hist

Dg, Sg = np.arange(D_LO, D_HI + 0.1, 25.0), np.arange(S_LO, S_HI + 0.1, 25.0)
DD, SS = np.meshgrid(Dg, Sg, indexing="ij")
C150 = np.array([[robust(d, s_)["cost"] for s_ in Sg] for d in Dg])
u150, v150 = norm(DD.ravel(), SS.ravel())
WIDTHS, THETA, HIST = train(u150, v150, C150.ravel())

def surface(D, S):
    u, v = norm(D, S)
    return sugeno(u, v, WIDTHS, THETA)

print(f"{C150.size} exact robust costs; {len(HIST) - 1} Armijo steps: mean squared error {HIST[0]:.4f} -> {HIST[-1]:.5f}")
print("learned widths: deviations " + ", ".join(f"{x:.3f}" for x in WIDTHS[0]) + "; closures "
      + ", ".join(f"{x:.3f}" for x in WIDTHS[1]))
RULES = []
print("\nrule (deviations, closures)  anchor D, S   conclusion there (exact)   per $m of D   per $m of S")
for i in range(N1):
    for j in range(len(CENTRES[1])):
        a0, a1, a2 = THETA[3 * (i * 2 + j):3 * (i * 2 + j) + 3]
        uc, vc = CENTRES[0][i], CENTRES[1][j]
        Dc, Sc = ANCHORS[0][i], ANCHORS[1][j]
        rule = dict(name=f"{TERMS[0][i]}-{TERMS[1][j]}", D=Dc, S=Sc, a=(float(a0), float(a1), float(a2)),
                    concl=float(a0 + a1 * uc + a2 * vc), exact=robust(Dc, Sc)["cost"], per_D=float(a1 / (D_HI - D_LO)),
                    per_S=float(a2 / (S_HI - S_LO)))
        RULES.append(rule)
        print(f"{rule['name']:28s} {Dc:5.0f} {Sc:5.0f} {rule['concl']:12.2f} ({rule['exact']:5.2f}) {rule['per_D']:13.4f} "
              f"{rule['per_S']:13.4f}")
print("where the line is needed the rules charge about 3 cents a dollar of closure, the line's fee; the severe and "
      "extreme rules about 33 and 35 cents a dollar of deviation, the price of delay")

def global_fit(terms=(3, 2), iters=300, h=1e-6):
    # six rules trained for accuracy alone: one least-squares fit for all conclusions; centres and widths free
    n1, n2 = terms
    c = [np.linspace(0.1, 0.9, n1), np.linspace(0.1, 0.9, n2)]
    sw = [np.full(n1, 0.8 / n1), np.full(n2, 0.8 / n2)]
    def design(u, v, c, sw):
        W = firing(u, v, sw, c)
        Wn = W / W.sum(axis=1, keepdims=True)
        X = np.stack([np.ones_like(u), u, v], axis=1)
        return (Wn[:, :, None] * X[:, None, :]).reshape(len(u), -1)
    def lsq(c, sw):
        A = design(u150, v150, c, sw)
        th, *_ = np.linalg.lstsq(A, C150.ravel(), rcond=None)
        e = A @ th - C150.ravel()
        return th, float(e @ e / len(e))
    def unpack(q):
        return [q[:n1], q[n1:n1 + n2]], [np.maximum(q[n1 + n2:2 * n1 + n2], 0.03), np.maximum(q[2 * n1 + n2:], 0.03)]
    th, loss = lsq(c, sw)
    step = 0.05
    for _ in range(iters):
        p0 = np.concatenate([c[0], c[1], sw[0], sw[1]])
        g = np.zeros_like(p0)
        for i in range(p0.size):
            q = p0.copy(); q[i] += h
            g[i] = (lsq(*unpack(q))[1] - loss) / h
        t = step
        while True:
            cq, sq = unpack(p0 - t * g)
            thq, lq = lsq(cq, sq)
            if lq <= loss - 1e-4 * t * float(g @ g) or t < 1e-8:
                break
            t *= 0.5
        if lq >= loss:
            break
        c, sw, th, loss = cq, sq, thq, lq
        step = min(4 * t, 1.0)
    concl = [float(th[3 * r] + th[3 * r + 1] * c[0][r // n2] + th[3 * r + 2] * c[1][r % n2]) for r in range(n1 * n2)]
    return dict(c=c, sw=sw, th=th, concl=concl, predict=lambda D, S: design(*norm(D, S), c, sw) @ th)

GLOBAL = global_fit()
print("\nsix rules trained for accuracy alone: conclusions at their centres " + ", ".join(f"{x:.2f}" for x in GLOBAL["concl"]))
150 exact robust costs; 300 Armijo steps: mean squared error 0.0802 -> 0.00806
learned widths: deviations 0.126, 0.062, 0.066, 0.053; closures 0.110, 0.331

rule (deviations, closures)  anchor D, S   conclusion there (exact)   per $m of D   per $m of S
mild-small                      25     0        -0.04 ( 0.00)        0.0014        0.0015
mild-large                      25   350         7.23 ( 7.29)        0.0295        0.0289
moderate-small                 100     0        -0.12 ( 0.00)        0.0122        0.0156
moderate-large                 100   350         9.54 ( 9.54)        0.0315        0.0299
severe-small                   175     0        14.05 (14.01)        0.3288        0.0300
severe-large                   175   350        24.55 (24.51)        0.3288        0.0300
extreme-small                  250     0        39.58 (39.58)        0.3531        0.0300
extreme-large                  250   350        50.08 (50.08)        0.3531        0.0300
where the line is needed the rules charge about 3 cents a dollar of closure, the line's fee; the severe and extreme rules about 33 and 35 cents a dollar of deviation, the price of delay

six rules trained for accuracy alone: conclusions at their centres -0.03, 6.71, 58.64, -9.56, -19.49, 61.58

Panel 5 — Certify, and price a revision (Theorem 10.3(iv); Figure 10.2; Worked Example 10.1, Step 5: within $0.25m on 93.5%, at most $0.95m off at the corner; $8.99m against $9.52m)

AXIOM Lab 2.10, step 5. The surface is compared with exact robust costs on the grid of spacing $5 million, D=25,…,250D = 25, \ldots, 250 by S=0,…,350S = 0, \ldots, 350: 3,266 declarations. Theorem 10.3(iv) turns the largest error on a grid into a bound everywhere, e+(L+L^)h/2e + (L + \hat L)h/2, and warns where it will be largest: at the corner where the deviations use up the plan's $132 million margin and the exact price turns from 3 cents to 33 cents a dollar. The six rules trained for accuracy alone are certified on the same grid. Then the revision of Step 5: if the treasury came to fear a closure of $230 million and the engineering office deviations of $140 million, the surface prices it at once, and the exact solve decides. The figure is Figure 10.2(b): the cost against DD at S=$230S = \$230 million.

Python Code
Dv, Sv = np.arange(D_LO, D_HI + 0.1, 5.0), np.arange(S_LO, S_HI + 0.1, 5.0)
DV, SV = np.meshgrid(Dv, Sv, indexing="ij")
EXACT = np.array([[robust(d, s_)["cost"] for s_ in Sv] for d in Dv])
ERR = surface(DV.ravel(), SV.ravel()).reshape(DV.shape) - EXACT
kmax = np.unravel_index(np.argmax(np.abs(ERR)), ERR.shape)
CERT = dict(points=int(ERR.size), rms=float(np.sqrt(np.mean(ERR ** 2))), max_abs=float(np.abs(ERR).max()),
            at=(float(Dv[kmax[0]]), float(Sv[kmax[1]])), within=float(np.mean(np.abs(ERR) <= 0.25)))
GERR = GLOBAL["predict"](DV.ravel(), SV.ravel()) - EXACT.ravel()
G_RMS = float(np.sqrt(np.mean(GERR ** 2)))
print(f"eight rules, learned rule by rule: {CERT['points']:,} declarations, root-mean-square error {CERT['rms']:.3f}; "
      f"within 0.25 on {100 * CERT['within']:.1f}%; largest error {CERT['max_abs']:.3f} at D {CERT['at'][0]:.0f}, "
      f"S {CERT['at'][1]:.0f}, beside the corner at the {MARGIN[k7]:.0f} margin")
print(f"six rules trained for accuracy alone: root-mean-square error {G_RMS:.3f}; their conclusions run from "
      f"{min(GLOBAL['concl']):.2f} to {max(GLOBAL['concl']):.2f}: no office could read them")

Q_PRED = float(surface(140.0, 230.0)[0])
print(f"\nthe revision (D 140, S 230): the surface says {Q_PRED:.2f}; the exact solve says {QUERY['cost']:.2f}, a "
      f"{QUERY['line']:.0f} line and {QUERY['delay']:.3f} quarter of delay; under the law {100 * QUERY['p']:.2f}% "
      f"(fresh {100 * QUERY['p_fresh']:.2f}%)")
print(f"the difference, {QUERY['cost'] - Q_PRED:.2f}, sits at the corner: deviations of 140 exceed quarter 7's margin by "
      f"{140 - MARGIN[k7]:.1f}")

Dl = np.linspace(D_LO, D_HI, 451)
ex = np.array([robust(d, 230.0)["cost"] for d in Dl])
fig, ax = plt.subplots(figsize=(7.6, 3.6))
for a_ in ANCHORS[0]:
    ax.axvline(a_, color="#DDDDDD", lw=0.8, zorder=0)
for a_, nm, ha in zip(ANCHORS[0], TERMS[0], ("left", "center", "center", "right")):
    ax.text(a_ + {"left": 1.5, "center": 0, "right": -1.5}[ha], 45.5, nm, fontsize=8, color="#616161", ha=ha)
ax.plot(Dl, ex, color="#333333", lw=1.8, label="exact robust cost")
ax.plot(Dl, surface(Dl, np.full_like(Dl, 230.0)), color="#E65100", lw=1.6, ls="--", label="eight-rule surface")
ax.axvline(MARGIN[k7], color="#1F4E79", lw=1.0, ls=":")
ax.text(MARGIN[k7] - 3, 30, "plan's margin\n\\$132m", fontsize=8, color="#1F4E79", ha="right")
ax.plot([140.0], [QUERY["cost"]], "o", color="#333333", ms=5)
ax.plot([140.0], [Q_PRED], "o", color="#E65100", ms=5)
ax.annotate(f"D = 140: exact \\${QUERY['cost']:.2f}m, surface \\${Q_PRED:.2f}m", xy=(140.0, QUERY["cost"]), xytext=(150, 4.0),
            fontsize=8, arrowprops=dict(arrowstyle="-", lw=0.6, color="#333333"))
ax.set(xlim=(20, 255), ylim=(0, 48), xlabel="deviations' bound D ($ million)", ylabel="cost at S = \\$230m (\\$ million)",
       title="The eight-rule surface smooths the corner at \\$132m (seed 26210)")
ax.legend(frameon=False, fontsize=8, loc="upper left", bbox_to_anchor=(0.0, 0.92)); plt.tight_layout(); plt.show()
eight rules, learned rule by rule: 3,266 declarations, root-mean-square error 0.158; within 0.25 on 93.5%; largest error 0.954 at D 135, S 70, beside the corner at the 132 margin
six rules trained for accuracy alone: root-mean-square error 0.183; their conclusions run from -19.49 to 61.58: no office could read them

the revision (D 140, S 230): the surface says 8.99; the exact solve says 9.52, a 230 line and 0.327 quarter of delay; under the law 6.33% (fresh 6.14%)
the difference, 0.53, sits at the corner: deviations of 140 exceed quarter 7's margin by 8.0
The eight-rule surface smooths the corner at $132m (seed 26210)

Validation — the book's numbers, and agreement with DCT_V2_Ch10_Lab.xlsx

Each checkpoint is a number printed in Chapter 10 (Sections 10.1–10.5, Worked Example 10.1, Table 10.3, Figures 10.1–10.3) or in Online Appendix Example 10.B.2, with a tolerance of half a unit in its last printed digit; a few check what a theorem promises (a count of zero). Chances and shares are in percent. The workbook recomputes the ones marked workbook with Excel formulas and shows PASS against the same engine values on its Checks sheet.

Python Code
pc = lambda x: 100 * x
R = {round(r["alpha"], 2): r for r in ROWS}
OA_CUTS = {1.0: (50, 120, 38, 0.0, 1.14, 17.8, 19.73), 0.9: (65, 138, 71, 0.0, 2.13, 29.3, 15.38),
           0.8: (80, 156, 104, 0.0, 3.12, 43.0, 12.05), 0.7: (95, 174, 137, 0.0, 4.11, 56.8, 10.05),
           0.6: (110, 192, 170, 0.0, 5.10, 69.1, 9.07), 0.5: (125, 210, 203, 0.0, 6.09, 78.9, 8.64),
           0.4: (140, 228, 228, 0.327, 9.46, 85.9, 6.34), 0.3: (155, 246, 246, 0.937, 14.88, 90.6, 3.45),
           0.2: (170, 264, 264, 1.547, 20.30, 93.4, 1.79), 0.1: (185, 282, 282, 2.169, 25.81, 94.8, 0.87),
           0.0: (200, 300, 300, 2.797, 31.37, 95.6, 0.39)}
OA_FRONT = {0.01: (190, 2.174, 23.09), 0.02: (170, 1.595, 17.86), 0.03: (180, 1.161, 14.68), 0.04: (165, 0.925, 12.35),
            0.05: (170, 0.668, 10.44), 0.06: (160, 0.502, 8.82), 0.08: (160, 0.182, 6.25), 0.10: (135, 0.015, 4.17),
            0.125: (100, 0.0, 3.00), 0.15: (75, 0.0, 2.25)}
OA_RULES = {"mild-small": (-0.04, 0.00, 0.0014, 0.0015), "mild-large": (7.23, 7.29, 0.0295, 0.0289),
            "moderate-small": (-0.12, 0.00, 0.0122, 0.0156), "moderate-large": (9.54, 9.54, 0.0315, 0.0299),
            "severe-small": (14.05, 14.01, 0.3288, 0.0300), "severe-large": (24.55, 24.51, 0.3288, 0.0300),
            "extreme-small": (39.58, 39.58, 0.3531, 0.0300), "extreme-large": (50.08, 50.08, 0.3531, 0.0300)}
OA_MARGIN = (224.2, 190.1, 165.6, 148.9, 138.5, 133.2, 132.0, 133.9, 138.2, 144.4, 151.9, 160.4)
checks = [
    # Section 10.1 and Worked Example 10.1, Steps 1-2 (Panel 1)
    ("a closure's 90th percentile, the joint check's S (workbook)", S90, 187, 0.5),
    ("joint check: line (workbook)", JOINT["line"], 55.0, 0.05),
    ("joint check: delay (workbook)", JOINT["delay"], 0, 5e-4),
    ("joint check: cost (workbook)", JOINT["cost"], 1.65, 5e-3),
    ("joint check: chance of a breach under the law", pc(JOINT["p"]), 17.39, 5e-3),
    ("joint check: chance on the fresh paths", pc(JOINT["p_fresh"]), 17.12, 5e-3),
    ("joint check: share of paths in its set", pc(JOINT["coverage"]), 1.5, 0.05),
    ("deviations alone breach (Chapter 9), %", pc(noise_only), 8.4, 0.05),
] + [(f"plan's margin, quarter {k + 1} (workbook)", MARGIN[k], OA_MARGIN[k], 0.05) for k in range(Q)] + [
    ("the margin is least in quarter 7 (workbook)", k7 + 1, 7, 0),
    ("a quarter of delay lifts quarter 7 by (workbook)", LIFT[k7], 24.6, 0.05),
    ("delay's price a dollar at quarter 7, cents (workbook)", 100 * VQ / LIFT[k7], 33, 0.5),
    ("crisp set: line (workbook)", CRISP["line"], 203.0, 0.05),
    ("crisp set: the closure's first part fits in the margin (workbook)", CRISP["absorbed"], 7, 0.5),
    ("crisp set: delay (workbook)", CRISP["delay"], 0, 5e-4),
    ("crisp set: cost (workbook)", CRISP["cost"], 6.09, 5e-3),
    ("crisp set: binding quarter (workbook)", CRISP["binding"], 7, 0),
    ("crisp set: chance under the law", pc(CRISP["p"]), 8.64, 5e-3),
    ("crisp set: chance on the fresh paths", pc(CRISP["p_fresh"]), 8.43, 5e-3),
    ("crisp set: share of paths in its set", pc(CRISP["coverage"]), 78.9, 0.05),
    ("crisp set: Theorem 10.1(iii) promised at most, % (workbook)", pc(1 - CRISP["coverage"]), 21, 0.5),
    ("the closed form equals the linear program, largest gap", lp_gap, 0, 1e-6),
    ("Proposition 10.3(iii): quarter 7 on the damage path (workbook)", damage[k7], 350.0, 5e-3),
]
for a_, (d_, s_, l_, ph_, c_, cov_, p_) in OA_CUTS.items():
    r = R[a_]
    checks += [(f"cut {a_:.1f}: D (workbook)", r["D"], d_, 0.5), (f"cut {a_:.1f}: S (workbook)", r["S"], s_, 0.5),
               (f"cut {a_:.1f}: line (workbook)", r["line"], l_, 0.5), (f"cut {a_:.1f}: delay (workbook)", r["delay"], ph_, 5e-4),
               (f"cut {a_:.1f}: cost (workbook)", r["cost"], c_, 5e-3), (f"cut {a_:.1f}: share of paths in the set", pc(r["coverage"]), cov_, 0.05),
               (f"cut {a_:.1f}: chance under the law", pc(r["p"]), p_, 5e-3)]
checks += [
    ("cut 0.0: binding quarter (workbook)", R[0.0]["binding"], 6, 0),
    ("cut 0.1: binding quarter (workbook)", R[0.1]["binding"], 6, 0),
    ("cut 0.2: binding quarter (workbook)", R[0.2]["binding"], 7, 0),
    ("cuts on the grid of 0.01", len(ROWS), 101, 0),
    ("Theorem 10.2(ii): cuts whose price falls as the set grows (workbook)", int(np.sum(np.diff(C_ALPHA) > 1e-12)), 0, 0),
    # Theorem 10.2(iii), Figure 10.1, Worked Example 10.1, Step 3 (Panel 2)
    ("max-min: the cut (workbook)", MAXMIN["alpha"], 0.38, 5e-3),
    ("max-min: necessity of safety (workbook)", MAXMIN["safety"], 0.62, 5e-3),
    ("max-min: goal (workbook)", MAXMIN["goal"], 0.630, 5e-4),
    ("max-min: D (workbook)", MAXMIN["D"], 143.0, 0.05),
    ("max-min: S (workbook)", MAXMIN["S"], 231.6, 0.05),
    ("max-min: line (workbook)", MAXMIN["line"], 231.6, 0.05),
    ("max-min: delay (workbook)", MAXMIN["delay"], 0.449, 5e-4),
    ("max-min: cost (workbook)", MAXMIN["cost"], 10.54, 5e-3),
    ("bisection on the level: lambda*", LAM_STAR, 0.62, 5e-3),
    ("hedges: a stronger goal can only lower the level, violations (workbook)", int(not hedge_order), 0, 0),
    # Theorem 10.1(iii), Table 10.3, Figure 10.3, Worked Example 10.1, Step 4 (Panel 3)
    ("max-min: chance under the law", pc(MAXMIN["p"]), 5.64, 5e-3),
    ("max-min: chance on the fresh paths", pc(MAXMIN["p_fresh"]), 5.51, 5e-3),
    ("max-min: share of paths in its set", pc(MAXMIN["coverage"]), 87.0, 0.05),
    ("meeting 5%: the cut (workbook)", MEETS5["alpha"], 0.35, 5e-3),
    ("meeting 5%: D (workbook)", MEETS5["D"], 147.5, 0.05),
    ("meeting 5%: S (workbook)", MEETS5["S"], 237.0, 0.05),
    ("meeting 5%: line (workbook)", MEETS5["line"], 237.0, 0.05),
    ("meeting 5%: delay (workbook)", MEETS5["delay"], 0.632, 5e-4),
    ("meeting 5%: cost (workbook)", MEETS5["cost"], 12.17, 5e-3),
    ("meeting 5%: chance under the law", pc(MEETS5["p"]), 4.71, 5e-3),
    ("meeting 5%: chance on the fresh paths", pc(MEETS5["p_fresh"]), 4.62, 5e-3),
    ("meeting 5%: share of paths in its set", pc(MEETS5["coverage"]), 88.5, 0.05),
    ("95% of paths: the cut (workbook)", COVERS95["alpha"], 0.08, 5e-3),
    ("95% of paths: D (workbook)", COVERS95["D"], 188.0, 0.05),
    ("95% of paths: S (workbook)", COVERS95["S"], 285.6, 0.05),
    ("95% of paths: line (workbook)", COVERS95["line"], 285.6, 0.05),
    ("95% of paths: delay (workbook)", COVERS95["delay"], 2.294, 5e-4),
    ("95% of paths: cost (workbook)", COVERS95["cost"], 26.92, 5e-3),
    ("95% of paths: share of paths in its set", pc(COVERS95["coverage"]), 95.02, 5e-3),
    ("95% of paths: chance under the law", pc(COVERS95["p"]), 0.76, 5e-3),
    ("the whole support: chance on the fresh paths (Table 10.3)", pc(ROWS[0]["p_fresh"]), 0.4, 0.05),
    ("a $100m cap: delay (workbook)", CAPPED["delay"], 4.279, 5e-4),
    ("a $100m cap: cost (workbook)", CAPPED["cost"], 37.23, 5e-3),
    ("a $100m cap: chance under the law", pc(CAPPED["p"]), 0.64, 5e-3),
    ("Volume I's package: chance on the book's paths", pc(V1["p_book"]), 5.0, 0.05),
    ("Volume I's package: chance on the fresh paths", pc(V1["p_fresh"]), 4.907, 5e-4),
    ("Table 10.3: fresh paths within, points", pc(fresh_gap), 0.3, 0.05),
    ("largest standard error of a chance, points (workbook)", pc(se_max), 0.13, 5e-3),
    ("paths inside a set that breach (the guarantee)", inside_breaches, 0, 0),
    ("Theorem 10.1(iii): cuts whose chance exceeds 1 - coverage (workbook)", promise_broken, 0, 0),
]
for p_, (l_, ph_, c_) in OA_FRONT.items():
    f = [x for x in FRONT if abs(x["p"] - p_) < 1e-12][0]
    checks += [(f"frontier {100 * p_:g}%: line", f["line"], l_, 0), (f"frontier {100 * p_:g}%: delay", f["delay"], ph_, 5e-4),
               (f"frontier {100 * p_:g}%: cost (workbook)", f["cost"], c_, 5e-3)]
checks += [
    # Theorem 10.3, Section 10.4, Online Appendix Example 10.B.2 (Panel 4)
    ("neuro-fuzzy: training points", C150.size, 150, 0),
    ("neuro-fuzzy: Armijo steps", len(HIST) - 1, 300, 0),
    ("neuro-fuzzy: mean squared error at the start", HIST[0], 0.0802, 5e-5),
    ("neuro-fuzzy: mean squared error after training", HIST[-1], 0.00806, 5e-6),
] + [(f"width, deviations {TERMS[0][i]} (workbook)", WIDTHS[0][i], w_, 5e-4)
     for i, w_ in enumerate((0.126, 0.062, 0.066, 0.053))] + [
    (f"width, closures {TERMS[1][j]} (workbook)", WIDTHS[1][j], w_, 5e-4) for j, w_ in enumerate((0.110, 0.331))]
for rule in RULES:
    cc, ex_, pd_, ps_ = OA_RULES[rule["name"]]
    checks += [(f"rule {rule['name']}: conclusion at its anchor (workbook)", rule["concl"], cc, 5e-3),
               (f"rule {rule['name']}: exact cost at its anchor (workbook)", rule["exact"], ex_, 5e-3),
               (f"rule {rule['name']}: per $m of D (workbook)", rule["per_D"], pd_, 5e-5),
               (f"rule {rule['name']}: per $m of S (workbook)", rule["per_S"], ps_, 5e-5)]
checks += [
    ("global fit: the six rules", len(GLOBAL["concl"]), 6, 0),
] + [(f"global fit: conclusion at centre {r_ + 1}", GLOBAL["concl"][r_], v_, 5e-3)
     for r_, v_ in enumerate((-0.03, 6.71, 58.64, -9.56, -19.49, 61.58))] + [
    # Theorem 10.3(iv), Figure 10.2, Worked Example 10.1, Step 5 (Panel 5)
    ("certification: declarations on the grid", CERT["points"], 3266, 0),
    ("certification: root-mean-square error", CERT["rms"], 0.158, 5e-4),
    ("certification: within $0.25m, %", pc(CERT["within"]), 93.5, 0.05),
    ("certification: largest error (workbook)", CERT["max_abs"], 0.954, 5e-4),
    ("certification: largest error at D", CERT["at"][0], 135, 0),
    ("certification: largest error at S", CERT["at"][1], 70, 0),
    ("global fit: root-mean-square error", G_RMS, 0.183, 5e-4),
    ("revision (140, 230): the surface (workbook)", Q_PRED, 8.99, 5e-3),
    ("revision (140, 230): exact cost (workbook)", QUERY["cost"], 9.52, 5e-3),
    ("revision (140, 230): line (workbook)", QUERY["line"], 230, 0.5),
    ("revision (140, 230): delay (workbook)", QUERY["delay"], 0.327, 5e-4),
    ("revision (140, 230): chance under the law", pc(QUERY["p"]), 6.33, 5e-3),
]
ok = 0
for name, got, want, tol in checks:
    status = "PASS" if abs(got - want) <= tol else "FAIL"; ok += status == "PASS"
    fmt = ".6f" if 0 < abs(want) < 0.01 else ".4f"
    print(f"{name:66s} {got:14{fmt}}   book {want:12{fmt}}   {status}")
print(f"\n{ok} of {len(checks)} checkpoints PASS")
a closure's 90th percentile, the joint check's S (workbook)              186.8670   book     187.0000   PASS
joint check: line (workbook)                                              55.0496   book      55.0000   PASS
joint check: delay (workbook)                                              0.0000   book       0.0000   PASS
joint check: cost (workbook)                                               1.6515   book       1.6500   PASS
joint check: chance of a breach under the law                             17.3880   book      17.3900   PASS
joint check: chance on the fresh paths                                    17.1240   book      17.1200   PASS
joint check: share of paths in its set                                     1.4880   book       1.5000   PASS
deviations alone breach (Chapter 9), %                                     8.4030   book       8.4000   PASS
plan's margin, quarter 1 (workbook)                                      224.1777   book     224.2000   PASS
plan's margin, quarter 2 (workbook)                                      190.0666   book     190.1000   PASS
plan's margin, quarter 3 (workbook)                                      165.5542   book     165.6000   PASS
plan's margin, quarter 4 (workbook)                                      148.8622   book     148.9000   PASS
plan's margin, quarter 5 (workbook)                                      138.4972   book     138.5000   PASS
plan's margin, quarter 6 (workbook)                                      133.2082   book     133.2000   PASS
plan's margin, quarter 7 (workbook)                                      131.9504   book     132.0000   PASS
plan's margin, quarter 8 (workbook)                                      133.8541   book     133.9000   PASS
plan's margin, quarter 9 (workbook)                                      138.1978   book     138.2000   PASS
plan's margin, quarter 10 (workbook)                                     144.3857   book     144.4000   PASS
plan's margin, quarter 11 (workbook)                                     151.9279   book     151.9000   PASS
plan's margin, quarter 12 (workbook)                                     160.4240   book     160.4000   PASS
the margin is least in quarter 7 (workbook)                                7.0000   book       7.0000   PASS
a quarter of delay lifts quarter 7 by (workbook)                          24.5893   book      24.6000   PASS
delay's price a dollar at quarter 7, cents (workbook)                     32.5344   book      33.0000   PASS
crisp set: line (workbook)                                               203.0496   book     203.0000   PASS
crisp set: the closure's first part fits in the margin (workbook)          6.9504   book       7.0000   PASS
crisp set: delay (workbook)                                                0.0000   book       0.0000   PASS
crisp set: cost (workbook)                                                 6.0915   book       6.0900   PASS
crisp set: binding quarter (workbook)                                      7.0000   book       7.0000   PASS
crisp set: chance under the law                                            8.6450   book       8.6400   PASS
crisp set: chance on the fresh paths                                       8.4350   book       8.4300   PASS
crisp set: share of paths in its set                                      78.9070   book      78.9000   PASS
crisp set: Theorem 10.1(iii) promised at most, % (workbook)               21.0930   book      21.0000   PASS
the closed form equals the linear program, largest gap                     0.0000   book       0.0000   PASS
Proposition 10.3(iii): quarter 7 on the damage path (workbook)           350.0000   book     350.0000   PASS
cut 1.0: D (workbook)                                                     50.0000   book      50.0000   PASS
cut 1.0: S (workbook)                                                    120.0000   book     120.0000   PASS
cut 1.0: line (workbook)                                                  38.0496   book      38.0000   PASS
cut 1.0: delay (workbook)                                                  0.0000   book       0.0000   PASS
cut 1.0: cost (workbook)                                                   1.1415   book       1.1400   PASS
cut 1.0: share of paths in the set                                        17.8400   book      17.8000   PASS
cut 1.0: chance under the law                                             19.7310   book      19.7300   PASS
cut 0.9: D (workbook)                                                     65.0000   book      65.0000   PASS
cut 0.9: S (workbook)                                                    138.0000   book     138.0000   PASS
cut 0.9: line (workbook)                                                  71.0496   book      71.0000   PASS
cut 0.9: delay (workbook)                                                  0.0000   book       0.0000   PASS
cut 0.9: cost (workbook)                                                   2.1315   book       2.1300   PASS
cut 0.9: share of paths in the set                                        29.3430   book      29.3000   PASS
cut 0.9: chance under the law                                             15.3790   book      15.3800   PASS
cut 0.8: D (workbook)                                                     80.0000   book      80.0000   PASS
cut 0.8: S (workbook)                                                    156.0000   book     156.0000   PASS
cut 0.8: line (workbook)                                                 104.0496   book     104.0000   PASS
cut 0.8: delay (workbook)                                                  0.0000   book       0.0000   PASS
cut 0.8: cost (workbook)                                                   3.1215   book       3.1200   PASS
cut 0.8: share of paths in the set                                        42.9710   book      43.0000   PASS
cut 0.8: chance under the law                                             12.0460   book      12.0500   PASS
cut 0.7: D (workbook)                                                     95.0000   book      95.0000   PASS
cut 0.7: S (workbook)                                                    174.0000   book     174.0000   PASS
cut 0.7: line (workbook)                                                 137.0496   book     137.0000   PASS
cut 0.7: delay (workbook)                                                  0.0000   book       0.0000   PASS
cut 0.7: cost (workbook)                                                   4.1115   book       4.1100   PASS
cut 0.7: share of paths in the set                                        56.7570   book      56.8000   PASS
cut 0.7: chance under the law                                             10.0480   book      10.0500   PASS
cut 0.6: D (workbook)                                                    110.0000   book     110.0000   PASS
cut 0.6: S (workbook)                                                    192.0000   book     192.0000   PASS
cut 0.6: line (workbook)                                                 170.0496   book     170.0000   PASS
cut 0.6: delay (workbook)                                                  0.0000   book       0.0000   PASS
cut 0.6: cost (workbook)                                                   5.1015   book       5.1000   PASS
cut 0.6: share of paths in the set                                        69.1240   book      69.1000   PASS
cut 0.6: chance under the law                                              9.0750   book       9.0700   PASS
cut 0.5: D (workbook)                                                    125.0000   book     125.0000   PASS
cut 0.5: S (workbook)                                                    210.0000   book     210.0000   PASS
cut 0.5: line (workbook)                                                 203.0496   book     203.0000   PASS
cut 0.5: delay (workbook)                                                  0.0000   book       0.0000   PASS
cut 0.5: cost (workbook)                                                   6.0915   book       6.0900   PASS
cut 0.5: share of paths in the set                                        78.9070   book      78.9000   PASS
cut 0.5: chance under the law                                              8.6450   book       8.6400   PASS
cut 0.4: D (workbook)                                                    140.0000   book     140.0000   PASS
cut 0.4: S (workbook)                                                    228.0000   book     228.0000   PASS
cut 0.4: line (workbook)                                                 228.0000   book     228.0000   PASS
cut 0.4: delay (workbook)                                                  0.3274   book       0.3270   PASS
cut 0.4: cost (workbook)                                                   9.4589   book       9.4600   PASS
cut 0.4: share of paths in the set                                        85.9430   book      85.9000   PASS
cut 0.4: chance under the law                                              6.3400   book       6.3400   PASS
cut 0.3: D (workbook)                                                    155.0000   book     155.0000   PASS
cut 0.3: S (workbook)                                                    246.0000   book     246.0000   PASS
cut 0.3: line (workbook)                                                 246.0000   book     246.0000   PASS
cut 0.3: delay (workbook)                                                  0.9374   book       0.9370   PASS
cut 0.3: cost (workbook)                                                  14.8791   book      14.8800   PASS
cut 0.3: share of paths in the set                                        90.5890   book      90.6000   PASS
cut 0.3: chance under the law                                              3.4540   book       3.4500   PASS
cut 0.2: D (workbook)                                                    170.0000   book     170.0000   PASS
cut 0.2: S (workbook)                                                    264.0000   book     264.0000   PASS
cut 0.2: line (workbook)                                                 264.0000   book     264.0000   PASS
cut 0.2: delay (workbook)                                                  1.5474   book       1.5470   PASS
cut 0.2: cost (workbook)                                                  20.2992   book      20.3000   PASS
cut 0.2: share of paths in the set                                        93.3680   book      93.4000   PASS
cut 0.2: chance under the law                                              1.7850   book       1.7900   PASS
cut 0.1: D (workbook)                                                    185.0000   book     185.0000   PASS
cut 0.1: S (workbook)                                                    282.0000   book     282.0000   PASS
cut 0.1: line (workbook)                                                 282.0000   book     282.0000   PASS
cut 0.1: delay (workbook)                                                  2.1686   book       2.1690   PASS
cut 0.1: cost (workbook)                                                  25.8086   book      25.8100   PASS
cut 0.1: share of paths in the set                                        94.8370   book      94.8000   PASS
cut 0.1: chance under the law                                              0.8680   book       0.8700   PASS
cut 0.0: D (workbook)                                                    200.0000   book     200.0000   PASS
cut 0.0: S (workbook)                                                    300.0000   book     300.0000   PASS
cut 0.0: line (workbook)                                                 300.0000   book     300.0000   PASS
cut 0.0: delay (workbook)                                                  2.7966   book       2.7970   PASS
cut 0.0: cost (workbook)                                                  31.3731   book      31.3700   PASS
cut 0.0: share of paths in the set                                        95.5810   book      95.6000   PASS
cut 0.0: chance under the law                                              0.3930   book       0.3900   PASS
cut 0.0: binding quarter (workbook)                                        6.0000   book       6.0000   PASS
cut 0.1: binding quarter (workbook)                                        6.0000   book       6.0000   PASS
cut 0.2: binding quarter (workbook)                                        7.0000   book       7.0000   PASS
cuts on the grid of 0.01                                                 101.0000   book     101.0000   PASS
Theorem 10.2(ii): cuts whose price falls as the set grows (workbook)         0.0000   book       0.0000   PASS
max-min: the cut (workbook)                                                0.3800   book       0.3800   PASS
max-min: necessity of safety (workbook)                                    0.6200   book       0.6200   PASS
max-min: goal (workbook)                                                   0.6305   book       0.6300   PASS
max-min: D (workbook)                                                    143.0000   book     143.0000   PASS
max-min: S (workbook)                                                    231.6000   book     231.6000   PASS
max-min: line (workbook)                                                 231.6000   book     231.6000   PASS
max-min: delay (workbook)                                                  0.4494   book       0.4490   PASS
max-min: cost (workbook)                                                  10.5429   book      10.5400   PASS
bisection on the level: lambda*                                            0.6223   book       0.6200   PASS
hedges: a stronger goal can only lower the level, violations (workbook)         0.0000   book       0.0000   PASS
max-min: chance under the law                                              5.6370   book       5.6400   PASS
max-min: chance on the fresh paths                                         5.5080   book       5.5100   PASS
max-min: share of paths in its set                                        87.0360   book      87.0000   PASS
meeting 5%: the cut (workbook)                                             0.3500   book       0.3500   PASS
meeting 5%: D (workbook)                                                 147.5000   book     147.5000   PASS
meeting 5%: S (workbook)                                                 237.0000   book     237.0000   PASS
meeting 5%: line (workbook)                                              237.0000   book     237.0000   PASS
meeting 5%: delay (workbook)                                               0.6324   book       0.6320   PASS
meeting 5%: cost (workbook)                                               12.1690   book      12.1700   PASS
meeting 5%: chance under the law                                           4.7120   book       4.7100   PASS
meeting 5%: chance on the fresh paths                                      4.6170   book       4.6200   PASS
meeting 5%: share of paths in its set                                     88.5330   book      88.5000   PASS
95% of paths: the cut (workbook)                                           0.0800   book       0.0800   PASS
95% of paths: D (workbook)                                               188.0000   book     188.0000   PASS
95% of paths: S (workbook)                                               285.6000   book     285.6000   PASS
95% of paths: line (workbook)                                            285.6000   book     285.6000   PASS
95% of paths: delay (workbook)                                             2.2942   book       2.2940   PASS
95% of paths: cost (workbook)                                             26.9215   book      26.9200   PASS
95% of paths: share of paths in its set                                   95.0210   book      95.0200   PASS
95% of paths: chance under the law                                         0.7570   book       0.7600   PASS
the whole support: chance on the fresh paths (Table 10.3)                  0.3940   book       0.4000   PASS
a $100m cap: delay (workbook)                                              4.2791   book       4.2790   PASS
a $100m cap: cost (workbook)                                              37.2324   book      37.2300   PASS
a $100m cap: chance under the law                                          0.6430   book       0.6400   PASS
Volume I's package: chance on the book's paths                             5.0000   book       5.0000   PASS
Volume I's package: chance on the fresh paths                              4.9070   book       4.9070   PASS
Table 10.3: fresh paths within, points                                     0.2640   book       0.3000   PASS
largest standard error of a chance, points (workbook)                      0.1258   book       0.1300   PASS
paths inside a set that breach (the guarantee)                             0.0000   book       0.0000   PASS
Theorem 10.1(iii): cuts whose chance exceeds 1 - coverage (workbook)         0.0000   book       0.0000   PASS
frontier 1%: line                                                        190.0000   book     190.0000   PASS
frontier 1%: delay                                                         2.1737   book       2.1740   PASS
frontier 1%: cost (workbook)                                              23.0893   book      23.0900   PASS
frontier 2%: line                                                        170.0000   book     170.0000   PASS
frontier 2%: delay                                                         1.5951   book       1.5950   PASS
frontier 2%: cost (workbook)                                              17.8609   book      17.8600   PASS
frontier 3%: line                                                        180.0000   book     180.0000   PASS
frontier 3%: delay                                                         1.1605   book       1.1610   PASS
frontier 3%: cost (workbook)                                              14.6841   book      14.6800   PASS
frontier 4%: line                                                        165.0000   book     165.0000   PASS
frontier 4%: delay                                                         0.9251   book       0.9250   PASS
frontier 4%: cost (workbook)                                              12.3505   book      12.3500   PASS
frontier 5%: line                                                        170.0000   book     170.0000   PASS
frontier 5%: delay                                                         0.6676   book       0.6680   PASS
frontier 5%: cost (workbook)                                              10.4406   book      10.4400   PASS
frontier 6%: line                                                        160.0000   book     160.0000   PASS
frontier 6%: delay                                                         0.5024   book       0.5020   PASS
frontier 6%: cost (workbook)                                               8.8194   book       8.8200   PASS
frontier 8%: line                                                        160.0000   book     160.0000   PASS
frontier 8%: delay                                                         0.1817   book       0.1820   PASS
frontier 8%: cost (workbook)                                               6.2536   book       6.2500   PASS
frontier 10%: line                                                       135.0000   book     135.0000   PASS
frontier 10%: delay                                                        0.0152   book       0.0150   PASS
frontier 10%: cost (workbook)                                              4.1714   book       4.1700   PASS
frontier 12.5%: line                                                     100.0000   book     100.0000   PASS
frontier 12.5%: delay                                                      0.0000   book       0.0000   PASS
frontier 12.5%: cost (workbook)                                            3.0000   book       3.0000   PASS
frontier 15%: line                                                        75.0000   book      75.0000   PASS
frontier 15%: delay                                                        0.0000   book       0.0000   PASS
frontier 15%: cost (workbook)                                              2.2500   book       2.2500   PASS
neuro-fuzzy: training points                                             150.0000   book     150.0000   PASS
neuro-fuzzy: Armijo steps                                                300.0000   book     300.0000   PASS
neuro-fuzzy: mean squared error at the start                               0.0802   book       0.0802   PASS
neuro-fuzzy: mean squared error after training                           0.008059   book     0.008060   PASS
width, deviations mild (workbook)                                          0.1258   book       0.1260   PASS
width, deviations moderate (workbook)                                      0.0619   book       0.0620   PASS
width, deviations severe (workbook)                                        0.0664   book       0.0660   PASS
width, deviations extreme (workbook)                                       0.0528   book       0.0530   PASS
width, closures small (workbook)                                           0.1099   book       0.1100   PASS
width, closures large (workbook)                                           0.3312   book       0.3310   PASS
rule mild-small: conclusion at its anchor (workbook)                      -0.0440   book      -0.0400   PASS
rule mild-small: exact cost at its anchor (workbook)                       0.0000   book       0.0000   PASS
rule mild-small: per $m of D (workbook)                                  0.001440   book     0.001400   PASS
rule mild-small: per $m of S (workbook)                                  0.001549   book     0.001500   PASS
rule mild-large: conclusion at its anchor (workbook)                       7.2319   book       7.2300   PASS
rule mild-large: exact cost at its anchor (workbook)                       7.2915   book       7.2900   PASS
rule mild-large: per $m of D (workbook)                                    0.0295   book       0.0295   PASS
rule mild-large: per $m of S (workbook)                                    0.0289   book       0.0289   PASS
rule moderate-small: conclusion at its anchor (workbook)                  -0.1172   book      -0.1200   PASS
rule moderate-small: exact cost at its anchor (workbook)                   0.0000   book       0.0000   PASS
rule moderate-small: per $m of D (workbook)                                0.0122   book       0.0122   PASS
rule moderate-small: per $m of S (workbook)                                0.0156   book       0.0156   PASS
rule moderate-large: conclusion at its anchor (workbook)                   9.5389   book       9.5400   PASS
rule moderate-large: exact cost at its anchor (workbook)                   9.5415   book       9.5400   PASS
rule moderate-large: per $m of D (workbook)                                0.0315   book       0.0315   PASS
rule moderate-large: per $m of S (workbook)                                0.0299   book       0.0299   PASS
rule severe-small: conclusion at its anchor (workbook)                    14.0510   book      14.0500   PASS
rule severe-small: exact cost at its anchor (workbook)                    14.0060   book      14.0100   PASS
rule severe-small: per $m of D (workbook)                                  0.3288   book       0.3288   PASS
rule severe-small: per $m of S (workbook)                                  0.0300   book       0.0300   PASS
rule severe-large: conclusion at its anchor (workbook)                    24.5506   book      24.5500   PASS
rule severe-large: exact cost at its anchor (workbook)                    24.5060   book      24.5100   PASS
rule severe-large: per $m of D (workbook)                                  0.3288   book       0.3288   PASS
rule severe-large: per $m of S (workbook)                                  0.0300   book       0.0300   PASS
rule extreme-small: conclusion at its anchor (workbook)                   39.5762   book      39.5800   PASS
rule extreme-small: exact cost at its anchor (workbook)                   39.5762   book      39.5800   PASS
rule extreme-small: per $m of D (workbook)                                 0.3531   book       0.3531   PASS
rule extreme-small: per $m of S (workbook)                                 0.0300   book       0.0300   PASS
rule extreme-large: conclusion at its anchor (workbook)                   50.0762   book      50.0800   PASS
rule extreme-large: exact cost at its anchor (workbook)                   50.0762   book      50.0800   PASS
rule extreme-large: per $m of D (workbook)                                 0.3531   book       0.3531   PASS
rule extreme-large: per $m of S (workbook)                                 0.0300   book       0.0300   PASS
global fit: the six rules                                                  6.0000   book       6.0000   PASS
global fit: conclusion at centre 1                                        -0.0293   book      -0.0300   PASS
global fit: conclusion at centre 2                                         6.7086   book       6.7100   PASS
global fit: conclusion at centre 3                                        58.6432   book      58.6400   PASS
global fit: conclusion at centre 4                                        -9.5638   book      -9.5600   PASS
global fit: conclusion at centre 5                                       -19.4950   book     -19.4900   PASS
global fit: conclusion at centre 6                                        61.5818   book      61.5800   PASS
certification: declarations on the grid                                 3266.0000   book    3266.0000   PASS
certification: root-mean-square error                                      0.1584   book       0.1580   PASS
certification: within $0.25m, %                                           93.4783   book      93.5000   PASS
certification: largest error (workbook)                                    0.9542   book       0.9540   PASS
certification: largest error at D                                        135.0000   book     135.0000   PASS
certification: largest error at S                                         70.0000   book      70.0000   PASS
global fit: root-mean-square error                                         0.1827   book       0.1830   PASS
revision (140, 230): the surface (workbook)                                8.9868   book       8.9900   PASS
revision (140, 230): exact cost (workbook)                                 9.5189   book       9.5200   PASS
revision (140, 230): line (workbook)                                     230.0000   book     230.0000   PASS
revision (140, 230): delay (workbook)                                      0.3274   book       0.3270   PASS
revision (140, 230): chance under the law                                  6.3320   book       6.3300   PASS

247 of 247 checkpoints PASS

Next. Chapter 11 declares a family of laws, which sits between a law and a set: the board trusts a record enough to name the laws that fit it, but not enough to pick one. The guarantee of this chapter and the chance of Chapter 9 are its two ends. AXIOM-10 runs the same models interactively (Lab 2.10); this notebook and the workbook are its reproducible record.

Dynamic Corporate Transformation — Volume I: Foundations and Mathematical Framework; Volume II: Enterprise Optimization & Applications
Jump to any chapter

Volume I: Foundations and Mathematical Framework

  1. Ch. 1Introduction to Dynamic Corporate Transformation
  2. Ch. 2Enterprise Systems and Transformation
  3. Ch. 3Mathematical Foundations
  4. Ch. 4Enterprise Modeling Principles
  5. Ch. 5Enterprise State Representation
  6. Ch. 6Enterprise Transformation Operators
  7. Ch. 7Dynamic Enterprise Systems
  8. Ch. 8Stochastic Enterprise Dynamics
  9. Ch. 9Enterprise State Architecture
  10. Ch. 10Enterprise Capital Architecture
  11. Ch. 11Enterprise Performance Architecture
  12. Ch. 12Enterprise Risk, Resilience, and Robustness Architecture
  13. Ch. 13Unified Enterprise Transformation Architecture
  14. Ch. 14Mathematical Analysis of the Unified Enterprise Transformation Architecture
  15. Ch. 15Mathematical Formulation of Enterprise Optimization
  16. Ch. 16Synthesis, Future Directions, and Transition to Volume II

Volume II: Enterprise Optimization & Applications

  1. Ch. 1Introduction to Enterprise Optimization
  2. Ch. 2The General Enterprise Optimization Problem Revisited
  3. Ch. 3Convex Enterprise Optimization
  4. Ch. 4Nonlinear and Mixed-Integer Enterprise Optimization
  5. Ch. 5Dynamic Enterprise Optimization
  6. Ch. 6Optimal Control of Enterprise Systems
  7. Ch. 7Dynamic Programming for Enterprise Systems
  8. Ch. 8Hamilton–Jacobi–Bellman Enterprise Framework
  9. Ch. 9Stochastic Enterprise Optimization
  10. Ch. 10Neuro-Fuzzy Robust Enterprise Optimization
  11. Ch. 11Distributionally Robust Enterprise Optimization
  12. Ch. 12Multi-Objective Enterprise Optimization
  13. Ch. 13Machine Learning for Enterprise Transformation
  14. Ch. 14Artificial Intelligence for Enterprise Optimization
  15. Ch. 15Enterprise Digital Twins and Autonomous Enterprise Transformation
  16. Ch. 16Enterprise Applications and Integrated Transformation Case Studies

Dynamic Corporate Transformation

Springer Nature · Management for Professionals · Forthcoming 2027

  • Volume I — Foundations and Mathematical Framework
  • Volume II — Enterprise Optimization & Applications
Buy Volume I: Dynamic Corporate Transformation: Foundations and Mathematical FrameworkBuy Volume II: Dynamic Corporate Transformation: Enterprise Optimization & Applications
Jump to any chapter

Volume I: Foundations and Mathematical Framework

  1. Ch. 1Introduction to Dynamic Corporate Transformation
  2. Ch. 2Enterprise Systems and Transformation
  3. Ch. 3Mathematical Foundations
  4. Ch. 4Enterprise Modeling Principles
  5. Ch. 5Enterprise State Representation
  6. Ch. 6Enterprise Transformation Operators
  7. Ch. 7Dynamic Enterprise Systems
  8. Ch. 8Stochastic Enterprise Dynamics
  9. Ch. 9Enterprise State Architecture
  10. Ch. 10Enterprise Capital Architecture
  11. Ch. 11Enterprise Performance Architecture
  12. Ch. 12Enterprise Risk, Resilience, and Robustness Architecture
  13. Ch. 13Unified Enterprise Transformation Architecture
  14. Ch. 14Mathematical Analysis of the Unified Enterprise Transformation Architecture
  15. Ch. 15Mathematical Formulation of Enterprise Optimization
  16. Ch. 16Synthesis, Future Directions, and Transition to Volume II

Volume II: Enterprise Optimization & Applications

  1. Ch. 1Introduction to Enterprise Optimization
  2. Ch. 2The General Enterprise Optimization Problem Revisited
  3. Ch. 3Convex Enterprise Optimization
  4. Ch. 4Nonlinear and Mixed-Integer Enterprise Optimization
  5. Ch. 5Dynamic Enterprise Optimization
  6. Ch. 6Optimal Control of Enterprise Systems
  7. Ch. 7Dynamic Programming for Enterprise Systems
  8. Ch. 8Hamilton–Jacobi–Bellman Enterprise Framework
  9. Ch. 9Stochastic Enterprise Optimization
  10. Ch. 10Neuro-Fuzzy Robust Enterprise Optimization
  11. Ch. 11Distributionally Robust Enterprise Optimization
  12. Ch. 12Multi-Objective Enterprise Optimization
  13. Ch. 13Machine Learning for Enterprise Transformation
  14. Ch. 14Artificial Intelligence for Enterprise Optimization
  15. Ch. 15Enterprise Digital Twins and Autonomous Enterprise Transformation
  16. Ch. 16Enterprise Applications and Integrated Transformation Case Studies