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

policydaypointsH-outH-leftF-leftcrit-on-H
arrivalbusy x1.2887.440394
fixedbusy x1.21006.81323713
LP planbusy x1.21031.02003220
LP re-planbusy x1.21043.2none62724
arrivalquiet x0.6482.0805515
fixedquiet x0.6579.0none4854012
LP planquiet x0.6561.0none12851612
LP re-planquiet x0.6581.422055612
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