What does Weekly Quotas for Business Lines conclude, in numbers, about “Lock-In: Why Betting Everything on Last Week's Winner Traps a Business on a Second-Best Line”?

Answer: Chapter 1 quantifies lock-in and shows that its cost grows with the horizon: over 500 periods greedy's regret per period stays at 0.0563 while Thompson sampling's falls to 0.0216.

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.0216, 0.0563, 500

NTgrd-wrongts-wrong grd-regretts-regret
2200.20950.17350.05060.0698
21000.18000.09400.02730.0266
25000.16670.04000.01870.0077
4200.41600.34900.10840.1603
41000.36200.15500.06990.0690
45000.33330.05670.05630.0216
Show the full program
# Chapter 1. p13: the longer the horizon, the more greedy lock-in costs.
# Model: N Bernoulli lines with rates drawn from Uniform(0, 1), one unit
# per period, undiscounted horizon T periods. Greedy plays the highest
# posterior mean under Beta(1, 1); Thompson plays the highest posterior
# draw. Wrong-line = the line played most often is not the best line.
# Regret per period = (T max p - successes) / T, averaged over runs.
# Common random numbers as in p12. Illustrative; fixed-seed Monte Carlo.
import math
import random


def play(rule, p, u, horizon, rng):
    n = len(p)
    s, f, pulls = [0] * n, [0] * n, [0] * n
    for _ in range(horizon):
        if rule == "greedy":
            sc = [(1 + s[i]) / (2 + s[i] + f[i]) for i in range(n)]
        else:
            sc = [rng.betavariate(1 + s[i], 1 + f[i]) for i in range(n)]
        i = max(range(n), key=lambda j: (sc[j], -j))
        pulls[i] += 1
        if u[i][s[i] + f[i]] < p[i]:
            s[i] += 1
        else:
            f[i] += 1
    top = max(range(n), key=lambda j: (pulls[j], -j))
    best = max(range(n), key=lambda j: (p[j], -j))
    hits = 0
    for x in s:
        hits += x
    return top != best, (horizon * p[best] - hits) / horizon


print("%3s %5s %10s %10s %10s %10s" % ("N", "T", "grd-wrong", "ts-wrong",
                                       "grd-regret", "ts-regret"))
for n in (2, 4):
    for horizon, runs in ((20, 2000), (100, 1000), (500, 300)):
        world = random.Random(20261113)
        rng = random.Random(11)
        wrong = {"greedy": 0, "thompson": 0}
        reg = {"greedy": [], "thompson": []}
        for _ in range(runs):
            p = [world.random() for _ in range(n)]
            u = [[world.random() for _ in range(horizon)]
                 for _ in range(n)]
            for rule in ("greedy", "thompson"):
                w, r = play(rule, p, u, horizon, rng)
                wrong[rule] += w
                reg[rule].append(r)
        print("%3d %5d %10.4f %10.4f %10.4f %10.4f" % (
            n, horizon, wrong["greedy"] / runs, wrong["thompson"] / runs,
            math.fsum(reg["greedy"]) / runs,
            math.fsum(reg["thompson"]) / 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 1: Lock-In: Why Betting Everything on Last Week's Winner Traps a Business on a Second-Best Line. 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