What does Weekly Quotas for Business Lines conclude, in numbers, about “From Choosing a Line to Splitting a Budget: Five Weekly Quota Rules under Batched Feedback”?

Answer: Chapter 4 compares five weekly quota rules; the quota rule, in which the leader takes the bulk and every line whose index beats the leader's mean receives one trial unit, earns 0.9042 of the ideal, against 0.8370 for the last-week rule.

Scope of the numbers: Parameters are illustrative, and margins and costs are accounting points, not prices; all calculations are generated by the book's programs. It is not individual business advice, and changes to budgets or live systems need sign-off by the person in charge.

中文版

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: 0.8370, 0.9042

4 lines ~ Beta(2, 6), 10 units/week, 26 weeks, 1000 runs
ruledisc-succvs-oracleend-on-best
lastweek69.6380.83700.5400
greedy74.8090.89920.7210
index74.6980.89790.7820
quota75.2220.90420.7850
thompson72.1550.86730.8280
oracle83.196
Show the full program
# Chapter 4. p41: five weekly quota rules for one budget split by line.
# Model: 4 lines with true unit conversion rates drawn from Beta(2, 6)
# (illustrative, mean 0.25); K = 10 budget units a week; results known
# only at week end; 26 weeks; weekly discount 0.98. Week 1 probes all
# lines (3, 3, 2, 2 units). Every rule starts from a Beta(1, 1) prior.
#   lastweek : all units to the best rate of each line's latest week
#   greedy   : all units to the highest posterior mean
#   index    : all units to the highest Gittins index (beta 0.9)
#   quota    : one unit to each line whose index beats the leader's
#              posterior mean, the rest to the highest index
#   thompson : each unit goes to the argmax of a fresh posterior draw
# Gittins index by calibration (p21), depth 20 (error < 1e-4, p23).
import functools
import math
import random

N, K, W, RUNS, DISC = 4, 10, 26, 1000, 0.98


@functools.lru_cache(maxsize=None)
def gittins(a, b, beta=0.9, depth=20, tol=1e-6):
    lo, hi = a / (a + b), 1.0
    while hi - lo > tol:
        lam = 0.5 * (lo + hi)
        r = lam / (1.0 - beta)
        n = a + b + depth
        v = [max(r, (a + k) / n / (1.0 - beta)) for k in range(depth + 1)]
        for d in range(depth - 1, -1, -1):
            n = a + b + d
            nv = []
            for k in range(d + 1):
                p = (a + k) / n
                c = math.fsum((p * (1.0 + beta * v[k + 1]),
                               (1.0 - p) * beta * v[k]))
                nv.append(c if c > r else r)
            v = nv
        if v[0] > r + 1e-12:
            lo = lam
        else:
            hi = lam
    return 0.5 * (lo + hi)


def top(score):
    return max(range(len(score)), key=lambda j: (score[j], -j))


def quota(rule, s, f, last, rng):
    q = [0] * N
    mean = [(1 + s[i]) / (2 + s[i] + f[i]) for i in range(N)]
    if rule == "lastweek":
        q[top(last)] = K
    elif rule == "greedy":
        q[top(mean)] = K
    elif rule in ("index", "quota"):
        nu = [gittins(1 + s[i], 1 + f[i]) for i in range(N)]
        lead = top(nu)
        if rule == "quota":
            bar = mean[top(mean)]
            for i in range(N):
                if i != lead and nu[i] > bar:
                    q[i] = 1
        q[lead] = K - (q[0] + q[1] + q[2] + q[3])
    else:
        for _ in range(K):
            d = [rng.betavariate(1 + s[i], 1 + f[i]) for i in range(N)]
            q[top(d)] += 1
    return q


def run(rule, p, u, rng):
    s, f, last = [0] * N, [0] * N, [0.0] * N
    terms = []
    for w in range(W):
        q = [3, 3, 2, 2] if w == 0 else quota(rule, s, f, last, rng)
        got = 0
        for i in range(N):
            k = 0
            for _ in range(q[i]):
                if u[i][s[i] + f[i]] < p[i]:
                    s[i] += 1
                    k += 1
                else:
                    f[i] += 1
            if q[i]:
                last[i] = k / q[i]
            got += k
        terms.append(got * DISC ** w)
    return math.fsum(terms), q[top(p)] == max(q)


world = random.Random(20261113)
cases = []
for _ in range(RUNS):
    p = [world.betavariate(2, 6) for _ in range(N)]
    u = [[world.random() for _ in range(K * W)] for _ in range(N)]
    cases.append((p, u))
orc = [K * max(p) * math.fsum(DISC ** w for w in range(W))
       for p, _ in cases]
print("%d lines ~ Beta(2, 6), %d units/week, %d weeks, %d runs"
      % (N, K, W, RUNS))
print("%-9s %10s %10s %12s" % ("rule", "disc-succ", "vs-oracle",
                               "end-on-best"))
for rule in ("lastweek", "greedy", "index", "quota", "thompson"):
    rng = random.Random(99)
    res = [run(rule, p, u, rng) for p, u in cases]
    m = math.fsum(r for r, _ in res) / RUNS
    ok = 0
    for _, b in res:
        ok += b
    print("%-9s %10.3f %10.4f %12.4f" % (
        rule, m, m / (math.fsum(orc) / RUNS), ok / RUNS))
print("oracle    %10.3f" % (math.fsum(orc) / RUNS))

Single source and citation

Fan, Y. (2026). Dynamic Allocation of Compute and Budget across Business Lines: Gittins-Index Exploration and Weekly Quotas for Tollbooth, Buying and Publishing Lines (Version 1.0.0), Chapter 4: From Choosing a Line to Splitting a Budget: Five Weekly Quota Rules under Batched Feedback. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-264 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026264,
  author    = {Fan, Yafu},
  title     = {Dynamic Allocation of Compute and Budget across Business Lines: Gittins-Index Exploration and Weekly Quotas for Tollbooth, Buying and Publishing Lines},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book