What does Three-City Teams: Handoffs and Acceptance conclude, in numbers, about “Closing the Empirical Loop: a Weekly Three-City Ledger, a Calculator and Pre-Registered Tests”?
Answer: The weekly ledger records the flow of work; the calculator turns the ledger into five recommendations, on the number of pieces, the batch interval, the sample size, the inspection interval and the incentive slope; and the pre-registered plan states how large the samples must be: for H1, a few tens of deliverables per group for a moderate effect; for H2, a full quarter of lots; for H3, eight to eleven handoffs a week. Each of the three core propositions carries an explicit condition of refutation, and the data that could refute them can only come from readers' own ledgers.
Scope of the numbers: Its schedules, lunch breaks, cost coefficients, exchange-rate volatilities and price levels are illustrative, and all calculations are generated by its programs. It is general management guidance, not individual, legal or tax advice; labour, tax and work-pass matters in the three cities must be confirmed by licensed local advisers.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python only
Three-City Async Handoff and Sampling Calculator (B-340) ledger: 6 tasks; wait per handoff 6.77 h; loss per handoff 0.151 split: best 2 pieces, 35.78 h calendar; 8 pieces 68.15 h handoff notes: send a batch every 1.83 h sampling: 90 inspected, 3 defective, 1 escaped later posterior mean 0.0364 vs breakeven 0.0400 -> ship rest best sample per lot 42; sample every 2.32 working days slope: 0.667 on pieces alone; 0.364 when notes go unmeasured MYR paid in a base unit: beta 0.663; one base unit = 2.00 baskets TWD paid in a base unit: beta 0.665; one base unit = 1.67 baskets VND paid in a base unit: beta 0.666; one base unit = 2.50 baskets pay the slope in local currency and scale it by price level; labour, tax and visa matters: licensed advisers in each city
Show the full program
# Chapter 8. p81: the weekly three-city ledger and what it recommends.
# Six illustrative tasks logged in one week: route, hours, pieces,
# handoffs, hours waited at handoffs, hours of rework traced to a
# handoff, items sampled, defects found, and defects that escaped and
# came back later. From the ledger: the wait per handoff H and the loss
# per handoff delta that p21 needs; the batch interval of p31; the
# posterior defect rate, decision and sample size of p51; the sampling
# interval of p52; the slopes of p61, p62 and p63. Distilled unchanged
# into distill/tool.py, whose no-argument demo prints these lines.
import math
DEMO_LEDGER = ("T01:KL>TPE,40,4,3,21.0,5.5,15,0,0;"
"T02:TPE>HCM,32,3,2,13.5,3.0,15,1,0;"
"T03:HCM>KL,48,5,4,30.0,7.0,15,0,1;"
"T04:KL>HCM,24,2,1,5.5,1.0,15,0,0;"
"T05:TPE>KL,40,4,3,19.5,4.5,15,2,0;"
"T06:HCM>TPE,36,3,2,12.0,2.5,15,0,0")
DEMO_FX = "MYR:0.10:0.50;TWD:0.06:0.60;VND:0.03:0.40"
def parse_ledger(text):
rows = []
for item in text.split(";"):
tid, rest = item.split(":", 1)
f = rest.split(",")
rows.append({"id": tid, "route": f[0], "hours": float(f[1]),
"pieces": int(f[2]), "handoffs": int(f[3]),
"wait": float(f[4]), "rework": float(f[5]),
"sampled": int(f[6]), "defects": int(f[7]),
"escapes": int(f[8])})
return rows
def estimates(rows):
hand = math.fsum(r["handoffs"] for r in rows)
wait = math.fsum(r["wait"] for r in rows)
exposed = math.fsum(r["handoffs"] * r["hours"] / r["pieces"]
for r in rows)
rework = math.fsum(r["rework"] for r in rows)
return wait / hand, rework / exposed
def span(k, work, serial, h, delta): # p21
return (work * (serial + (1 - serial) / k) + (k - 1) * h
+ (k - 1) * delta * work / k)
def best_split(work, serial, h, delta):
return min(range(1, 41), key=lambda k: (span(k, work, serial, h,
delta), k))
def batch_interval(lam, k, cw): # p31
return math.sqrt(2 * k / (lam * cw))
def lbeta(a, b):
return math.lgamma(a) + math.lgamma(b) - math.lgamma(a + b)
def exp_cost(n, a, b, k1, k2, lot): # p51
terms = [n * k1]
for d in range(n + 1):
pred = math.comb(n, d) * math.exp(lbeta(a + d, b + n - d)
- lbeta(a, b))
post = (a + d) / (a + b + n)
terms.append(pred * (lot - n) * min(k1, post * k2))
return math.fsum(terms)
def best_n(a, b, k1, k2, lot):
return min(range(0, lot), key=lambda n: (exp_cost(n, a, b, k1, k2,
lot), n))
def drift_rate(t, nu, k1, k2): # p52, same constants as the chapter
lam, p0, p1, n, rep, fa = 40, 0.02, 0.12, 15, 8.0, 2.0
def alarm(p):
return 1 - (1 - p) ** n - n * p * (1 - p) ** (n - 1)
good, bad = 1 / nu, t * (1 / alarm(p1) - 0.5)
cycle = good + bad
cost = math.fsum([cycle / t * n * k1, good / t * alarm(p0) * fa,
bad * lam * (p1 - p0) * k2, rep])
return cost / cycle
def best_interval(nu, k1, k2):
grid = [i / 100 for i in range(5, 3001)]
return min(grid, key=lambda t: (drift_rate(t, nu, k1, k2), t))
def beta_single(r, s2): # p61
return 1 / (1 + r * s2)
def beta_multi(r, s2, s, m): # p62
def eff(b):
e1, e2 = (b - s * m) / (1 - s * s), (m - s * b) / (1 - s * s)
if e2 < 0:
return b, 0.0
if e1 < 0:
return 0.0, m
return e1, e2
def surplus(b):
e1, e2 = eff(b)
cost = (e1 * e1 + e2 * e2) / 2 + s * e1 * e2
return e1 + e2 + m * e2 - cost - r * b * b * s2 / 2
grid = [i / 1000 for i in range(0, 1501)]
return max(grid, key=lambda b: (surplus(b), -b))
def beta_fx(r, s2, vol): # p63, analytic mean over 12 monthly paydays
v = math.fsum(math.exp(vol * vol * t / 12) - 1
for t in range(1, 13)) / 12
return 1 / (1 + r * (s2 * (1 + v) + v))
def run(a):
rows = parse_ledger(a.ledger)
h, delta = estimates(rows)
k = best_split(a.work, a.serial, h, delta)
pa, pb = (float(x) for x in a.prior.split(","))
n = best_n(pa, pb, a.k1, a.k2, a.lot)
sampled = int(math.fsum(r["sampled"] for r in rows))
found = int(math.fsum(r["defects"] for r in rows))
escaped = int(math.fsum(r["escapes"] for r in rows))
post = (pa + found) / (pa + pb + sampled)
fx = []
for item in a.fx.split(";"):
code, vol, level = item.split(":")
fx.append({"code": code, "beta_base_unit": round(beta_fx(
a.risk, a.noise, float(vol)), 3), "price_level": float(level),
"real_per_base_unit": round(1 / float(level), 2)})
return {
"tasks": len(rows), "wait_per_handoff_h": round(h, 2),
"loss_per_handoff": round(delta, 3),
"best_split": k, "span_best_h": round(span(
k, a.work, a.serial, h, delta), 2),
"span_8_pieces_h": round(span(8, a.work, a.serial, h, delta), 2),
"batch_interval_h": round(batch_interval(
a.rate, a.note_cost, a.delay_cost), 2),
"sampled": sampled, "defects": found, "escapes": escaped,
"posterior_mean": round(post, 4),
"breakeven": round(a.k1 / a.k2, 4),
"decision": "inspect rest" if post > a.k1 / a.k2 else "ship rest",
"best_sample_n": n,
"sample_every_days": best_interval(1 / a.shift_days, a.k1, a.k2),
"beta_single": round(beta_single(a.risk, a.noise), 3),
"beta_with_notes": beta_multi(a.risk, a.noise, a.subst, a.norm),
"fx": fx}
def show(o):
print("Three-City Async Handoff and Sampling Calculator (B-340)")
print("ledger: %d tasks; wait per handoff %.2f h; loss per handoff "
"%.3f" % (o["tasks"], o["wait_per_handoff_h"],
o["loss_per_handoff"]))
print("split: best %d pieces, %.2f h calendar; 8 pieces %.2f h" % (
o["best_split"], o["span_best_h"], o["span_8_pieces_h"]))
print("handoff notes: send a batch every %.2f h" % o["batch_interval_h"])
print("sampling: %d inspected, %d defective, %d escaped later" % (
o["sampled"], o["defects"], o["escapes"]))
print(" posterior mean %.4f vs breakeven %.4f -> %s" % (
o["posterior_mean"], o["breakeven"], o["decision"]))
print(" best sample per lot %d; sample every %.2f working days" % (
o["best_sample_n"], o["sample_every_days"]))
print("slope: %.3f on pieces alone; %.3f when notes go unmeasured" % (
o["beta_single"], o["beta_with_notes"]))
for f in o["fx"]:
print(" %s paid in a base unit: beta %.3f; one base unit = %.2f "
"baskets" % (f["code"], f["beta_base_unit"],
f["real_per_base_unit"]))
print("pay the slope in local currency and scale it by price level;")
print("labour, tax and visa matters: licensed advisers in each city")
class Args:
ledger, fx, prior = DEMO_LEDGER, DEMO_FX, "1,19"
work, serial, rate, note_cost, delay_cost = 40.0, 0.3, 1.5, 0.5, 0.2
k1, k2, lot, shift_days = 0.5, 12.5, 200, 40.0
risk, noise, subst, norm = 1.0, 0.5, 0.5, 0.4
show(run(Args))Single source and citation
Fan, Y. (2026). Distributed Multi-City Team Coordination, Asynchronous Deliverable Verification and Regional Talent Allocation across KL, Taipei and HCMC (Version 1.0.0), Chapter 8: Closing the Empirical Loop: a Weekly Three-City Ledger, a Calculator and Pre-Registered Tests. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-340 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026340,
author = {Fan, Yafu},
title = {Distributed Multi-City Team Coordination, Asynchronous Deliverable Verification and Regional Talent Allocation across KL, Taipei and HCMC},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · One Time Zone Is Not Zero Coordination Cost: Shared Windows, Hands and Review Queues
- Chapter 2 · An Interior Optimum for Task Granularity: Handoff Loss, Brooks's Channels and Cross-City Assignment
- Chapter 3 · A Protocol for Asynchronous Handoff: Batch Interval, Inbox Rhythm and the Edge of the Day
- Chapter 4 · Acceptance Sampling: Operating Characteristics, the kp Rule and the Boundaries of All or None
- Chapter 5 · When the Defect Rate Is Unknown or Drifts: Bayesian Updating, Sample Size and the Inspection Interval
- Chapter 6 · The Incentive Slope: Noise, Risk Aversion, Multitask Crowding Out and Several Currencies
- Chapter 7 · Classical Sources East and West: Dividing the People Well in the Guanzi, and the Division of Labour in Babbage and Taylor