DCT Laboratory — Volume II, Chapter 2
The General Enterprise Optimization Problem Revisited
Seed 26202 · Companion to Chapter 2 and AXIOM Lab 2.2 (module AXIOM-02) · Mirrored in DCT_V2_Ch02_Lab.xlsx
This laboratory reproduces Worked Example 2.1, Can Meridian Automate and Pay Out at Once?, with the book's declarations, and works the five steps of AXIOM Lab 2.2: build the instance, check plans by simulation, diagnose the clash, price the repairs, and reweight the objective. It ends with Table 2.4, one commitment under four quantifiers, on Volume I's Chapter 8 model. Every Meridian number below is the book's (Tables 2.4, 2.6 and 2.7, Figure 2.3, Online Appendix 2.B.4); the final cell checks them. Money is in $ million.
The declarations (Worked Example 2.1, the situation)
Volume I, Worked Example 6.1 declared Meridian's automation program in Industrial Systems. A round costs $120 million, closes half the gap between efficiency and a ceiling of 85, and raises workforce capability by one point; each efficiency point above today's 71 saves $10 million a year; and a round can start only with at least $470 million of liquidity, so that the board's $350 million floor holds after paying for it, and with capability of at least 55. Today Meridian has $620 million of liquidity, efficiency 71 and capability 58.
The chief operating officer pledges a round every year for six years; the chief financial officer pledges to
pay out half of each year's savings; and the board also wants Meridian to end year 6 with the $470 million
another round would need. That makes five commitments, each with an owner: the floor (the board),
capability (HR), six rounds (the COO), half payout (the CFO) and the end condition (the board).
All amounts are undiscounted. The function simulate below is the declared dynamics run forward under a plan:
every claim in this notebook about a plan's liquidity or the commitments it keeps is one call to it.
Python Code
import itertools
import textwrap
from decimal import Decimal, ROUND_HALF_UP
import numpy as np
from scipy import stats
from scipy.optimize import linprog
import matplotlib.pyplot as plt
plt.rcParams.update({"figure.dpi": 110, "axes.spines.top": False, "axes.spines.right": False})
SEED = 26202 # the lab's seed: fresh paths in Panel 7
BOOK_SEED = 8 # Volume I's Chapter 8 stream, on which Table 2.4 counts every breach
# Volume I, Worked Example 6.1: the automation program in Industrial Systems ($ million)
COST, CEIL, VAL = 120.0, 85.0, 10.0 # a round costs $120m and closes half the gap to 85; $10m a year a point
E0, Q0, W0 = 71.0, 620.0, 58.0 # today's efficiency, liquidity and workforce capability
FLOOR, CAP_MIN = 350.0, 55.0 # the board's floor; the capability a round needs
PRE = FLOOR + COST # $470m: a round can start only if the floor holds after paying for it
Q_END, K, HALF = 470.0, 6, 0.5 # the board's end condition (another round possible); six years; the pledge
COMMITMENTS = ["floor", "capability", "six rounds", "half payout", "end condition"]
OWNERS = {"floor": "the board", "capability": "HR", "six rounds": "the COO", "half payout": "the CFO",
"end condition": "the board"}
SCHEDULES = list(itertools.product([0, 1], repeat=K)) # the 64 schedules of rounds
def simulate(z, share=0.0, payouts=None):
# The declared dynamics, run forward under a plan (Proposition 2.2). z: a round in each year (0 or 1); the
# payout is a share of each year's savings, or the list `payouts`. The plan keeps running after a breach so
# that every breach is seen: `broken` maps each commitment the plan breaks to the first year it breaks.
q, e, w, rows, broken = Q0, E0, W0, [], {}
for k in range(1, K + 1):
after = q - COST * z[k - 1] # liquidity after paying for this year's round
if z[k - 1]:
if after < FLOOR - 1e-9:
broken.setdefault("floor", k)
if w < CAP_MIN:
broken.setdefault("capability", k)
e, w = e + (CEIL - e) / 2, w + 1 # half the gap to 85 closed; a point of capability
s = VAL * (e - E0) # savings are induced by the rounds
p = share * s if payouts is None else payouts[k - 1]
if p < HALF * s - 1e-9:
broken.setdefault("half payout", k)
q = after + s - p
if q < FLOOR - 1e-9:
broken.setdefault("floor", k)
rows.append(dict(year=k, round=z[k - 1], eff=e, cap=w, sav=s, pay=p, after=after, q=q))
if sum(z) < K:
broken["six rounds"] = next(k + 1 for k in range(K) if not z[k])
if q < Q_END - 1e-9:
broken["end condition"] = K
return rows, broken
def feasible(active):
# An exact oracle for a set of commitments. Payouts only lower liquidity, so the least payout the active
# pledges allow is the best for feasibility; the rounds are enumerated (one schedule if six are pledged).
scheds = [(1,) * K] if "six rounds" in active else SCHEDULES
share = HALF if "half payout" in active else 0.0
for z in scheds:
if not set(simulate(z, share)[1]) & set(active):
return True, z
return False, None
def book(x, d=1):
# print as the book does: halves round up (461.25 prints as 461.3)
return str(Decimal(float(x)).quantize(Decimal(1).scaleb(-d), rounding=ROUND_HALF_UP))
def years(z):
return ", ".join(str(k + 1) for k in range(K) if z[k]) or "none"
print(f"a round needs ${PRE:.0f}m on hand; capability {W0:.0f} today against {CAP_MIN:.0f}; "
f"{len(SCHEDULES)} schedules of rounds over {K} years")
print("five commitments:", "; ".join(f"{c} ({OWNERS[c]})" for c in COMMITMENTS))a round needs $470m on hand; capability 58 today against 55; 64 schedules of rounds over 6 years five commitments: floor (the board); capability (HR); six rounds (the COO); half payout (the CFO); end condition (the board)
Panel 1 — Build the instance (Worked Example 2.1, Step 1; Table 2.6; Proposition 2.2: $702 million against $647.5 million)
AXIOM Lab 2.2, step 1. The GEOP builder takes the instance block by block, and Table 2.6 is the card it produces: two decisions a year are chosen, whether to run a round, , and how much to pay out, ; efficiency, capability, savings and liquidity are induced by the dynamics, , and . The uncertainty block is empty, and says so. Try to enter savings as a decision and the decision-variable editor refuses: savings are computed from the rounds, so a lever on them is a phantom lever the company does not have. The tempting error is exactly that: the CFO's spreadsheet carries Volume I's six-round savings, $702 million over six years, into every plan, but a plan with three rounds saves $647.5 million.
Python Code
TABLE_26 = [
("Decisions", "round in year k, z_k in {0, 1}; payout p_k >= 0", "COO; CFO"),
("Dynamics", "each round closes half the efficiency gap to 85 and adds a point of capability; savings "
"$10 million per point above 71; liquidity q_k = q_k-1 - 120 z_k + S_k - p_k", "COO; treasury"),
("Admissible decisions", "a round needs capability of at least 55", "HR"),
("Path commitments", "liquidity of at least $350 million after paying for a round and at year end; a round "
"every year; half of each year's savings paid out", "board; COO; CFO"),
("Start and end", "$620 million, efficiency 71, capability 58; at least $470 million at the end of year 6",
"treasury; board"),
("Uncertainty", "none declared (Volume I's point estimates)", "--"),
]
print("The instance card (Table 2.6)")
print(f"{'block':22s}{'declaration':66s}owner")
for block, decl, owner in TABLE_26:
for i, line in enumerate(textwrap.wrap(decl, 64)):
print(f"{block if i == 0 else '':22s}{line:66s}{owner if i == 0 else ''}")
DECISIONS = {"rounds z_k": "COO", "payouts p_k": "CFO"}
INDUCED = {"efficiency e_k": "e_k = e_k-1 + z_k (85 - e_k-1) / 2", "capability w_k": "w_k = w_k-1 + z_k",
"savings S_k": "S_k = 10 (e_k - 71)", "liquidity q_k": "q_k = q_k-1 - 120 z_k + S_k - p_k"}
def declare_decision(name, owner):
# the decision-variable editor: a quantity the dynamics compute cannot also be chosen (Proposition 2.2)
if name in INDUCED:
return f"REFUSED {name}: induced by the dynamics, {INDUCED[name]}; a lever on it would be a phantom lever"
return f"accepted {name} (owner: {owner})"
print("\nThe decision-variable editor")
VERDICTS = [declare_decision(name, owner) for name, owner in list(DECISIONS.items()) + [("savings S_k", "CFO")]]
for v in VERDICTS:
print(" ", v)
six, _ = simulate((1,) * K)
three, _ = simulate((1, 1, 0, 1, 0, 0))
SAV6, SAV3 = sum(r["sav"] for r in six), sum(r["sav"] for r in three)
print("\nsavings by year ($m) " + "".join(f"{k:>8d}" for k in range(1, K + 1)) + " total")
print("six rounds (the spreadsheet) " + "".join(f"{book(r['sav']):>8s}" for r in six) + f"{book(SAV6):>8s}")
print("rounds in years 1, 2 and 4 " + "".join(f"{book(r['sav']):>8s}" for r in three) + f"{book(SAV3):>8s}")
print(f"carried into a three-round plan, the spreadsheet's savings overstate it by ${SAV6 - SAV3:.1f}m: "
f"savings are induced by the rounds")The instance card (Table 2.6)
block declaration owner
Decisions round in year k, z_k in {0, 1}; payout p_k >= 0 COO; CFO
Dynamics each round closes half the efficiency gap to 85 and adds a point COO; treasury
of capability; savings $10 million per point above 71; liquidity
q_k = q_k-1 - 120 z_k + S_k - p_k
Admissible decisions a round needs capability of at least 55 HR
Path commitments liquidity of at least $350 million after paying for a round and board; COO; CFO
at year end; a round every year; half of each year's savings
paid out
Start and end $620 million, efficiency 71, capability 58; at least $470 treasury; board
million at the end of year 6
Uncertainty none declared (Volume I's point estimates) --
The decision-variable editor
accepted rounds z_k (owner: COO)
accepted payouts p_k (owner: CFO)
REFUSED savings S_k: induced by the dynamics, S_k = 10 (e_k - 71); a lever on it would be a phantom lever
savings by year ($m) 1 2 3 4 5 6 total
six rounds (the spreadsheet) 70.0 105.0 122.5 131.3 135.6 137.8 702.2
rounds in years 1, 2 and 4 70.0 105.0 105.0 122.5 122.5 122.5 647.5
carried into a three-round plan, the spreadsheet's savings overstate it by $54.7m: savings are induced by the rounds
Panel 2 — Check the joint plan by simulation (Worked Example 2.1, Step 2; Theorem 2.3(iii): $535 million, $467.5 million, dies in year 3)
AXIOM Lab 2.2, step 2. Any claim that a plan keeps its commitments is checked by running the declared dynamics forward under the plan, one pass when the instance is certain (Proposition 2.2). Under both pledges liquidity ends year 1 at $535 million () and year 2 at $467.5 million (): round 3 cannot start, because paying for it would leave $347.5 million, below the floor. The joint plan dies in year 3. The COO's plan with all savings kept runs every round. Theorem 2.3(iii) finds the date without guessing a plan: carry forward the set of states that some plan can reach while keeping every commitment so far; the first empty set is the year the plan dies.
Python Code
def run_six(share):
# the COO's six rounds with a payout share, run forward until a round cannot start
q, e, path, lines = Q0, E0, [Q0], []
for k in range(1, K + 1):
if q - COST < FLOOR - 1e-9:
return path, k, q - COST, lines
e = e + (CEIL - e) / 2
s = VAL * (e - E0)
lines.append(f"year {k}: {q:.1f} - {COST:.0f} + {s:.1f} - {share * s:.1f} = {q - COST + s - share * s:.1f}")
q = q - COST + s - share * s
path.append(q)
return path, None, None, lines
JOINT, DIES, AFTER3, lines = run_six(HALF)
KEPT, _, _, _ = run_six(0.0)
print("The joint plan: six rounds, half of each year's savings paid out (one forward pass)")
for ln in lines:
print(" " + ln)
print(f" year {DIES}: round {DIES} cannot start: {JOINT[-1]:.1f} - {COST:.0f} = {AFTER3:.1f}, below the "
f"${FLOOR:.0f}m floor -> the joint plan dies in year {DIES}")
print("\nThe COO's plan with all savings kept: year-end liquidity", ", ".join(book(q) for q in KEPT[1:]))
print(f" every round starts with at least ${min(KEPT[:-1]):.0f}m and year 6 ends at ${KEPT[-1]:.1f}m: "
f"the board's conditions hold")
print(f" by year 2 the payouts have taken ${KEPT[2] - JOINT[2]:.1f}m, and round 3 misses its ${PRE:.0f}m by "
f"${PRE - JOINT[2]:.1f}m")
def reachable(floor=True, end=True, share_min=HALF):
# Theorem 2.3(iii) for the pledged six rounds: carry forward the year-end liquidity that some plan reaches
# while keeping every commitment so far. Under six rounds efficiency and capability are fixed by the year,
# so each set is an interval [lo, hi]; paying out more than the pledge can only lower liquidity.
lo, hi, e, sets = Q0, Q0, E0, [(Q0, Q0)]
for k in range(1, K + 1):
if floor:
lo = max(lo, PRE) # a round can start only with $470m
if lo > hi:
return sets + [None]
e = e + (CEIL - e) / 2
s = VAL * (e - E0)
hi = hi - COST + s - share_min * s # the most cash: the least payout the pledge allows
lo = FLOOR if floor else -np.inf # any lower level is reached by paying out more
if end and k == K:
lo = max(lo, Q_END)
if lo > hi:
return sets + [None]
sets.append((lo, hi))
return sets
def show(R):
return "{%.0f}" % R[0] if R[0] == R[1] else ("(-inf, %s]" % book(R[1]) if R[0] == -np.inf else "[%s, %s]" % (book(R[0], 0), book(R[1])))
print("\nTheorem 2.3(iii): the year-end liquidity some plan can reach, keeping every commitment so far")
for label, kw in (("all five commitments", {}), ("the floor dropped", {"floor": False})):
R = reachable(**kw)
k_dead = len(R) - 1 if R[-1] is None else None
cells = [show(r) for r in R if r is not None] + (["empty"] if k_dead else [])
print(f" {label:22s} " + " ".join(f"y{k}: {c}" for k, c in enumerate(cells)))
print(f" {'':22s} -> first empty set in year {k_dead}")
R_ALL = reachable()
DEATH = len(R_ALL) - 1The joint plan: six rounds, half of each year's savings paid out (one forward pass)
year 1: 620.0 - 120 + 70.0 - 35.0 = 535.0
year 2: 535.0 - 120 + 105.0 - 52.5 = 467.5
year 3: round 3 cannot start: 467.5 - 120 = 347.5, below the $350m floor -> the joint plan dies in year 3
The COO's plan with all savings kept: year-end liquidity 570.0, 555.0, 557.5, 568.8, 584.4, 602.2
every round starts with at least $555m and year 6 ends at $602.2m: the board's conditions hold
by year 2 the payouts have taken $87.5m, and round 3 misses its $470m by $2.5m
Theorem 2.3(iii): the year-end liquidity some plan can reach, keeping every commitment so far
all five commitments y0: {620} y1: [350, 535.0] y2: [350, 467.5] y3: empty
-> first empty set in year 3
the floor dropped y0: {620} y1: (-inf, 535.0] y2: (-inf, 467.5] y3: (-inf, 408.8] y4: (-inf, 354.4] y5: (-inf, 302.2] y6: empty
-> first empty set in year 6
Panel 3 — Diagnose: name the clash (Worked Example 2.1, Step 3; Theorem 2.3(i)–(ii): two minimal clashes)
AXIOM Lab 2.2, step 3. The deletion filter of Theorem 2.3(i) goes through the commitments once, dropping each one whose removal leaves the rest still infeasible: five commitments, five feasibility checks, and what remains is a minimal infeasible set, commitments that cannot hold together, any one of which can be dropped to let the others hold. Run it twice. With the board's conditions first it returns {floor, six rounds, half payout}; with the pledges first, {six rounds, half payout, end condition}: without a floor the joint plan runs all six rounds but ends year 6 with $251 million. These are the only two minimal clashes, so by Theorem 2.3(ii) a repair must break both: give up one of the pledges, or give up both of the board's conditions. Dropping the floor alone repairs nothing.
Python Code
PROSE = {"floor": "the floor", "capability": "capability", "six rounds": "six rounds", "half payout": "the half payout",
"end condition": "the end condition"}
def deletion_filter(order):
# Theorem 2.3(i): one pass, one feasibility check per commitment
F, log = list(order), []
for c in order:
rest = [x for x in F if x != c]
ok = feasible(rest)[0]
log.append(f"without {PROSE[c]}, the rest {'can hold: keep it' if ok else 'still clash: drop it'}")
if not ok:
F = rest
return F, log
BOARD_FIRST = ["end condition", "floor", "capability", "six rounds", "half payout"]
PLEDGES_FIRST = ["six rounds", "half payout", "capability", "floor", "end condition"]
CLASH = {}
for name, order in (("the board's conditions first", BOARD_FIRST), ("the pledges first", PLEDGES_FIRST)):
F, log = deletion_filter(order)
CLASH[name] = F
print(f"The deletion filter, {name} ({len(log)} feasibility checks)")
for i, ln in enumerate(log, 1):
print(f" {i}. {ln}")
print(" clash: {" + ", ".join(F) + "}\n")
rows_c, _ = simulate((1,) * K, HALF)
print(f"capability never binds: it rises from {W0:.0f} to {rows_c[-1]['cap']:.0f}, one point a round")
print(f"without a floor the joint plan runs all six rounds and ends year 6 with ${rows_c[-1]['q']:.1f}m, "
f"short of the ${Q_END:.0f}m end condition")
SUBSETS = [list(S) for r in range(1, len(COMMITMENTS) + 1) for S in itertools.combinations(COMMITMENTS, r)]
MIS = [S for S in SUBSETS if not feasible(S)[0] and all(feasible([x for x in S if x != c])[0] for c in S)]
print(f"\nall {len(SUBSETS)} sets of commitments checked: {len(MIS)} minimal infeasible sets")
for M in MIS:
print(" {" + ", ".join(M) + "}")
# Theorem 2.3(ii): dropping a group H restores feasibility exactly when H meets every minimal clash
agree, REPAIRS = 0, []
GROUPS = [list(H) for r in range(len(COMMITMENTS) + 1) for H in itertools.combinations(COMMITMENTS, r)]
for H in GROUPS:
restores = feasible([c for c in COMMITMENTS if c not in H])[0]
agree += restores == all(set(H) & set(M) for M in MIS)
if restores and not any(set(R) <= set(H) for R in REPAIRS):
REPAIRS.append(H)
print(f"\nTheorem 2.3(ii) on all {len(GROUPS)} groups of commitments to drop: restores feasibility exactly when it "
f"meets both clashes, {agree} of {len(GROUPS)}")
print("the smallest repairs:", "; ".join("drop {" + ", ".join(H) + "}" for H in REPAIRS))
FLOOR_ALONE = feasible([c for c in COMMITMENTS if c != "floor"])[0]
print(f"drop the floor alone: {'feasible' if FLOOR_ALONE else 'still infeasible'} "
f"(the clash {{six rounds, half payout, end condition}} still stands)")The deletion filter, the board's conditions first (5 feasibility checks)
1. without the end condition, the rest still clash: drop it
2. without the floor, the rest can hold: keep it
3. without capability, the rest still clash: drop it
4. without six rounds, the rest can hold: keep it
5. without the half payout, the rest can hold: keep it
clash: {floor, six rounds, half payout}
The deletion filter, the pledges first (5 feasibility checks)
1. without six rounds, the rest can hold: keep it
2. without the half payout, the rest can hold: keep it
3. without capability, the rest still clash: drop it
4. without the floor, the rest still clash: drop it
5. without the end condition, the rest can hold: keep it
clash: {six rounds, half payout, end condition}
capability never binds: it rises from 58 to 64, one point a round
without a floor the joint plan runs all six rounds and ends year 6 with $251.1m, short of the $470m end condition
all 31 sets of commitments checked: 2 minimal infeasible sets
{floor, six rounds, half payout}
{six rounds, half payout, end condition}
Theorem 2.3(ii) on all 32 groups of commitments to drop: restores feasibility exactly when it meets both clashes, 32 of 32
the smallest repairs: drop {six rounds}; drop {half payout}; drop {floor, end condition}
drop the floor alone: still infeasible (the clash {six rounds, half payout, end condition} still stands)
Panel 4 — Price the repairs (Worked Example 2.1, Step 4; Table 2.7; Online Appendix 2.B.4: 18.83 percent, years 1, 2 and 4, $251.1 million)
AXIOM Lab 2.2, step 4. Each repair keeps what it can and gives up what it must. (a) Keep six rounds and pay out the largest constant share of savings the board's conditions allow: liquidity is linear in the share, so each commitment caps it and the smallest cap wins, 18.83 percent, set by the end condition (the round-6 start alone would allow 20.27 percent); $132 million is paid out and efficiency reaches 84.8. (b) Keep the half payout and run the most rounds it allows: three, in years 1, 2 and 4, with $324 million paid out, efficiency 83.25 and $584 million at the end; a round in year 3 or 5 would breach the floor, and one in year 6 the end condition. (c) Keep both pledges and give up both board conditions: liquidity falls to $182 million after the sixth round and ends at $251 million, which rewrites the board's appetite rather than repairing the plan. The optimizer's two rows of Table 2.7 follow in Panel 5.
Python Code
def largest_share(z, active):
# a constant payout share s lowers year-end liquidity by s x (savings to date), so each active commitment caps
# s; the largest share the commitments allow is the smallest cap
rows, caps, to_date = simulate(z)[0], {}, 0.0
for r in rows:
if r["round"] and "floor" in active and to_date > 0:
caps[f"floor at the round-{r['year']} start"] = (r["after"] - FLOOR) / to_date
to_date += r["sav"]
if "floor" in active:
caps[f"floor at the end of year {r['year']}"] = (r["q"] - FLOOR) / to_date
if "end condition" in active:
caps["end condition"] = (rows[-1]["q"] - Q_END) / to_date
tightest = min(caps, key=caps.get)
return caps[tightest], tightest, caps
BOARD = {"floor", "capability", "end condition"} # the commitments every repair but (c) keeps
S_A, bind_a, caps_a = largest_share((1,) * K, BOARD)
S_A6 = caps_a["floor at the round-6 start"]
rows_a, broken_a = simulate((1,) * K, S_A)
_, broken_more = simulate((1,) * K, S_A + 1e-6)
print(f"(a) six rounds: the largest constant share is {100 * S_A:.2f}%, set by the {bind_a}; "
f"the round-6 start alone would allow {100 * S_A6:.2f}%")
print(f" checked by simulation: at {100 * S_A:.4f}% the board's conditions hold "
f"({'none broken' if not set(broken_a) & BOARD else sorted(set(broken_a) & BOARD)}); "
f"raised by 0.000001 it breaks the {', '.join(sorted(set(broken_more) & BOARD))}")
PAY_A = sum(r["pay"] for r in rows_a)
print(f" paid out ${PAY_A:.1f}m over six years; efficiency {rows_a[-1]['eff']:.2f}; year 6 ends at ${rows_a[-1]['q']:.1f}m")
cands = []
for z in SCHEDULES:
rows, broken = simulate(z, HALF)
if not set(broken) & {"floor", "capability", "end condition"}:
cands.append((sum(z), sum(r["pay"] for r in rows), z, rows))
N_B, PAY_B, Z_B, rows_b = max(cands, key=lambda c: (c[0], c[1])) # the most rounds, then the most paid out
print(f"\n(b) the half payout kept: {len(cands)} of 64 schedules keep the board's conditions; the most rounds is "
f"{N_B}, best in years {years(Z_B)}")
print(f" paid out ${PAY_B:.2f}m; efficiency {rows_b[-1]['eff']:.2f}; year 6 ends at ${rows_b[-1]['q']:.2f}m")
for extra in (3, 5, 6):
z = list(Z_B); z[extra - 1] = 1
rows, broken = simulate(tuple(z), HALF)
hit = sorted(set(broken) & {"floor", "end condition"})
detail = (f"{rows[extra - 1]['after']:.2f} after paying for it" if "floor" in hit else f"year 6 ends at {rows[-1]['q']:.3f}")
print(f" a round added in year {extra} breaks the {', '.join(hit)} ({detail})")
rows_c, _ = simulate((1,) * K, HALF)
PAY_C = sum(r["pay"] for r in rows_c)
LOW_C = min(r["after"] for r in rows_c)
print(f"\n(c) both pledges, neither board condition: year-end liquidity " + ", ".join(book(r["q"]) for r in rows_c))
print(f" lowest after paying for a round ${LOW_C:.2f}m (year {min(rows_c, key=lambda r: r['after'])['year']}); "
f"paid out ${PAY_C:.2f}m; year 6 ends at ${rows_c[-1]['q']:.2f}m")
print(f"\n{'Online Appendix 2.B.4, year by year':40s}" + "".join(f"{k:>8d}" for k in range(1, K + 1)))
for label, rows, key, d in (("(a) efficiency", rows_a, "eff", 2), ("(a) savings", rows_a, "sav", 1),
(f"(a) paid out ({100 * S_A:.1f}%)", rows_a, "pay", 1), ("(a) liquidity", rows_a, "q", 1),
("(b) round", rows_b, "round", None), ("(b) savings", rows_b, "sav", 1),
("(b) liquidity", rows_b, "q", 1)):
cells = [("yes" if r[key] else "no") if d is None else book(r[key], d) for r in rows]
print(f"{label:40s}" + "".join(f"{c:>8s}" for c in cells))
fig, ax = plt.subplots(figsize=(7.6, 3.6))
yr = np.arange(K + 1)
ax.axhline(FLOOR, color="#999999", lw=0.9)
ax.axhline(PRE, color="#999999", lw=0.8, ls="--")
ax.text(0.05, FLOOR - 7, "floor \\$350m", color="#616161", fontsize=8, va="top")
ax.text(0.05, PRE - 6, "\\$470m: to start a round,\nand at the end of year 6", color="#616161", fontsize=8, va="top")
ax.plot(yr, [Q0] + [r["q"] for r in rows_c], color="#616161", lw=1.2, ls=":", marker="o", ms=3,
label="(c) six rounds, half paid out, no floor or end")
ax.plot(yr, [Q0] + [r["q"] for r in rows_a], color="#1F4E79", lw=2, marker="o", ms=3.5,
label=f"(a) six rounds, {100 * S_A:.1f}% paid out")
ax.plot(yr, [Q0] + [r["q"] for r in rows_b], color="#E65100", lw=2, marker="o", ms=3.5,
label="(b) rounds in years 1, 2, 4, half paid out")
ax.plot(np.arange(len(JOINT)), JOINT, color="#B71C1C", lw=2.4, marker="o", ms=4, label="joint plan: six rounds, half paid out")
ax.plot([2.5], [JOINT[-1]], "x", color="#B71C1C", ms=9, mew=2)
ax.annotate("round 3 cannot start:\n467.5 − 120 = 347.5", xy=(2.56, JOINT[-1] - 3), xytext=(3.12, 452), fontsize=8,
color="#B71C1C", va="top", arrowprops=dict(arrowstyle="-", color="#B71C1C", lw=0.7, shrinkB=2))
ax.set(xlim=(-0.2, 6.3), ylim=(220, 650), xlabel="year", ylabel="year-end liquidity (\\$ million)",
title="The joint plan dies in year 3; three repairs break both clashes (seed 26202)")
ax.legend(frameon=False, fontsize=7.5, loc="lower left", ncol=2)
plt.tight_layout(); plt.show()(a) six rounds: the largest constant share is 18.83%, set by the end condition; the round-6 start alone would allow 20.27%
checked by simulation: at 18.8251% the board's conditions hold (none broken); raised by 0.000001 it breaks the end condition
paid out $132.2m over six years; efficiency 84.78; year 6 ends at $470.0m
(b) the half payout kept: 35 of 64 schedules keep the board's conditions; the most rounds is 3, best in years 1, 2, 4
paid out $323.75m; efficiency 83.25; year 6 ends at $583.75m
a round added in year 3 breaks the floor (347.50 after paying for it)
a round added in year 5 breaks the floor (341.25 after paying for it)
a round added in year 6 breaks the end condition (year 6 ends at 468.125)
(c) both pledges, neither board condition: year-end liquidity 535.0, 467.5, 408.8, 354.4, 302.2, 251.1
lowest after paying for a round $182.19m (year 6); paid out $351.09m; year 6 ends at $251.09m
Online Appendix 2.B.4, year by year 1 2 3 4 5 6
(a) efficiency 78.00 81.50 83.25 84.13 84.56 84.78
(a) savings 70.0 105.0 122.5 131.3 135.6 137.8
(a) paid out (18.8%) 13.2 19.8 23.1 24.7 25.5 25.9
(a) liquidity 556.8 522.1 501.5 488.0 478.1 470.0
(b) round yes yes no yes no no
(b) savings 70.0 105.0 105.0 122.5 122.5 122.5
(b) liquidity 535.0 467.5 520.0 461.3 522.5 583.8

Panel 5 — Reweight: let the optimizer choose (Worked Example 2.1, Step 5; Figure 2.3(b); Theorem 2.1: 2.9, 10.7, 25.4 and 53.9 years)
AXIOM Lab 2.2, step 5. Drop both pledges and let an optimizer choose the rounds and the payouts, keeping the floor, the capability condition and the end condition. That needs an objective, and here the content of the terminal term decides (Theorem 2.1(iv)). With the six-year payout as the objective and nothing credited beyond year 6, the optimizer runs two rounds and pays out $505 million: rounds 3 to 6 would cost $480 million and return only $107 million of savings inside the window. Crediting the year-6 savings for further years, as a terminal term, changes the answer at = 2.9, 10.7, 25.4 and 53.9: the COO's six rounds win only beyond 53.9 years of credit. Move the credit from 0 to 60 years, then switch the objective to Mayer form, the payout carried in an accumulator and credited at year 6 (Theorem 2.1(i)): no plan changes.
Python Code
def payout_lp(z, scale_end=1.0):
# With the rounds fixed, liquidity is linear in the payouts and every commitment is a linear inequality, so
# the best payouts solve a small linear program, emitted in standard form: minimize c'p subject to A p <= b,
# p >= 0, the six-year payout maximized as its negative. Liquidity is the no-payout path less payouts to date.
rows, broken = simulate(z, payouts=[0.0] * K)
if "capability" in broken:
return None
A, b, names = [], [], []
for r in rows:
k = r["year"]
if r["round"] and k > 1:
A.append([1.0 if j < k - 1 else 0.0 for j in range(K)]); b.append(r["after"] - FLOOR)
names.append(f"floor at the round-{k} start")
elif r["round"] and r["after"] < FLOOR - 1e-9:
return None # round 1 cannot start: no payout can change that
A.append([1.0 if j < k else 0.0 for j in range(K)]); b.append(r["q"] - FLOOR)
names.append(f"floor at the end of year {k}")
A.append([scale_end] * K); b.append(scale_end * (rows[-1]["q"] - Q_END)); names.append("end condition")
A, b = np.array(A), np.array(b)
res = linprog(-np.ones(K), A_ub=A, b_ub=b, bounds=[(0, None)] * K, method="highs")
if res.status != 0:
return None
return dict(z=z, pay=-res.fun, p=res.x, s6=rows[-1]["sav"], A=A, b=b, names=names,
price=-res.ineqlin.marginals, net=rows[-1]["q"])
LP = {z: payout_lp(z) for z in SCHEDULES}
OK = [z for z in SCHEDULES if LP[z] is not None]
PAY = np.array([LP[z]["pay"] for z in OK])
S6 = np.array([LP[z]["s6"] for z in OK])
NR = np.array([sum(z) for z in OK])
print(f"{len(OK)} of {len(SCHEDULES)} schedules keep the floor, capability and the end condition with no payout")
def optimizer(M):
# Bolza form: the six-year payout (running) plus M years of year-6 savings (terminal); the first best in the
# schedules' order wins a tie
v = PAY + M * S6
i = int(np.argmax(v >= v.max() - 1e-9))
return OK[i], PAY[i], S6[i], v[i]
for M in (0.0, 10.0):
z, pay, s6, v = optimizer(M)
print(f"credit {M:4.1f} years: rounds in years {years(z)}, paid out ${pay:.1f}m, year-6 savings ${s6:.1f}m, "
f"efficiency {simulate(z)[0][-1]['eff']:.2f}, value ${v:.1f}m")
two, all6 = (1, 1, 0, 0, 0, 0), (1,) * K
inside = sum(r["sav"] for r in simulate(all6)[0]) - sum(r["sav"] for r in simulate(two)[0])
print(f"rounds 3 to 6 would cost ${4 * COST:.0f}m and return ${inside:.1f}m of savings inside the window")
# move the credit from 0 to 60 years: the rounds chosen, and the credits at which the plan changes
MS = np.round(np.arange(0.0, 60.0 + 1e-9, 0.01), 2)
CHOICE = [optimizer(M)[0] for M in MS]
ROUNDS = np.array([sum(z) for z in CHOICE])
plans = [CHOICE[0]] + [CHOICE[i] for i in range(1, len(CHOICE)) if CHOICE[i] != CHOICE[i - 1]]
SWITCH = []
for z0, z1 in zip(plans[:-1], plans[1:]):
a, b = LP[z0], LP[z1]
SWITCH.append((sum(z0), sum(z1), (a["pay"] - b["pay"]) / (b["s6"] - a["s6"])))
print("\nthe plans the optimizer chooses as the credit moves from 0 to 60 years:", " -> ".join(years(z) for z in plans))
for n0, n1, m in SWITCH:
print(f" {n0} -> {n1} rounds at M = {m:.2f} years: the fall in cash over the rise in year-6 savings")
# Online Appendix 2.B.4: rounds in years 1..n, the most payouts and year-6 liquidity can add up to
EARLY = [tuple([1] * n + [0] * (K - n)) for n in range(K + 1)]
NET = [LP[z]["net"] for z in EARLY]
S6E = [LP[z]["s6"] for z in EARLY]
trim = lambda x, d: book(x, d).rstrip("0").rstrip(".")
print(f"\n{'rounds in years 1 to n, n =':34s}" + "".join(f"{n:>10d}" for n in range(K + 1)))
print(f"{'payouts + year-6 liquidity':34s}" + "".join(f"{trim(c, 4):>10s}" for c in NET))
print(f"{'year-6 savings':34s}" + "".join(f"{trim(s, 4):>10s}" for s in S6E))
print("n + 1 rounds beat n when M exceeds the fall in cash over the rise in savings: " +
", ".join(f"{trim(NET[n] - NET[n + 1], 2)}/{trim(S6E[n + 1] - S6E[n], 4)} = "
f"{book((NET[n] - NET[n + 1]) / (S6E[n + 1] - S6E[n]), 2)}" for n in range(2, K)))
def mayer(M):
# Mayer form (Theorem 2.1(i)): the payout carried in an accumulator a_k = a_k-1 + p_k, credited at year 6;
# each schedule's value read off its simulated path under the linear program's payouts
best = None
for z in OK:
rows, broken = simulate(z, payouts=LP[z]["p"])
assert not set(broken) & {"floor", "capability", "end condition"}
a = 0.0
for r in rows:
a = a + r["pay"] # the accumulator's dynamics
v = a + M * rows[-1]["sav"]
if best is None or v > best[1] + 1e-9:
best = (z, v)
return best
GRID = np.round(np.arange(0.0, 60.0 + 1e-9, 0.5), 1)
MAYER = [mayer(M) for M in GRID]
CHANGED = sum(m[0] != optimizer(M)[0] for m, M in zip(MAYER, GRID))
GAPV = max(abs(m[1] - optimizer(M)[3]) for m, M in zip(MAYER, GRID))
print(f"\nMayer form on {len(GRID)} credits from 0 to 60: plans that change {CHANGED}; largest difference in value {GAPV:.1e}")
ROWS_27 = [
("joint plan", "two, then blocked", None, None, None, "dies in year 3"),
("(a) pay out less", "six", PAY_A, rows_a[-1]["eff"], rows_a[-1]["q"], "half payout"),
("(b) fewer rounds", "years " + years(Z_B), PAY_B, rows_b[-1]["eff"], rows_b[-1]["q"], "six rounds"),
("(c) both pledges", "six", PAY_C, rows_c[-1]["eff"], rows_c[-1]["q"], "floor and end"),
]
for label, M in (("optimizer, no credit", 0.0), ("optimizer, ten years' credit", 10.0)):
z, pay, s6, v = optimizer(M)
rows, _ = simulate(z, payouts=LP[z]["p"])
n = sum(z)
ROWS_27.append((label, f"years 1–{n}" if z == EARLY[n] else "years " + years(z), pay, rows[-1]["eff"], rows[-1]["q"],
"both pledges"))
print("\nTable 2.7: six-year totals, undiscounted")
print(f"{'plan':30s}{'rounds':20s}{'paid out':>10s}{'efficiency':>12s}{'liquidity':>11s} gives up")
for name, rounds, pay, eff, q, gives in ROWS_27:
f = lambda x, d: "--" if x is None else book(x, d)
print(f"{name:30s}{rounds:20s}{f(pay, 1):>10s}{f(eff, 2):>12s}{f(q, 1):>11s} {gives}")
fig, ax = plt.subplots(figsize=(7.6, 3.6))
ax.step(MS, ROUNDS, where="post", color="#1F4E79", lw=2, label="running form: six-year payout + M years of year-6 savings")
ax.plot(GRID[::4], [sum(m[0]) for m in MAYER][::4], "o", mfc="white", mec="#E65100", mew=1.2, ms=5,
label="Mayer form: the payout in an accumulator, credited at year 6")
for n0, n1, m in SWITCH:
ax.text(m + 0.8, n0 + 0.5, f"{m:.1f}", color="#1F4E79", fontsize=8, va="center")
ax.axhline(6, color="#999999", lw=0.8, ls="--")
ax.text(0.5, 6.08, "the COO's six rounds", color="#616161", fontsize=8, va="bottom")
ax.set(xlim=(0, 60), ylim=(1.5, 6.6), yticks=range(2, 7), xlabel="years of year-6 savings credited beyond the horizon, M",
ylabel="rounds the optimizer runs", title="The credit beyond year 6 sizes the program; Mayer form agrees (seed 26202)")
ax.legend(frameon=False, fontsize=8, loc="lower right")
plt.tight_layout(); plt.show()64 of 64 schedules keep the floor, capability and the end condition with no payout credit 0.0 years: rounds in years 1, 2, paid out $505.0m, year-6 savings $105.0m, efficiency 81.50, value $505.0m credit 10.0 years: rounds in years 1, 2, 3, paid out $455.0m, year-6 savings $122.5m, efficiency 83.25, value $1680.0m rounds 3 to 6 would cost $480m and return $107.2m of savings inside the window the plans the optimizer chooses as the credit moves from 0 to 60 years: 1, 2 -> 1, 2, 3 -> 1, 2, 3, 4 -> 1, 2, 3, 4, 5 -> 1, 2, 3, 4, 5, 6 2 -> 3 rounds at M = 2.86 years: the fall in cash over the rise in year-6 savings 3 -> 4 rounds at M = 10.71 years: the fall in cash over the rise in year-6 savings 4 -> 5 rounds at M = 25.43 years: the fall in cash over the rise in year-6 savings 5 -> 6 rounds at M = 53.86 years: the fall in cash over the rise in year-6 savings rounds in years 1 to n, n = 0 1 2 3 4 5 6 payouts + year-6 liquidity 620 920 975 925 831.25 720 602.1875 year-6 savings 0 70 105 122.5 131.25 135.625 137.8125 n + 1 rounds beat n when M exceeds the fall in cash over the rise in savings: 50/17.5 = 2.86, 93.75/8.75 = 10.71, 111.25/4.375 = 25.43, 117.81/2.1875 = 53.86 Mayer form on 121 credits from 0 to 60: plans that change 0; largest difference in value 0.0e+00 Table 2.7: six-year totals, undiscounted plan rounds paid out efficiency liquidity gives up joint plan two, then blocked -- -- -- dies in year 3 (a) pay out less six 132.2 84.78 470.0 half payout (b) fewer rounds years 1, 2, 4 323.8 83.25 583.8 six rounds (c) both pledges six 351.1 84.78 251.1 floor and end optimizer, no credit years 1–2 505.0 81.50 470.0 both pledges optimizer, ten years' credit years 1–3 455.0 83.25 470.0 both pledges

Panel 6 — Route the instance and export it in standard form (Worked Example 2.1, Step 6; Theorem 2.2: 64 small linear programs)
AXIOM Lab 2.2, step 5, last part. The convexity ledger reads the instance block by block (Theorem 2.2(ii)–(iii)): the rounds are lumpy, so the instance is not convex; with the rounds fixed, liquidity is linear in the payouts and every commitment is a linear inequality, so each of the 64 possible schedules is a small linear program. Enumeration solves this instance exactly; at enterprise scale the same structure, lumpy outside and convex inside, is what Chapter 4's methods exploit. The export is the standard form of Section 2.7: minimize, inequalities in one direction, the objective in Lagrange form, with the form recorded. Its prices are in the units of each commitment as written: write the end condition in billions and its price is multiplied by 1,000, while no decision moves (Online Appendix Example 2.B.1).
Python Code
LEDGER = [("decisions", "rounds z_k in {0, 1}: lumpy, so convexity dies here (Theorem 2.2(iii))"),
("", "payouts p_k >= 0: a convex set"),
("dynamics", "with the rounds fixed, liquidity is linear in the payouts; efficiency moves only with the rounds"),
("path commitments", "floors on liquidity after each round and at each year end: linear inequalities"),
("admissible decisions", "capability of at least 55 at a round: a condition on the rounds alone"),
("start and end", "$620m today; at least $470m at the end of year 6: a linear inequality"),
("uncertainty", "none declared"),
("objective", "six-year payout plus M years of year-6 savings: linear in the payouts")]
print("The convexity ledger of Worked Example 2.1")
for block, entry in LEDGER:
print(f" {block:22s}{entry}")
print(" class: lumpy outside, linear inside, a mixed-integer program (Table 2.5: Chapter 4); here, 64 linear programs")
za, zb = (1, 1, 0, 0, 0, 0), (1, 1, 1, 0, 0, 0)
mid = ", ".join(f"{(a + b) / 2:g}" for a, b in zip(za, zb))
print(f"\nlumpy: the schedules {za} and {zb} are both feasible; their midpoint ({mid}) asks for half a round, "
f"which is no decision")
lp = LP[za]
first = lp["b"][lp["names"].index("floor at the round-2 start")] # all the round-2 start allows in year 1
pa = np.array([0, 0, 0, 0, 0, lp["pay"]]) # pay everything at the end of year 6
pb = np.array([first, 0, 0, 0, 0, lp["pay"] - first]) # pay what round 2 allows in year 1, the rest in 6
keeps = lambda p: not set(simulate(za, payouts=p)[1]) & {"floor", "capability", "end condition"}
print(f"convex inside: with rounds in years {years(za)} fixed, paying ${lp['pay']:.0f}m all in year 6, or "
f"${first:.0f}m in year 1 and the rest in year 6, keeps every commitment ({keeps(pa)}, {keeps(pb)}), "
f"and so does their midpoint ({keeps((pa + pb) / 2)})")
# Appendix 2.A, Theorem 2.2(iii)(d): a feedback rule breaks convexity even with linear dynamics
x2 = lambda t0, t1: (1 + t0) * (1 + t1)
print(f"a feedback rule: reinvest a share theta_k of what is held, x2 = (1 + theta_0)(1 + theta_1) <= 2: "
f"(1, 0) gives {x2(1, 0):.2f}, (0, 1) gives {x2(0, 1):.2f}, their midpoint {x2(0.5, 0.5):.2f}; "
f"written as amounts, u0 + u1 <= 1, the set is convex")
gap = max(abs(LP[z]["pay"] - (LP[z]["net"] - Q_END)) for z in OK)
print(f"\nall {len(OK)} linear programs agree with the closed form, payouts = (no-payout liquidity at year 6) - 470: "
f"largest gap ${gap:.1e}m")
z0 = optimizer(0.0)[0]
lp = LP[z0]
print(f"\nThe instance in standard form, rounds in years {years(z0)} (emitted: minimize; inequalities <=; Lagrange form)")
print(" minimize -(p1 + p2 + p3 + p4 + p5 + p6) the six-year payout, maximized as its negative ($ million)")
print(" subject to")
for row, rhs, name in zip(lp["A"], lp["b"], lp["names"]):
lhs = " + ".join(f"p{j + 1}" for j in range(K) if row[j])
print(f" {lhs:28s} <= {rhs:7.2f} {name}")
print(" p1, ..., p6 >= 0")
print(f" solution: paid out ${lp['pay']:.2f}m; payouts by year " + ", ".join(f"{x:.0f}" for x in lp["p"]))
for name, price in zip(lp["names"], lp["price"]):
if price > 1e-9:
print(f" price of the {name}: {price:.3f} of payout per $1 million")
lpB = payout_lp(z0, scale_end=1e-3)
print(f" the end condition written in $ billion: price {lpB['price'][-1]:,.0f} per $1 billion; payout ${lpB['pay']:.2f}m, "
f"unchanged (Example 2.B.1)")
fig, ax = plt.subplots(figsize=(7.6, 3.6))
ax.plot(S6, PAY, "o", ms=5, mfc="white", mec="#999999", mew=0.9, label="a schedule of rounds and its best payouts")
ax.plot(S6E, [c - Q_END for c in NET], "-o", color="#1F4E79", lw=1.2, ms=5, label="rounds in years 1 to n (n marked)")
for n, (s, c) in enumerate(zip(S6E, NET)):
dx, dy, ha = {0: (3, -14, "left"), 1: (-3, 10, "right"), 2: (-4, 24, "right"), 3: (4.5, 14, "left")}.get(n, (2.2, 6, "left"))
ax.text(s + dx, c - Q_END + dy, str(n), fontsize=8, color="#1F4E79", ha=ha, va="center", fontweight="bold")
for M, col, x_end in ((0.0, "#E65100", 143.0), (10.0, "#B71C1C", 143.0)):
z, pay, s6, v = optimizer(M)
xs = np.linspace(60.0, x_end, 50)
ax.plot(xs, v - M * xs, color=col, lw=0.9, ls="--", zorder=0)
ax.plot(s6, pay, "o", ms=11, mfc="none", mec=col, mew=1.6)
yl = v - M * x_end
ax.text(x_end + 1.5, yl, f"equal value,\ncredit {M:.0f} years", fontsize=7.5, color=col, va="center")
ax.set(xlim=(-5, 170), ylim=(0, 580), xticks=range(0, 141, 20), xlabel="year-6 savings (\\$ million a year)",
ylabel="best six-year payout (\\$ million)",
title="64 schedules, each a linear program; early rounds form the frontier (seed 26202)")
ax.legend(frameon=False, fontsize=8, loc="lower left")
plt.tight_layout(); plt.show()The convexity ledger of Worked Example 2.1
decisions rounds z_k in {0, 1}: lumpy, so convexity dies here (Theorem 2.2(iii))
payouts p_k >= 0: a convex set
dynamics with the rounds fixed, liquidity is linear in the payouts; efficiency moves only with the rounds
path commitments floors on liquidity after each round and at each year end: linear inequalities
admissible decisions capability of at least 55 at a round: a condition on the rounds alone
start and end $620m today; at least $470m at the end of year 6: a linear inequality
uncertainty none declared
objective six-year payout plus M years of year-6 savings: linear in the payouts
class: lumpy outside, linear inside, a mixed-integer program (Table 2.5: Chapter 4); here, 64 linear programs
lumpy: the schedules (1, 1, 0, 0, 0, 0) and (1, 1, 1, 0, 0, 0) are both feasible; their midpoint (1, 1, 0.5, 0, 0, 0) asks for half a round, which is no decision
convex inside: with rounds in years 1, 2 fixed, paying $505m all in year 6, or $100m in year 1 and the rest in year 6, keeps every commitment (True, True), and so does their midpoint (True)
a feedback rule: reinvest a share theta_k of what is held, x2 = (1 + theta_0)(1 + theta_1) <= 2: (1, 0) gives 2.00, (0, 1) gives 2.00, their midpoint 2.25; written as amounts, u0 + u1 <= 1, the set is convex
all 64 linear programs agree with the closed form, payouts = (no-payout liquidity at year 6) - 470: largest gap $0.0e+00m
The instance in standard form, rounds in years 1, 2 (emitted: minimize; inequalities <=; Lagrange form)
minimize -(p1 + p2 + p3 + p4 + p5 + p6) the six-year payout, maximized as its negative ($ million)
subject to
p1 <= 220.00 floor at the end of year 1
p1 <= 100.00 floor at the round-2 start
p1 + p2 <= 205.00 floor at the end of year 2
p1 + p2 + p3 <= 310.00 floor at the end of year 3
p1 + p2 + p3 + p4 <= 415.00 floor at the end of year 4
p1 + p2 + p3 + p4 + p5 <= 520.00 floor at the end of year 5
p1 + p2 + p3 + p4 + p5 + p6 <= 625.00 floor at the end of year 6
p1 + p2 + p3 + p4 + p5 + p6 <= 505.00 end condition
p1, ..., p6 >= 0
solution: paid out $505.00m; payouts by year 0, 0, 0, 0, 0, 505
price of the end condition: 1.000 of payout per $1 million
the end condition written in $ billion: price 1,000 per $1 billion; payout $505.00m, unchanged (Example 2.B.1)

Panel 7 — One commitment, four quantifiers (Section 2.4; Table 2.4; Proposition 2.3: 24.6 percent, $1.65 million, $10.44 million)
The board's wish that liquidity stay above $350 million during the digital program, on Volume I's Chapter 8 model: the plan's liquidity dips to its low point in the seventh quarter; execution and market deviations follow with of standard deviation $50 million a quarter; funding windows close 0.10 a year, each removing a gamma-distributed amount (mean $120 million, standard deviation $50 million) that is never recovered. Two levers from Volume I, Worked Example 15.1: a standby line , costing in fees, and quarters of delay, $8 million each, which make the plan's trough index points deep. True odds are counted on the book's 100,000 paths, drawn exactly as Volume I draws them (seed 8). The same sentence costs nothing on the average path, $1.65 million in Volume I's stress set, $10.44 million at 95 percent, and cannot be bought on every path. The last lines price the board's appetite, as Theorem 2.4(iii) promises a certified instance, and redraw the paths with the lab's seed: the odds are estimates, with error bars (Proposition 2.2).
Python Code
N, Q = 100_000, 12
LIQ0 = 620.0
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, DEPTH_PER_Q = 28.0, 4.0 # the plan's trough (index points); a quarter of delay: 4 points shallower
FEE, VQ, APPETITE = 0.03, 8.0, 0.05 # line fees over the program; a quarter of delay ($m); the board's appetite
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)
def plan(depth, t): # planned liquidity ($m); index 100 = $620 million today
return 6.2 * (relax(100, 112, 0.35, t) - trough(depth, 2.0, t))
TQ = np.arange(1, Q + 1) / 4
BASE, SHAPE = plan(0.0, TQ), 6.2 * trough(1.0, 2.0, TQ)
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
rng = np.random.default_rng(seed)
E, e, closures = np.empty((n, Q)), np.zeros(n), []
for k in range(Q):
w = 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 = A_E * e + w
E[:, k] = e
return E, closures
class Paths:
# A line l replaces up to l of each closure; phi quarters of delay make the trough 28 - 4 phi deep. A path
# breaches the floor exactly when the trough is deeper than its critical depth, so every package's odds are
# exact counts on the same paths.
def __init__(self, seed):
self.E, self.closures = draw_paths(seed)
self.memo = {}
def lost(self, line):
out, cum = np.empty((N, Q)), np.zeros(N)
for k, (path, size) in enumerate(self.closures):
cum += np.bincount(path, np.maximum(size - line, 0.0), N)
out[:, k] = cum
return out
def critical(self, line):
key = round(float(line), 6)
if key not in self.memo:
self.memo[key] = np.sort(((BASE + self.E - self.lost(line) - FLOOR) / SHAPE).min(axis=1))
return self.memo[key]
def odds(self, line, phi):
return np.searchsorted(self.critical(line), DEPTH0 - DEPTH_PER_Q * phi) / N
def delay_for(self, line, p):
d = min(DEPTH0, self.critical(line)[int(np.floor(p * N))])
return np.nan if d < 0 else (DEPTH0 - d) / DEPTH_PER_Q
def liquidity(self, line=0.0, phi=0.0):
return BASE - (DEPTH0 - DEPTH_PER_Q * phi) * SHAPE + self.E - self.lost(line)
def cost(line, phi):
return FEE * line + VQ * phi
LINES = np.arange(0.0, 400.0 + 1e-9, 5.0) # Volume I's grid of lines
def cheapest(paths, p):
# the cheapest package meeting breach odds of at most p: on each line, the least delay that meets it
best = None
for l in LINES:
phi = paths.delay_for(l, p)
if not np.isnan(phi) and (best is None or cost(l, phi) < best[2]):
best = (l, phi, cost(l, phi))
return best
B = Paths(BOOK_SEED)
L0 = B.liquidity()
MEAN_TROUGH = min(LIQ0, L0.mean(axis=0).min())
P_MEAN = B.odds(0.0, 0.0)
P90 = stats.gamma.ppf(0.9, (J_MEAN / J_SD) ** 2, scale=J_SD ** 2 / J_MEAN)
DRAW = LIQ0 - plan(DEPTH0, np.arange(Q + 1) / 4).min()
L_ROB = max(P90 - (LIQ0 - FLOOR - DRAW), 0.0)
P_ROB = B.odds(L_ROB, 0.0)
L_95, PHI_95, C_95 = cheapest(B, APPETITE)
P_95 = B.odds(L_95, PHI_95)
EVERY = {(l, phi): B.odds(l, phi) for l in (400.0, 1000.0) for phi in (6.0, 7.0)}
P_EVERY = min(EVERY.values())
print("Table 2.4: the board's liquidity floor, four quantifiers (100,000 paths, seed 8)")
print(f"{'declared as':36s}{'cheapest package':42s}{'cost ($m)':>10s}{'true odds':>11s}")
print(f"{'on the average path':36s}{'no lever: the mean path bottoms at $%.0fm' % MEAN_TROUGH:42s}{0:10.2f}{100 * P_MEAN:10.1f}%")
print(f"{'in every scenario of a stress set':36s}{'a $%.1fm standby line' % L_ROB:42s}{cost(L_ROB, 0):10.2f}{100 * P_ROB:10.1f}%")
print(f"{'with probability at least 95%':36s}{'a $%.0fm line and %.2f quarters of delay' % (L_95, PHI_95):42s}{C_95:10.2f}{100 * P_95:10.1f}%")
print(f"{'on every path':36s}{'none: the odds never fall below %.3f%%' % (100 * P_EVERY):42s}{'--':>10s}{'--':>11s}")
print(f"\nstress set (Volume I's joint check): the program's deepest draw {DRAW:.1f} + a 90th-percentile closure "
f"{P90:.1f} - the line <= {LIQ0 - FLOOR:.0f} above the floor -> line >= {L_ROB:.1f}")
print(f"95 percent: {PHI_95:.3f} quarters is {3 * PHI_95:.1f} months of delay; fees {FEE * L_95:.2f} + delay {VQ * PHI_95:.2f}")
print("every path: the odds of the strongest packages tried:",
"; ".join(f"line ${l:.0f}m, {phi:.0f} quarters: {100 * p:.3f}%" for (l, phi), p in EVERY.items()))
print(" execution swings are normal, so unbounded below: no line or delay keeps every path above the floor")
# Proposition 2.3(iv), the other direction (Online Appendix 2.B): x1 = w, w = 1 w.p. 0.96 and -30 w.p. 0.04
w_vals, w_prob = np.array([1.0, -30.0]), np.array([0.96, 0.04])
print(f"\nProposition 2.3(iv): x1 >= 0 holds with probability {w_prob[w_vals >= 0].sum():.2f} >= 0.95, yet on the "
f"average path E[x1] = {w_prob @ w_vals:.2f} it fails")
lo, hi = cheapest(B, 0.045), cheapest(B, 0.055)
PRICE = (lo[2] - hi[2]) / 1.0
print(f"\nthe price of the appetite (Theorem 2.4(iii)): the cheapest package costs ${lo[2]:.2f}m at 4.5% and "
f"${hi[2]:.2f}m at 5.5%,\n ${PRICE:.2f}m per percentage point of breach odds; a breach is implicitly priced at "
f"100 x {PRICE:.3f} = ${100 * PRICE:.1f}m")
F = Paths(SEED) # fresh paths: the same model, the lab's seed
se = lambda p: np.sqrt(p * (1 - p) / N)
PACKAGES = [("average path: no lever", 0.0, 0.0), ("stress set: the line", L_ROB, 0.0), ("95 percent", L_95, PHI_95)]
print(f"\npackage book's paths (seed 8) fresh paths (seed {SEED})")
for name, l, phi in PACKAGES:
pb, pf = B.odds(l, phi), F.odds(l, phi)
print(f"{name:30s}{100 * pb:10.2f}% +/- {196 * se(pb):.2f}{100 * pf:14.2f}% +/- {196 * se(pf):.2f}")
print(f"mean path's low point on fresh paths: ${min(LIQ0, F.liquidity().mean(axis=0).min()):.1f}m")
low = L0.min(axis=1)
shown = np.clip(low, 95.0, None) # the deepest paths are counted in the first bar
fig, ax = plt.subplots(figsize=(7.6, 3.6))
bins = np.arange(90, 650, 10)
ax.hist(shown[low >= FLOOR], bins=bins, color="#1F4E79", alpha=0.85, label="paths that keep the floor")
ax.hist(shown[low < FLOOR], bins=bins, color="#B71C1C", alpha=0.85, label=f"paths that breach it: {100 * P_MEAN:.1f}%")
ax.annotate(f"below \\$100m: {100 * (low < 100).mean():.1f}%", xy=(95, 900), xytext=(95, 1700), fontsize=8,
color="#B71C1C", ha="center", arrowprops=dict(arrowstyle="-", color="#B71C1C", lw=0.7))
ax.axvline(FLOOR, color="#616161", lw=1)
ax.axvline(MEAN_TROUGH, color="#E65100", lw=1.6, ls="--")
ax.text(MEAN_TROUGH + 4, ax.get_ylim()[1] * 0.92, f"the average path's low point, \\${MEAN_TROUGH:.0f}m",
color="#E65100", fontsize=8, va="top")
ax.text(FLOOR - 4, ax.get_ylim()[1] * 0.92, "floor \\$350m", color="#616161", fontsize=8, ha="right", va="top")
ax.set(xlabel="each path's lowest liquidity over the program (\\$ million)", ylabel="paths (of 100,000)",
title="The average path never breaches; a quarter of the paths do (seed 26202)")
ax.legend(frameon=False, fontsize=8, loc="upper left")
plt.tight_layout(); plt.show()Table 2.4: the board's liquidity floor, four quantifiers (100,000 paths, seed 8) declared as cheapest package cost ($m) true odds on the average path no lever: the mean path bottoms at $460m 0.00 24.6% in every scenario of a stress set a $54.9m standby line 1.65 17.4% with probability at least 95% a $170m line and 0.67 quarters of delay 10.44 5.0% on every path none: the odds never fall below 0.001% -- -- stress set (Volume I's joint check): the program's deepest draw 138.0 + a 90th-percentile closure 186.9 - the line <= 270 above the floor -> line >= 54.9 95 percent: 0.668 quarters is 2.0 months of delay; fees 5.10 + delay 5.34 every path: the odds of the strongest packages tried: line $400m, 6 quarters: 0.001%; line $400m, 7 quarters: 0.001%; line $1000m, 6 quarters: 0.001%; line $1000m, 7 quarters: 0.001% execution swings are normal, so unbounded below: no line or delay keeps every path above the floor Proposition 2.3(iv): x1 >= 0 holds with probability 0.96 >= 0.95, yet on the average path E[x1] = -0.24 it fails the price of the appetite (Theorem 2.4(iii)): the cheapest package costs $11.39m at 4.5% and $9.58m at 5.5%, $1.81m per percentage point of breach odds; a breach is implicitly priced at 100 x 1.807 = $180.7m package book's paths (seed 8) fresh paths (seed 26202) average path: no lever 24.62% +/- 0.27 24.57% +/- 0.27 stress set: the line 17.40% +/- 0.23 17.48% +/- 0.24 95 percent 5.00% +/- 0.14 5.09% +/- 0.14 mean path's low point on fresh paths: $459.7m

