What does Routing Periodic Quotas conclude, in numbers, about “The Price of First Come, First Served: Exhaustion before the Reset and Waste at It”?
Answer: On the quiet day the picture reverses. Arrival order again exhausts H, this time by slot 8, because it spends H on a mass of routine work; only 5 of the 12 critical tasks get H, and output is 482.0 points. The fixed rule misses no critical task but leaves 48 H units to vanish at the reset. The third row is the instructive one: the plan built on the standing forecast leaves 128 units unused on the quiet day and yields 561.0 points, less than the fixed rule's 579.0. The fault is not the linear programme but the forecast it was fed. The plan reserves H for the usual number of complex tasks; on a quiet day fewer of them arrive, and the reserved units sit idle until the reset. Re-solved on the day's demand, the programme yields 581.4 points and leaves no H unit behind.
Scope of the numbers: Under illustrative parameters the linear programme gains 0.1668 to 0.2217 over arrival order, but only 0.41 % to 5.05 % over a fixed rule that sorts by complexity; most of the gain comes from sorting itself. Parameters are illustrative and contain no vendor's prices or quotas; all calculations are generated by the book's programs.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 12, 128, 48, 482.0, 561.0, 579.0
| policy | day | points | H-out | H-left | F-left | crit-on-H |
|---|---|---|---|---|---|---|
| arrival | busy x1.2 | 887.4 | 4 | 0 | 39 | 4 |
| fixed | busy x1.2 | 1006.8 | 13 | 2 | 37 | 13 |
| LP plan | busy x1.2 | 1031.0 | 20 | 0 | 32 | 20 |
| LP re-plan | busy x1.2 | 1043.2 | none | 6 | 27 | 24 |
| arrival | quiet x0.6 | 482.0 | 8 | 0 | 551 | 5 |
| fixed | quiet x0.6 | 579.0 | none | 48 | 540 | 12 |
| LP plan | quiet x0.6 | 561.0 | none | 128 | 516 | 12 |
| LP re-plan | quiet x0.6 | 581.4 | 22 | 0 | 556 | 12 |
Show the full program
# Chapter 1. p11: spending a periodic quota in arrival order, one cycle.
# Model: one reset cycle of 24 slots; tasks of four classes arrive in a
# seeded random order. Two tiers: H (heavy reasoning, quota 600 units)
# and F (fast, quota 900 units). Four policies:
# arrival - H while H quota lasts, then F (first come, first served)
# fixed - complex and critical to H, the rest to F; when the
# assigned tier is empty the task falls back to the other
# LP plan - per-class H counts from the p21 linear programme on the
# standing forecast (300, 150, 60, 20); the rest to F
# LP re-plan - the same programme solved on the day's own demand
# Output is in expected output points (value times success share).
# All quotas, costs and shares are illustrative, not vendor figures.
# Published analogue of waste at reset: in the last week of the fiscal
# year, federal procurement ran at 4.9 times the weekly mean (Liebman
# and Mahoney 2017); the chapter text cites it.
import math
import random
from fractions import Fraction as Fr
def simplex(c, A, b, rule="bland", cap=500):
m, n = len(A), len(c)
T = [[Fr(v) for v in A[i]] + [Fr(int(i == j)) for j in range(m)]
+ [Fr(b[i])] for i in range(m)]
z = [-Fr(v) for v in c] + [Fr(0)] * (m + 1)
basis = [n + i for i in range(m)]
steps = 0
while steps < cap:
cols = [j for j in range(n + m) if z[j] < 0]
if not cols:
break
if rule == "bland":
e = cols[0]
else:
e = min(cols, key=lambda j: (z[j], j))
rows = [i for i in range(m) if T[i][e] > 0]
if not rows:
return None
r = min(rows, key=lambda i: (T[i][-1] / T[i][e], basis[i]))
p = T[r][e]
T[r] = [v / p for v in T[r]]
for i in range(m):
if i != r and T[i][e] != 0:
f = T[i][e]
T[i] = [a - f * w for a, w in zip(T[i], T[r])]
f = z[e]
z = [a - f * w for a, w in zip(z, T[r])]
basis[r] = e
steps += 1
x = [Fr(0)] * (n + m)
for i, j in enumerate(basis):
x[j] = T[i][-1]
return x[:n], z[-1], z[n:n + m], steps
VALUE = (1, 2, 5, 10)
COST = {"H": (4, 6, 10, 16), "F": (1, 2, 3, 4)}
SUCC = {"H": (0.97, 0.95, 0.90, 0.85), "F": (0.95, 0.80, 0.45, 0.15)}
QUOTA = {"H": 600, "F": 900}
FORECAST = (300, 150, 60, 20)
def lp_plan(dem):
c = [VALUE[k] * Fr(str(SUCC[t][k])) for t in "HF" for k in range(4)]
A = [[COST["H"][k] if t == "H" else 0 for t in "HF" for k in range(4)],
[COST["F"][k] if t == "F" else 0 for t in "HF" for k in range(4)]]
b = [QUOTA["H"], QUOTA["F"]]
for k in range(4):
A.append([1 if j == k else 0 for t in "HF" for j in range(4)])
b.append(dem[k])
x = simplex(c, A, b)[0]
return [math.floor(x[k]) for k in range(4)]
def run(day, policy, rng):
tasks = [k for k in range(4) for _ in range(day[k])]
rng.shuffle(tasks)
left = dict(QUOTA)
plan = lp_plan(day if policy == "LP re-plan" else FORECAST)
pts, h_out, crit_h = [], None, 0
n = len(tasks)
for i, k in enumerate(tasks):
slot = i * 24 // n
if policy == "arrival":
order = "HF"
elif policy == "fixed":
order = "HF" if k >= 2 else "FH"
else:
order = "HF" if plan[k] > 0 else "F"
for t in order:
if left[t] >= COST[t][k]:
left[t] -= COST[t][k]
pts.append(VALUE[k] * SUCC[t][k])
if t == "H":
if policy.startswith("LP"):
plan[k] -= 1
if k == 3:
crit_h += 1
break
if h_out is None and left["H"] < 4:
h_out = slot
return math.fsum(pts), h_out, left["H"], left["F"], crit_h
DAYS = (("busy x1.2", (360, 180, 72, 24)),
("quiet x0.6", (180, 90, 36, 12)))
print("policy day points H-out H-left F-left crit-on-H")
for name, day in DAYS:
for policy in ("arrival", "fixed", "LP plan", "LP re-plan"):
rng = random.Random(20261113)
p, ho, lh, lf, ch = run(day, policy, rng)
hs = "none" if ho is None else "%d" % ho
print("%-10s %-10s %6.1f %5s %6d %6d %9d" % (
policy, name, p, hs, lh, lf, ch))Single source and citation
Fan, Y. (2026). Peak-Shaving Periodic Quotas and Cross-Model Routing: Linear Programming against Reset Countdowns to Split Work between Heavy-Reasoning and Fast Models (Version 1.0.0), Chapter 1: The Price of First Come, First Served: Exhaustion before the Reset and Waste at It. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-270 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026270,
author = {Fan, Yafu},
title = {Peak-Shaving Periodic Quotas and Cross-Model Routing: Linear Programming against Reset Countdowns to Split Work between Heavy-Reasoning and Fast Models},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 2 · A Standard-Library Simplex: Exact Fractions, Bland's Rule and the Worst Case
- Chapter 3 · Shadow Prices and the Reset Countdown: How the Marginal Value of Quota Falls with Time
- Chapter 4 · Routing across Models: Complexity Classes, Label Errors and Cascades
- Chapter 5 · Peak Shaving and Valley Filling: Deferral, Pulling Forward and a Backlog under Short Reset Windows
- Chapter 6 · Greedy against Linear Programming: Random Arrival, Prices Learned from a Sample, and Drift
- Chapter 7 · Eastern and Western Classics: Gathering and Releasing in the Guanzi, and Kantorovich's Resolving Multipliers
- Chapter 8 · A Daily Task Routing Table: the Empirical Loop, the Distilled Tool and a Pre-registered Test