What does Drift Control for Multi-Window Writing conclude, in numbers, about “Practice: Four Windows Write a Nine-Chapter Book, Five Classes of Injected Error and the Detection Ledger of Four Gates”?
Answer: Chapter 8 has four windows write a synthetic nine-chapter book with 119 injected errors in five classes: the four gates stop 0.723, 28 of the 33 escapes belong to techniques the machine cannot see by construction, and without them the detection rate is 0.945; on the clean book the first term run raises 1672 false alarms, which fall to zero after a person reviews 48 words; a serious injection audit needs at least 75 errors per class. Marked boxes separate published evidence, runnable calculations, sources and the author's hypotheses, each stating what would refute it.
Scope of the numbers: Every error rate without a source is an assumed parameter or a measurement on synthetic data; the book is not legal advice and recommends no writing tool or model. Marked boxes separate published evidence, runnable calculations, sources and the author's hypotheses, each stating what would refute it.
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.723, 0.945, 119, 28, 48, 75
| class caught n recall | 95% exact interval |
| term drift | 18 24 0.750 [0.533, 0.902] |
| number mismatch | 18 24 0.750 [0.533, 0.902] |
| duplicate sentence | 12 24 0.500 [0.291, 0.709] |
| citation hallucination | 16 20 0.800 [0.563, 0.943] |
| style degradation | 22 27 0.815 [0.619, 0.937] |
| all classes | 86 119 0.723 [0.633, 0.801] |
| excluding the 28 injections no machine gate is built to see | 86 / 91 = 0.945 [0.876, 0.982] |
| pre-registration: true recall 0.95, pass line: exact lower bound > | 0.85 |
| n | 24: need >= 24 caught, probability of passing 0.292 |
| n | 50: need >= 48 caught, probability of passing 0.541 |
| n | 75: need >= 70 caught, probability of passing 0.828 |
| smallest n per class with probability > | 0.80: 75 |
Show the full program
# Chapter 8. p81: exact (Clopper-Pearson) 95% intervals for the recalls p80 measured, and how many
# injected errors per class a pre-registered audit needs.
# Counts are copied from the output of p80 (caught by any gate / injected). The interval [lo, hi]
# solves P(X >= x | n, lo) = 0.025 and P(X <= x | n, hi) = 0.025, found by bisection.
# Sample size: the smallest n per class such that, if the true recall is 0.95, the exact 95% lower
# bound clears 0.85 with probability at least 0.80 (the audit's pass line is fixed before any run).
import math
COUNTS = [("term drift", 18, 24), ("number mismatch", 18, 24), ("duplicate sentence", 12, 24),
("citation hallucination", 16, 20), ("style degradation", 22, 27), ("all classes", 86, 119)]
BY_DESIGN = 6 + 6 + 6 + 6 + 4 # unrecorded synonym, wrong row, paraphrase, short stock, wrong claim
def tail_ge(x, n, p):
return math.fsum(math.comb(n, k) * p ** k * (1 - p) ** (n - k) for k in range(x, n + 1))
def tail_le(x, n, p):
return math.fsum(math.comb(n, k) * p ** k * (1 - p) ** (n - k) for k in range(0, x + 1))
def bisect(f, lo=0.0, hi=1.0):
for _ in range(60):
mid = (lo + hi) / 2
if f(mid):
hi = mid
else:
lo = mid
return (lo + hi) / 2
def cp(x, n, a=0.05):
lo = 0.0 if x == 0 else bisect(lambda p: tail_ge(x, n, p) >= a / 2)
hi = 1.0 if x == n else bisect(lambda p: tail_le(x, n, p) < a / 2)
return lo, hi
def power(n, true_r=0.95, line=0.85):
xs = [x for x in range(n + 1) if cp(x, n)[0] >= line]
if not xs:
return 0.0, None
return tail_ge(min(xs), n, true_r), min(xs)
if __name__ == "__main__":
print("class caught n recall 95% exact interval")
for name, x, n in COUNTS:
lo, hi = cp(x, n)
print("{:24s} {:6d} {:4d} {:.3f} [{:.3f}, {:.3f}]".format(name, x, n, x / n, lo, hi))
x, n = 86, 119 - BY_DESIGN
lo, hi = cp(x, n)
print("excluding the {} injections no machine gate is built to see: {} / {} = {:.3f} [{:.3f}, {:.3f}]"
.format(BY_DESIGN, x, n, x / n, lo, hi))
print("pre-registration: true recall 0.95, pass line: exact lower bound >= 0.85")
found = None
for n in range(20, 400):
pw, xmin = power(n)
if n in (24, 50, 100) or (found is None and pw >= 0.80):
print(" n = {:3d}: need >= {} caught, probability of passing {:.3f}".format(n, xmin, pw))
if found is None and pw >= 0.80:
found = n
break
print(" smallest n per class with probability >= 0.80: {}".format(found))Single source and citation
Fan, Y. (2026). Drift Control for Parallel Multi-Window Book Writing, Cross-Volume Terminology Graph Audits and Zero-Hallucination Citation Verifiers (Version 0.1.0), Chapter 8: Practice: Four Windows Write a Nine-Chapter Book, Five Classes of Injected Error and the Detection Ledger of Four Gates. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-152 · v0.1.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026152,
author = {Fan, Yafu},
title = {Drift Control for Parallel Multi-Window Book Writing, Cross-Volume Terminology Graph Audits and Zero-Hallucination Citation Verifiers},
year = {2026},
publisher = {5D Library},
edition = {0.1.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · Method: Five Failure Modes, Exclusive Locks and the Four Methods of Collation
- Chapter 2 · Concurrency Control: Exclusive-Create Locks, Leases, Version Numbers and Wave Scheduling
- Chapter 3 · The Terminology Graph: Lock Tables, Synonym Drift and Cross-Volume Consistency Audits
- Chapter 4 · Number Parity and Duplicate Sentences: Bilingual Agreement, Program Reconciliation and Near-Duplicate Detection
- Chapter 5 · A Zero-Hallucination Citation Verifier: Fields, Identifiers, Ledger Matching and Item-by-Item Verdicts
- Chapter 6 · Style Drift: Gates for Sentence Length, Lexical Diversity, Stock Phrases and Paragraph Openers