What does Weekly Quotas for Business Lines conclude, in numbers, about “Calibration: Setting a Business Line against a Permanent Safe Yield and Bisecting for the Gittins Index”?

Answer: Chapter 2 computes the Gittins index by calibration and by restart; a line never tried has an index of 0.7029 at a discount of 0.9.

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.7029, 0.9

bisection for Beta(1, 1), beta = 0.9 (first 6 steps)
steplamretirecontinueverdict
10.750007.500007.34844retire
20.625006.250006.53388explore
30.687506.875006.92889explore
40.718757.187507.13536retire
50.703127.031257.03043retire
60.695316.953136.97948explore
index of Beta(1, 1), the untried line, by discount factor
beta 0.50depth40index 0.5590bonus +0.0590
beta 0.70depth40index 0.6046bonus +0.1046
beta 0.90depth40index 0.7029bonus +0.2029
beta 0.95depth80index 0.7614bonus +0.2614
beta 0.99depth 160index 0.8698bonus +0.3698

Key formula

\[V(a,b)=\max\Big(\frac{\lambda}{1-\beta},\; p\,[1+\beta V(a+1,b)]+(1-p)\,\beta V(a,b+1)\Big),\quad p=\frac{a}{a+b}.\]
Show the full program
# Chapter 2. p21: the Gittins index by calibration against a safe arm.
# Model: a line in state Beta(a, b) faces a safe arm that pays lam per
# period for ever. Value with retirement allowed:
#   V(a, b) = max( lam / (1 - beta),
#                  p (1 + beta V(a + 1, b)) + (1 - p) beta V(a, b + 1) )
# with p = a / (a + b). The index is the lam at which retiring now and
# continuing are equally good (Gittins and Jones 1974; Whittle 1980).
# Truncation: after depth steps learning stops and the line is worth
# max(lam, p) / (1 - beta). Bisection on lam to 1e-6.
import math


def cont_value(a, b, beta, lam, depth):
    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, 0, -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
    p = a / (a + b)
    return math.fsum((p * (1.0 + beta * v[1]), (1.0 - p) * beta * v[0]))


def gittins(a, b, beta, depth=40, 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)


print("bisection for Beta(1, 1), beta = 0.9 (first 6 steps)")
print("%4s %9s %11s %11s %9s" % ("step", "lam", "retire", "continue",
                                 "verdict"))
lo, hi = 0.5, 1.0
for step in range(1, 7):
    lam = 0.5 * (lo + hi)
    ret = lam / (1 - 0.9)
    con = cont_value(1, 1, 0.9, lam, 40)
    better = con > ret
    print("%4d %9.5f %11.5f %11.5f %9s" % (
        step, lam, ret, con, "explore" if better else "retire"))
    if better:
        lo = lam
    else:
        hi = lam
print("index of Beta(1, 1), the untried line, by discount factor")
for beta, depth in ((0.5, 40), (0.7, 40), (0.9, 40), (0.95, 80),
                    (0.99, 160)):
    g = gittins(1, 1, beta, depth)
    print("  beta %.2f  depth %3d  index %.4f  bonus %+.4f" % (
        beta, depth, g, g - 0.5))

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 2: Calibration: Setting a Business Line against a Permanent Safe Yield and Bisecting for the Gittins Index. 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