What does Context-Parametric Rule Distillation and Online Calibration conclude, in numbers, about “Simpson's Reversal: Why a Rule Without Its Context Can Point the Wrong Way”?
Answer: Chapter 1 prices the single-sentence rule: on an illustrative decision table, "always B" is wrong for 0.5433 of traffic.
Scope of the numbers: Parameters are illustrative and all calculations are generated by the book's programs. This is general business analysis, not investment, legal or medical advice, and it describes no real customer or sale.
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
A. admission rate by department (men vs women) dept men n men rate women n women rate women - men A 825 0.621 108 0.824 +0.203 B 560 0.630 25 0.680 +0.050 C 325 0.369 593 0.341 -0.029 D 417 0.331 375 0.349 +0.018 E 191 0.277 393 0.239 -0.038 F 373 0.059 341 0.070 +0.011 B. pooled over the six departments men 2,691 applied, 1,198 admitted, rate 0.445 women 1,835 applied, 557 admitted, rate 0.304 departments where women do better: 4 of 6 C. odds ratio of admission, women vs men crude (pooled) 0.543 Mantel-Haenszel 1.105 D. share applying to the four harder departments C to F men 0.485 women 0.928
Show the full program
# Chapter 1. p11: Simpson reversal in the Berkeley 1973 admissions table.
# Data: the six largest departments as published in the R dataset
# UCBAdmissions (Bickel, Hammel and O'Connell 1975). Public counts.
# For each department: men admitted, men rejected, women admitted,
# women rejected. We compare the pooled rates with the stratified ones
# and with the Mantel-Haenszel common odds ratio.
import math
DATA = [("A", 512, 313, 89, 19), ("B", 353, 207, 17, 8),
("C", 120, 205, 202, 391), ("D", 138, 279, 131, 244),
("E", 53, 138, 94, 299), ("F", 22, 351, 24, 317)]
def rate(a, r):
return a / (a + r)
def main():
print("A. admission rate by department (men vs women)")
print(" dept men n men rate women n women rate women - men")
favour = 0
for d, ma, mr, wa, wr in DATA:
diff = rate(wa, wr) - rate(ma, mr)
favour += 1 if diff > 0 else 0
print(" {} {:>5,} {:.3f} {:>5,} {:.3f} {:+.3f}"
.format(d, ma + mr, rate(ma, mr), wa + wr, rate(wa, wr),
diff))
men_a = int(math.fsum(r[1] for r in DATA))
men_n = int(math.fsum(r[1] + r[2] for r in DATA))
wom_a = int(math.fsum(r[3] for r in DATA))
wom_n = int(math.fsum(r[3] + r[4] for r in DATA))
print("B. pooled over the six departments")
print(" men {:,} applied, {:,} admitted, rate {:.3f}".format(
men_n, men_a, men_a / men_n))
print(" women {:,} applied, {:,} admitted, rate {:.3f}".format(
wom_n, wom_a, wom_a / wom_n))
print(" departments where women do better: {} of 6".format(favour))
# odds ratio women : men, crude and Mantel-Haenszel
crude = (wom_a * (men_n - men_a)) / ((wom_n - wom_a) * men_a)
num = math.fsum(wa * mr / (ma + mr + wa + wr)
for _, ma, mr, wa, wr in DATA)
den = math.fsum(wr * ma / (ma + mr + wa + wr)
for _, ma, mr, wa, wr in DATA)
print("C. odds ratio of admission, women vs men")
print(" crude (pooled) {:.3f} Mantel-Haenszel {:.3f}".format(
crude, num / den))
hard = ("C", "D", "E", "F")
m_h = int(math.fsum(r[1] + r[2] for r in DATA if r[0] in hard))
w_h = int(math.fsum(r[3] + r[4] for r in DATA if r[0] in hard))
print("D. share applying to the four harder departments C to F")
print(" men {:.3f} women {:.3f}".format(m_h / men_n, w_h / wom_n))
if __name__ == "__main__":
main()Single source and citation
Fan, Y. (2026). Next-Generation Knowledge Distillation, Context-Parametric Compilation and Live-Conversion Feedback Calibration (Version 1.0.0), Chapter 1: Simpson's Reversal: Why a Rule Without Its Context Can Point the Wrong Way. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-377 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026377,
author = {Fan, Yafu},
title = {Next-Generation Knowledge Distillation, Context-Parametric Compilation and Live-Conversion Feedback Calibration},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 2 · Context-Parametric Compilation: Squeezing a Decision Table into Decision Lists and Ordered Decision Diagrams
- Chapter 3 · Resolving Conflicts Across Volumes: Do More Rules Make a Pack More Accurate?
- Chapter 4 · Online Bayesian Calibration: Giving Every Rule a Beta Distribution That Grows
- Chapter 5 · Threshold Drift: Discounted Beta Updates, Sliding Windows and a Cumulative-Sum Alarm
- Chapter 6 · Calibration and the Whole Pipeline: the Brier Partition, Binned Calibration Error and a Net-Benefit Simulation
- Chapter 7 · Classical Sources: Wheelwright Bian and Aristotle on Equity
- Chapter 8 · Closing the Loop: Field Tools and Checker Specifications, the Risk Ledger and a Pre-registered Test