On the book's paths the 95 percent package meets the appetite exactly, because it was chosen on them. On 100,000 fresh paths drawn with the lab's seed it breaches 5.09 percent of the time, within sampling error of 5 (a package chosen on the paths that certify it tends to look a little better on them than on fresh ones); the other two packages move by less than a tenth of a point, and the average path's low point barely moves, to $459.7 million. The lesson of Table 2.4 does not hang on the draw: the average path never breaches while a quarter of the paths do, and Volume I's stress set, narrower than the uncertainty, leaves the odds near 17 percent.
Validation — the book's numbers, and agreement with DCT_V2_Ch02_Lab.xlsx
Each checkpoint is a number printed in Chapter 2 (Worked Example 2.1, Tables 2.4 and 2.7, Figure 2.3, Section 2.6,
LOS Guidance) or in Online Appendix 2.B (Example 2.B.4 and the proof of Proposition 2.3). Sets of commitments are
checked as sums of codes (floor 1, capability 2, six rounds 4, half payout 8, end condition 16) and schedules by the
years of their rounds written as digits (years 1, 2 and 4 as 124). Where the book rounds, the tolerance is half a
unit in its last printed place. The workbook recomputes the ones marked workbook with Excel formulas and shows
PASS against the same engine values on its Checks sheet.
Python Code
CODE = {"floor": 1, "capability": 2, "six rounds": 4, "half payout": 8, "end condition": 16}
code_of = lambda S: sum(CODE[c] for c in S)
digits = lambda z: int("".join(str(k + 1) for k in range(K) if z[k]))
half = lambda d: 0.5 * 10.0 ** -d + 1e-9 # half a unit in the book's last printed place
z0, pay0, _, _ = optimizer(0.0)
z10, pay10, _, _ = optimizer(10.0)
th = {n0: m for n0, n1, m in SWITCH}
checks = [
("six-round savings in the CFO's spreadsheet, $m (workbook)", SAV6, 702, half(0)),
("three-round plan's savings, $m (workbook)", SAV3, 647.5, half(1)),
("spreadsheet overstates them by, $m (workbook)", SAV6 - SAV3, 55, half(0)),
("joint plan: liquidity at the end of year 1 (workbook)", JOINT[1], 535.0, 1e-9),
("joint plan: liquidity at the end of year 2 (workbook)", JOINT[2], 467.5, 1e-9),
("joint plan: liquidity after paying for round 3 (workbook)", AFTER3, 347.5, 1e-9),
("joint plan dies in year (workbook)", DIES, 3, 0),
("first empty reachable set, year (Theorem 2.3(iii))", DEATH, 3, 0),
("deletion filter: feasibility checks per pass", len(BOARD_FIRST), 5, 0),
("clash, board first: floor + six + half (workbook)", code_of(CLASH["the board's conditions first"]), 13, 0),
("clash, pledges first: six + half + end (workbook)", code_of(CLASH["the pledges first"]), 28, 0),
("minimal infeasible sets (workbook)", len(MIS), 2, 0),
("feasible with the floor alone dropped (workbook)", int(FLOOR_ALONE), 0, 0),
("no floor: liquidity at the end of year 6, $m", rows_c[-1]["q"], 251, half(0)),
("(a) largest payout share, % (workbook)", 100 * S_A, 18.83, half(2)),
("(a) round-6 start alone allows, % (workbook)", 100 * S_A6, 20.27, half(2)),
("(a) paid out, $m (workbook)", PAY_A, 132.2, half(1)),
("(a) efficiency in year 6 (workbook)", rows_a[-1]["eff"], 84.78, half(2)),
("(a) liquidity at the end of year 6, $m (workbook)", rows_a[-1]["q"], 470.0, half(1)),
("(a) paid out in year 1, $m (workbook)", rows_a[0]["pay"], 13.2, half(1)),
("(a) liquidity at the end of year 4, $m (workbook)", rows_a[3]["q"], 488.0, half(1)),
("(b) years of the rounds (workbook)", digits(Z_B), 124, 0),
("(b) paid out, $m (workbook)", PAY_B, 323.8, half(1)),
("(b) efficiency in year 6 (workbook)", rows_b[-1]["eff"], 83.25, half(2)),
("(b) liquidity at the end of year 6, $m (workbook)", rows_b[-1]["q"], 583.8, half(1)),
("(b) liquidity at the end of year 4, $m (workbook)", rows_b[3]["q"], 461.3, half(1)),
("(b) a round in year 6 would end at, $m (workbook)", simulate((1, 1, 0, 1, 0, 1), HALF)[0][-1]["q"], 468.1, half(1)),
("(c) paid out, $m (workbook)", PAY_C, 351.1, half(1)),
("(c) lowest liquidity after a round, $m (workbook)", LOW_C, 182.2, half(1)),
("(c) liquidity at the end of year 3, $m (workbook)", rows_c[2]["q"], 408.8, half(1)),
("(c) liquidity at the end of year 6, $m (workbook)", rows_c[-1]["q"], 251.1, half(1)),
("optimizer, no credit: years of the rounds (workbook)", digits(z0), 12, 0),
("optimizer, no credit: paid out, $m (workbook)", pay0, 505.0, half(1)),
("optimizer, ten years' credit: years of the rounds (workbook)", digits(z10), 123, 0),
("optimizer, ten years' credit: paid out, $m (workbook)", pay10, 455.0, half(1)),
("rounds 3 to 6: savings inside the window, $m (workbook)", inside, 107, half(0)),
("six early rounds: payouts + year-6 liquidity, $m (workbook)", NET[6], 602.2, half(1)),
("credit for a third round, years (workbook)", th[2], 2.86, half(2)),
("credit for a fourth round, years (workbook)", th[3], 10.71, half(2)),
("credit for a fifth round, years (workbook)", th[4], 25.43, half(2)),
("credit for the sixth round, years (workbook)", th[5], 53.86, half(2)),
("Mayer form: plans that change", CHANGED, 0, 0),
("schedules, each a linear program (workbook)", len(OK), 64, 0),
("average path: true odds, % (Table 2.4)", 100 * P_MEAN, 24.6, half(1)),
("stress set: standby line, $m (workbook)", L_ROB, 55, half(0)),
("stress set: cost, $m (workbook)", cost(L_ROB, 0.0), 1.65, half(2)),
("stress set: true odds, % (Table 2.4)", 100 * P_ROB, 17.4, half(1)),
("95 percent: line, $m (workbook)", L_95, 170, 0),
("95 percent: delay, months (workbook)", 3 * PHI_95, 2, half(0)),
("95 percent: cost, $m (workbook)", C_95, 10.44, half(2)),
("95 percent: true odds, % (Table 2.4)", 100 * P_95, 5.0, half(1)),
("every path: lowest odds found, %", 100 * P_EVERY, 0.001, half(3)),
("price of the appetite, $m per point (workbook)", PRICE, 1.8, half(1)),
("implied cost of a breach, $m (workbook)", 100 * PRICE, 180, 1.0),
("Proposition 2.3(iv): average of x1 (workbook)", w_prob @ w_vals, -0.24, 1e-9),
]
ok = 0
for name, got, want, tol in checks:
status = "PASS" if abs(got - want) <= tol else "FAIL"
ok += status == "PASS"
print(f"{name:62s} {got:11.4f} book {want:9.4f} {status}")
print(f"\n{ok} of {len(checks)} checkpoints PASS")six-round savings in the CFO's spreadsheet, $m (workbook) 702.1875 book 702.0000 PASS three-round plan's savings, $m (workbook) 647.5000 book 647.5000 PASS spreadsheet overstates them by, $m (workbook) 54.6875 book 55.0000 PASS joint plan: liquidity at the end of year 1 (workbook) 535.0000 book 535.0000 PASS joint plan: liquidity at the end of year 2 (workbook) 467.5000 book 467.5000 PASS joint plan: liquidity after paying for round 3 (workbook) 347.5000 book 347.5000 PASS joint plan dies in year (workbook) 3.0000 book 3.0000 PASS first empty reachable set, year (Theorem 2.3(iii)) 3.0000 book 3.0000 PASS deletion filter: feasibility checks per pass 5.0000 book 5.0000 PASS clash, board first: floor + six + half (workbook) 13.0000 book 13.0000 PASS clash, pledges first: six + half + end (workbook) 28.0000 book 28.0000 PASS minimal infeasible sets (workbook) 2.0000 book 2.0000 PASS feasible with the floor alone dropped (workbook) 0.0000 book 0.0000 PASS no floor: liquidity at the end of year 6, $m 251.0938 book 251.0000 PASS (a) largest payout share, % (workbook) 18.8251 book 18.8300 PASS (a) round-6 start alone allows, % (workbook) 20.2658 book 20.2700 PASS (a) paid out, $m (workbook) 132.1875 book 132.2000 PASS (a) efficiency in year 6 (workbook) 84.7812 book 84.7800 PASS (a) liquidity at the end of year 6, $m (workbook) 470.0000 book 470.0000 PASS (a) paid out in year 1, $m (workbook) 13.1776 book 13.2000 PASS (a) liquidity at the end of year 4, $m (workbook) 488.0374 book 488.0000 PASS (b) years of the rounds (workbook) 124.0000 book 124.0000 PASS (b) paid out, $m (workbook) 323.7500 book 323.8000 PASS (b) efficiency in year 6 (workbook) 83.2500 book 83.2500 PASS (b) liquidity at the end of year 6, $m (workbook) 583.7500 book 583.8000 PASS (b) liquidity at the end of year 4, $m (workbook) 461.2500 book 461.3000 PASS (b) a round in year 6 would end at, $m (workbook) 468.1250 book 468.1000 PASS (c) paid out, $m (workbook) 351.0938 book 351.1000 PASS (c) lowest liquidity after a round, $m (workbook) 182.1875 book 182.2000 PASS (c) liquidity at the end of year 3, $m (workbook) 408.7500 book 408.8000 PASS (c) liquidity at the end of year 6, $m (workbook) 251.0938 book 251.1000 PASS optimizer, no credit: years of the rounds (workbook) 12.0000 book 12.0000 PASS optimizer, no credit: paid out, $m (workbook) 505.0000 book 505.0000 PASS optimizer, ten years' credit: years of the rounds (workbook) 123.0000 book 123.0000 PASS optimizer, ten years' credit: paid out, $m (workbook) 455.0000 book 455.0000 PASS rounds 3 to 6: savings inside the window, $m (workbook) 107.1875 book 107.0000 PASS six early rounds: payouts + year-6 liquidity, $m (workbook) 602.1875 book 602.2000 PASS credit for a third round, years (workbook) 2.8571 book 2.8600 PASS credit for a fourth round, years (workbook) 10.7143 book 10.7100 PASS credit for a fifth round, years (workbook) 25.4286 book 25.4300 PASS credit for the sixth round, years (workbook) 53.8571 book 53.8600 PASS Mayer form: plans that change 0.0000 book 0.0000 PASS schedules, each a linear program (workbook) 64.0000 book 64.0000 PASS average path: true odds, % (Table 2.4) 24.6220 book 24.6000 PASS stress set: standby line, $m (workbook) 54.9166 book 55.0000 PASS stress set: cost, $m (workbook) 1.6475 book 1.6500 PASS stress set: true odds, % (Table 2.4) 17.4030 book 17.4000 PASS 95 percent: line, $m (workbook) 170.0000 book 170.0000 PASS 95 percent: delay, months (workbook) 2.0027 book 2.0000 PASS 95 percent: cost, $m (workbook) 10.4406 book 10.4400 PASS 95 percent: true odds, % (Table 2.4) 5.0000 book 5.0000 PASS every path: lowest odds found, % 0.0010 book 0.0010 PASS price of the appetite, $m per point (workbook) 1.8070 book 1.8000 PASS implied cost of a breach, $m (workbook) 180.7015 book 180.0000 PASS Proposition 2.3(iv): average of x1 (workbook) -0.2400 book -0.2400 PASS 55 of 55 checkpoints PASS
Next. Chapter 3 takes the instances whose convexity ledger is clean: local answers are global, and the answer arrives with prices a reviewer can check. Its Worked Example relaxes this automation program, prices each year's round, and proves the three-round plan within $7.1 million of anything achievable without enumerating a single schedule. AXIOM-02 runs this lab interactively (Lab 2.2); this notebook and the workbook are its reproducible record.


