What does The Life of a Rule conclude, in numbers, about “Wald's Two Straight Lines: Boundaries, the OC Function and the Mean Sample Size”?
Answer: Wald's sequential test writes evidence as a visitor-by-visitor sum, and its two boundaries are parallel lines in the count plane with slope 0.03291 and a gap of 22.97 conversions, which anyone can compare with the cumulative visitors and conversions in a weekly report. The formulas of p22 show that the saving of "about half" holds at the baseline, 0.460, reaches only 0.616 at the target, and that middling rules between the two push the mean sample size up to 0.728 of the fixed sample. All of these are approximations that neglect the overshoot. Computed exactly, visitor by visitor, what are the true error rates and the true mean sample size? How long is the tail of the sample-size distribution, and when should a pipeline call time? Chapter 3 answers with exact recursions.
Scope of the numbers: Marked boxes separate published evidence, runnable Python calculations (20 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: 0.03291, 0.460, 0.616, 0.728
| fixed-sample n (one-sided, alpha 0.05, power 0.80): 5314 | |||
| zero-drift point p* = 0.03291 | |||
| true p | P(KEEP) | Wald ASN | ASN / fixed n |
| 0.02400 | 0.0001 | 927 | 0.174 |
| 0.02700 | 0.0028 | 1387 | 0.261 |
| 0.03000 | 0.0500 | 2444 | 0.460 |
| 0.03200 | 0.2208 | 3501 | 0.659 |
| 0.03291 | 0.3598 | 3819 | 0.719 |
| 0.03400 | 0.5431 | 3870 | 0.728 |
| 0.03600 | 0.8000 | 3275 | 0.616 |
| 0.03900 | 0.9502 | 2228 | 0.419 |
| 0.04200 | 0.9873 | 1586 | 0.298 |
| saving at p0: 0.540 | saving at p1: 0.384 |
Show the full program
# Chapter 2. p22: Wald's OC and ASN formulas against the fixed sample
# Model: same SPRT as p21 (p0 0.03, p1 0.036, alpha 0.05, beta 0.20).
# Wald (1945, 1947) neglects the overshoot over the boundaries and gets
# OC L(p) = (e^{hA} - 1) / (e^{hA} - e^{hB}), where h != 0 solves
# p (p1/p0)^h + q (q1/q0)^h = 1, and ASN E[N] = (L B + (1 - L) A) / E z
# with E z the mean step. At the zero-drift point E[N] = -A B / E z^2.
# The fixed-sample size is the one-sided normal-approximation n for the
# same alpha and power. Illustrative parameters; no randomness.
import math
from statistics import NormalDist
P0, P1 = 0.03, 0.036
ALPHA, BETA = 0.05, 0.20
A = math.log((1 - BETA) / ALPHA)
B = math.log(BETA / (1 - ALPHA))
LA = math.log(P1 / P0)
LB = math.log((1 - P1) / (1 - P0))
def p_of_h(h):
u, v = (P1 / P0) ** h, ((1 - P1) / (1 - P0)) ** h
return (1 - v) / (u - v)
def h_of_p(p):
lo, hi = -6.0, 6.0 # p_of_h falls as h rises
for _ in range(200):
mid = (lo + hi) / 2
if abs(mid) < 1e-12:
mid = 1e-9
if p_of_h(mid) > p:
lo = mid
else:
hi = mid
return (lo + hi) / 2
def oc_asn(p):
ez = math.fsum([p * LA, (1 - p) * LB])
if abs(ez) < 1e-12:
ez2 = math.fsum([p * LA * LA, (1 - p) * LB * LB])
return A / (A - B), -A * B / ez2
h = h_of_p(p)
ea, eb = math.exp(h * A), math.exp(h * B)
oc = (ea - 1) / (ea - eb)
return oc, math.fsum([oc * B, (1 - oc) * A]) / ez
nd = NormalDist()
za, zb = nd.inv_cdf(1 - ALPHA), nd.inv_cdf(1 - BETA)
root = math.fsum([za * math.sqrt(P0 * (1 - P0)),
zb * math.sqrt(P1 * (1 - P1))])
n_fix = math.ceil((root / (P1 - P0)) ** 2)
p_star = -LB / (LA - LB)
print("fixed-sample n (one-sided, alpha 0.05, power 0.80): %d" % n_fix)
print("zero-drift point p* = %.5f" % p_star)
print("true p P(KEEP) Wald ASN ASN / fixed n")
for p in (0.024, 0.027, 0.030, 0.032, p_star, 0.034, 0.036, 0.039,
0.042):
oc, asn = oc_asn(p)
print("%.5f %7.4f %9.0f %13.3f" % (p, 1 - oc, asn, asn / n_fix))
o0, n0 = oc_asn(P0)
o1, n1 = oc_asn(P1)
print("saving at p0: %.3f saving at p1: %.3f"
% (1 - n0 / n_fix, 1 - n1 / n_fix))Single source and citation
Fan, Y. (2026). Empirical Retirement of Live Rules: Wiring the Sequential Probability Ratio Test into Real Conversion Streams to Promote, Demote and Retire Copy Rules (Version 1.0.0), Chapter 2: Wald's Two Straight Lines: Boundaries, the OC Function and the Mean Sample Size. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-263 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026263,
author = {Fan, Yafu},
title = {Empirical Retirement of Live Rules: Wiring the Sequential Probability Ratio Test into Real Conversion Streams to Promote, Demote and Retire Copy Rules},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · A Weekly Glance: How a Mediocre Copy Rule Gets Promoted by Mistake
- Chapter 3 · Exact Recursions: the Long Tail of the Sample Size and the Cost of a Cap
- Chapter 4 · Connecting Real Conversion Streams: Weekly Batches and Where the Baseline Comes From
- Chapter 5 · The Rule Lifecycle as a State Machine: Promotion, Demotion and Retirement
- Chapter 6 · Many Rules in Parallel: Sharing Alpha, and How Many Promoted Rules Are Duds
- Chapter 7 · Classical Sources East and West: Checking by Trial in the Han Feizi, and Wald's Sequential Analysis
- Chapter 8 · Closing the Loop: Wiring the Weekly Radar's Verdicts into the Rule State Machine