What does Private-Message Patience, Handoff and Complaint Blocking conclude, in numbers, about “Red, Amber, Green: Cost-Sensitive Handoff Thresholds on the ROC Curve”?
Answer: Chapter 4 shows that red-amber-green thresholds must move with margin: a threshold fixed at the midpoint costs 1232.9 yuan on expensive goods where the optimum costs 550.2.
Scope of the numbers: Its parameters are illustrative; all calculations are generated by its programs; it is not personalised legal, financial or business advice. Marked boxes separate published evidence, runnable Python calculations (18 programs), classical sources and the author's hypotheses.
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: 1232.9, 550.2
| AUC = 0.856 (d' = 1.5) | ||||||
| margin | t* | to human | bad caught | good sent | cost/100 | at t=0.75 |
| 40 | 0.29 | 0.213 | 0.613 | 0.113 | 195.9 | 217.6 |
| 150 | 1.17 | 0.472 | 0.879 | 0.370 | 382.4 | 417.0 |
| 600 | 2.09 | 0.775 | 0.982 | 0.723 | 550.2 | 1232.9 |
| 2400 | 3.02 | 0.948 | 0.999 | 0.935 | 623.1 | 4496.3 |
| the threshold moves with the margin; one global cutoff cannot | ||||||
| be optimal for both a 40-yuan and a 2400-yuan order |
Show the full program
# Chapter 4. p41: a cost-sensitive handoff threshold on the ROC curve.
# Model (illustrative parameters): the AI reports a confidence score s.
# On chats it can carry ("good") s ~ N(DP, 1); on chats it will fumble
# ("bad") s ~ N(0, 1); a share P_BAD are bad. Rule: hand to a human
# when s < t. A missed bad chat costs LOSS x margin (lost order plus
# complaint risk); a needless handoff costs C yuan of human time.
# The optimum sets the ROC slope to P(good) C / (P(bad) LOSS V), so
# t* = DP / 2 - ln(P(good) C / (P(bad) LOSS V)) / DP.
# The fixed rule "t = DP / 2" (best plain accuracy at equal shares) is
# shown for comparison. Costs are per 100 chats.
import math
from statistics import NormalDist
ND = NormalDist()
DP, P_BAD, LOSS, C = 1.5, 0.2, 0.4, 8.0
P_GOOD = 1.0 - P_BAD
def cost(t, v):
miss = P_BAD * (1.0 - ND.cdf(t)) * LOSS * v
waste = P_GOOD * ND.cdf(t - DP) * C
return 100.0 * (miss + waste)
print("AUC = {:.3f} (d' = {})".format(ND.cdf(DP / math.sqrt(2.0)), DP))
print(" margin t* to human bad caught good sent cost/100"
" at t=0.75")
for v in (40, 150, 600, 2400):
k = P_GOOD * C / (P_BAD * LOSS * v)
t = DP / 2.0 - math.log(k) / DP
red = P_BAD * ND.cdf(t) + P_GOOD * ND.cdf(t - DP)
print("{:7d} {:5.2f} {:8.3f} {:10.3f} {:9.3f} {:8.1f} {:9.1f}"
.format(v, t, red, ND.cdf(t), ND.cdf(t - DP), cost(t, v),
cost(0.75, v)))
print("the threshold moves with the margin; one global cutoff cannot")
print("be optimal for both a 40-yuan and a 2400-yuan order")Single source and citation
Fan, Y. (2026). Patience-Decay Distributions in Private-Message Queues, Red-Amber-Green Human-AI Handoff Thresholds and Markov Blocking of Complaint Escalation (Version 1.0.0), Chapter 4: Red, Amber, Green: Cost-Sensitive Handoff Thresholds on the ROC Curve. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-175 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026175,
author = {Fan, Yafu},
title = {Patience-Decay Distributions in Private-Message Queues, Red-Amber-Green Human-AI Handoff Thresholds and Markov Blocking of Complaint Escalation},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · The Shape of Patience: Exponential, Weibull and Lognormal Hazards, and Estimating Patience under Censoring
- Chapter 2 · Queues that Give Up: Erlang C, Erlang-A and Square-Root Staffing
- Chapter 3 · The Handoff Cutoff in Seconds: Expected Lost Value, Human Cost and Queue Feedback
- Chapter 5 · A Markov Chain of Complaint Escalation: Absorption Probabilities and the Cheapest Point of Blocking
- Chapter 6 · The Mental Accounting of Waiting: the Peak-End Rule, Eight Propositions on Waiting, and the Fairness Cost of Priority
- Chapter 7 · The Classics Examined: the Nine Postures of the Guiguzi's "Fu Yan" and Erlang's Telephone Exchange
- Chapter 8 · Practice and Falsification: a Closing-Skills Kit for Private-Message Service, Pre-Registered Tests and Refutation Conditions