What does Weekly Quotas for Business Lines conclude, in numbers, about “Closing the Loop: the Weekly Quota Meeting Table, the Business-Line Quota Indexer and a Pre-Registered Test”?

Answer: Chapter 8 gives the weekly quota meeting table, the Business-Line Quota Indexer and a pre-registered protocol (250 cells per group, 162 after adjusting for the run-in). Marked boxes separate published evidence, runnable Python calculations (19 programs), classical sources and the author's hypotheses.

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: 162, 250

paired pilot, 600 cells: d = 9.687, its s.e. 0.781
run-in slope t = 5.522 (26-week wins per run-in win)
outcomelastweekquotadsn/armpower
raw y89.69799.3839.68738.6182500.810
y - t x32.07941.7669.68731.0341620.790
Show the full program
# Chapter 8. p82: how many cells a pre-registered quota trial needs.
# Design: independent cells (cities, shops or product groups), each with
# 3 lines whose unit rates are drawn from Beta(2, 6) (illustrative);
# 10 units a week for 26 weeks; cells randomised to the last-week rule
# or to the index-quota rule of p81 (equal margins, zero unit cost).
# A 4-week run-in splits units 4/3/3 in every cell; its wins x are a
# baseline. Outcome y = wins in the 26 trial weeks. Pilot: 600 cells,
# each simulated under both rules with the same rates and random stream
# (paired, so d is sharp); s = spread of y across cells, also for the
# adjusted outcome y - t x (t = pooled regression slope, as in ANCOVA);
#   n per arm = 2 (z_0.975 + z_0.80)^2 s^2 / d^2,
# and the power of that n is checked by resampling the pilot cells.
import functools
import math
import random
import statistics

N, K, W = 3, 10, 26


@functools.lru_cache(maxsize=None)
def gittins(a, b, beta, 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 cell(rule, p, rng):
    s, f, last = [0] * N, [0] * N, [0.0] * N
    total, base = 0, 0
    for w in range(W + 4):
        q = [4, 3, 3]
        if w >= 4 and rule == "lastweek":
            q = [0] * N
            q[max(range(N), key=lambda j: (last[j], -j))] = K
        elif w >= 4:
            nu = [gittins(1 + s[i], 1 + f[i], 0.9) for i in range(N)]
            mu = [(1 + s[i]) / (2 + s[i] + f[i]) for i in range(N)]
            lead = max(range(N), key=lambda j: (nu[j], -j))
            q = [1 if i != lead and nu[i] > mu[lead] else 0
                 for i in range(N)]
            q[lead] = K - (q[0] + q[1] + q[2])
        for i in range(N):
            k = 0
            for _ in range(q[i]):
                if rng.random() < p[i]:
                    k += 1
            s[i] += k
            f[i] += q[i] - k
            if q[i]:
                last[i] = k / q[i]
            if w < 4:
                base += k
            else:
                total += k
    return total, base


def plan(ys):
    m = {r: statistics.fmean(v) for r, v in ys.items()}
    sd = math.sqrt((statistics.variance(ys["lastweek"])
                    + statistics.variance(ys["quota"])) / 2)
    d = m["quota"] - m["lastweek"]
    z = statistics.NormalDist()
    n = math.ceil(2 * (z.inv_cdf(0.975) + z.inv_cdf(0.80)) ** 2
                  * sd ** 2 / d ** 2)
    hits = 0
    for _ in range(1000):
        a = [rng.choice(ys["lastweek"]) for _ in range(n)]
        b = [rng.choice(ys["quota"]) for _ in range(n)]
        se = math.sqrt((statistics.variance(a)
                        + statistics.variance(b)) / n)
        if (statistics.fmean(b) - statistics.fmean(a)) / se > 1.959964:
            hits += 1
    return m, d, sd, n, hits / 1000


rng = random.Random(20261113)
pilot = {"lastweek": [], "quota": []}
for _ in range(600):
    p = [rng.betavariate(2, 6) for _ in range(N)]
    seed = rng.randrange(10 ** 9)
    for r in pilot:
        pilot[r].append(cell(r, p, random.Random(seed)))
diff = [q[0] - l[0] for q, l in zip(pilot["quota"], pilot["lastweek"])]
print("paired pilot, 600 cells: d = %.3f, its s.e. %.3f" % (
    statistics.fmean(diff), statistics.stdev(diff) / math.sqrt(600)))
xs = [x for r in pilot for _, x in pilot[r]]
yv = [y for r in pilot for y, _ in pilot[r]]
t = statistics.covariance(xs, yv) / statistics.variance(xs)
print("run-in slope t = %.3f (26-week wins per run-in win)" % t)
print("%-9s %9s %9s %8s %8s %7s %7s" % ("outcome", "lastweek", "quota",
                                        "d", "s", "n/arm", "power"))
for label, adj in (("raw y", 0.0), ("y - t x", t)):
    ys = {r: [y - adj * x for y, x in pilot[r]] for r in pilot}
    m, d, sd, n, pw = plan(ys)
    print("%-9s %9.3f %9.3f %8.3f %8.3f %7d %7.3f" % (
        label, m["lastweek"], m["quota"], d, sd, n, pw))

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 8: Closing the Loop: the Weekly Quota Meeting Table, the Business-Line Quota Indexer and a Pre-Registered Test. 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