Chapter 20 Instructor Notes: Building an Opening Repertoire

Chapter text · Case study 1 · Case study 2 · Exercises · Quiz · Key takeaways

This chapter introduces Anchor C, the book's recurring lesson about sample size, and it returns in Chapters 23, 31, 35 and 40. It is the most statistically demanding chapter of Part IV, and the one where students most want a simple answer ("drop the Najdorf"). Your job is to make the interval feel like the most natural thing to ask for, and to move the conversation from "which number is bad?" to "where do the games go wrong?"

Remind the class at the start that Dev's and Grace's games are composites:

🎭 Dev's games are real Lichess games played by anonymous players at his rating, assembled into one "player" so the method can be shown; Grace's are real OTB broadcast games by anonymous players at her rating. Nothing here is a fact about a real person, and the book never claims Dev's rating changed after study.

Learning objectives

The hook frames the chapter as building a repertoire "the way a careful analyst would". By the end, students should be able to:

  1. Draw their repertoire as a decision tree — one move at their own nodes, an answer to every common reply at the opponent's — from their own games.
  2. Attach a database expectation at their level to every node (same speed, colour, band, their own games removed).
  3. Put an honest 95% confidence interval on every number about themselves, and recognise forking paths (scanning many lines guarantees one looks bad).
  4. Use the engine two ways: soundness checks of tabiyas at two depths, and a pass over their own games to find where points are actually lost.
  5. Choose lines by fit and practicality (style map, coverage, prep load) and learn branches through model games.

Timing plan

75-minute session

Minutes Activity Notes
0–10 Hook: Dev's spreadsheet Show only the score column (67.5% vs 36.0%). Vote: "Should Dev drop the English Attack?"
10–25 20.3 intervals Reveal the lo/hi columns; the interval-width table; the 97-game census trap.
25–35 Forking paths The null simulation (72.3%). Data demo below.
35–50 20.4 where games go wrong Median +0.32 after move 10 in the losses; Dev's 11.f4?? and 34.Nc5??.
50–62 20.1/20.2 the tree and replies by band 1...c5 5.8% → 34.1%; 2.Bc4 vs Open Sicilian by band.
62–70 20.6 coverage 19.3% still in book after ply 10 with two replies per node.
70–75 Exit ticket

3-hour block

Minutes Activity Notes
0–15 Hook and vote Read the Dev/Grace/Sam dialogue.
15–40 20.1 trees Students sketch their own three-ply White and Black trees on paper before seeing Dev's.
40–60 20.2 database method Four questions in order; Italian in three pools (draw rates 47.4% / 3.6% / 32.2%).
60–90 20.3 intervals, the census trap, forking paths Students compute a Wilson interval by hand for 18/50.
90–100 Break
100–125 20.4 and 20.5 Engine pass; Polgar–Gelfand (16...Nxe3 vs 16...h6) and Vachier-Lagrave–Tabatabaei (19...Ng4?).
125–145 Case Study 1: Topalov–Kasparov 1994 18.Nge2! +5.06 vs 18.e5 0.00.
145–165 Case Study 2: Grace's defence Small groups take one step each (results, branches, soundness, prep load, own record).
165–180 20.7 recipe, exit ticket

Key numbers and games

Item Value as quoted Where
Dev's Italian (White, Lichess blitz) 67.5% [56.6–76.8], n = 80 (53/2/25); Elo-exp 50.1%; database 51.6% (n = 16,713) → above Hook; §20.3
Dev's Najdorf 6.Be3 36.0% [24.1–49.9], n = 50 (18/0/32); Elo-exp 46.2% → cannot tell Hook; §20.3
The Najdorf references Band census 44.3% [34.8–54.2] (n = 97, includes Dev's 50); Dev removed 53.2% [39.2–66.7] (n = 47); any rating 49.0% [45.6–52.5] (n = 801) §20.3
Two-sample test Dev minus the other 47: −17.2 pts, 95% CI [−36.7, +2.3] — includes zero §20.3
Tabiyas Italian +0.08 (d18) / +0.11 (d24); English Attack +0.32 / +0.40 Hook; §20.4
Interval half-widths at 50% n = 10 ±26.3; 50 ±13.4; 100 ±9.6; 385 ±5.0; ±10 needs 97 games §20.3
Null simulation 10,000 seasons, 7 lines, 233 games: P(some line ≥ 10 pts below) 72.3%; ≥ 17 above 31.3% §20.3
Italian minus Najdorf +31.5 [+14.6, +48.4] §20.3
Engine pass (SF19 d14) Najdorf losses: median eval after move 10 +0.32; opening accuracy 94.4 vs later 79.3; first mistake in opening phase in 43% of losses §20.4
Dev's two moments 11.f4?? −0.80 → −7.99 (11.Nc3 −0.63); 34.Nc5?? +6.09 → −4.01 (34.gxf6 +5.96), depth 24 §20.4; Exercises B1–B2
Reply to 1.e4 by band 1...e5 57.7% (<1000) → 20.6% (2200–2399); 1...c5 5.8% → 34.1% §20.1
After 1.e4 c5 2.Bc4 16.4% at 1000–1199, 0.5% at 2200–2399; Open Sicilian by ply 7 5.9% → 29.8% §20.2
After 6.Be3 (masters) 45,847 games; 6...e5 71.5%, 6...e6 17.7%, 6...Ng4 9.3% §20.2
Polgar–Gelfand, Novgorod 1996 8...Nbd7 +0.41/+0.33; 16...Nxe3 −0.48 vs 16...h6 +0.58 (d24); 28.Bxf5+ §20.5
Vachier-Lagrave–Tabatabaei, Olympiad 2026 6...Ng4 +0.27/+0.23; 9.Bg5 avoids the repetition; 19...Ng4? +3.78 vs 19...Nf7 +1.16 (d24) §20.5
Style map (1600–1799 blitz) Opposite castling 15.9% overall; Scandinavian 26.9%, QGD 8.9%; Dev 48.9% vs 53.1% (no difference) §20.6
Coverage Two replies per node: 19.3% still in the tree after ply 10 §20.6
Prep load 1.e4 144 positions; Black: 1...c5 53, 1...e5 75, 1...d5 25 §20.6
Study list 30 nodes tested: 26 cannot tell, 3 above, 1 below §20.7
Grace's pool (OTB FIDE 1750–1950) 1...c5 45.1% (−2.1 adj) … 1...d5 39.2% (−9.1, n = 668) §20.8; Case Study 2
Topalov–Kasparov, Moscow 1994 After 7.g4 −0.13 (d20) / +0.34 (d24); 18.Nge2! +5.06 vs 18.e5 0.00 Case Study 1

Threshold concepts and likely misconceptions

Threshold concept: confidence intervals before conclusions. A score without its sample size and interval is not evidence. Students who cross this threshold automatically ask "out of how many?" (Grace's question in the hook) and "compared with what, and does the yardstick contain me?"

Misconceptions to expect:

  • "Fifty games is a lot." At 50 games the interval is about ±13 points — enough to detect a disaster, not a weakness.
  • "36% vs 44.3% is an 8-point gap." The 44.3% census includes Dev's own 50 games; removing them leaves 47 games and a two-sample interval [−36.7, +2.3].
  • "My worst line is my weakness." Forking paths: a player with no weaknesses shows some line 10+ points below expectation in 72.3% of seasons.
  • "The Najdorf is worse for White than the Italian." The engine likes the English Attack more (+0.40 vs +0.11 at depth 24). Dev's scores differ; the openings' soundness doesn't explain it.
  • "Bad score → learn more theory." The engine pass says Dev leaves the opening fine (+0.32 median in losses) and loses later.
  • "Draw rate is a property of the opening." It is mostly the pool: the Italian draws 47.4% among masters, 3.6% on Lichess.
  • "I'm a tactical player." Dev's opposite-castling games (48.9%, n = 90) and others (53.1%, n = 479) overlap.
  • "After studying, Dev improved." The book makes no such claim; his success criterion is the evaluation after move 10 and the ply of the first mistake, not his score.

How the four tracks use this chapter

  • ♟️ Improver: 20.1 (the tree), 20.3 (why fifty games is not many), 20.5 (model games), 20.7 (the seven-step recipe). Deliverable: a one-page repertoire around plans. Exercises A1–A4, B1, B2, B4.
  • 📊 Analyst: 20.2–20.4 and 20.6: band-weighted expectations, Wilson intervals, the null simulation, coverage and prep load; Case Study 2. Exercises A5, A7, C1–C4, D2, D5.
  • 🏆 Competitor: 20.5, 20.8, Case Study 1 (Topalov–Kasparov). Treat Part B as preparation drills, especially B5 (the repetition decision after 6...Ng4).
  • 💻 Developer: The Project Checkpoint, repertoire.py: wilson_interval, games_needed, shrink, the Node dataclass, build_tree, verdict (switches to a two-sample test when the reference has fewer than 1,000 effective games), study_priorities, coverage, prep_load. Exercises C3–C7.

Running the code

Script What it shows Notes
code/_ch20_common.py Helpers (first_sans, wilson, load_openings) —
code/01_build_opening_cache.py Builds code/_ch20_openings.parquet (5.1 MB; 592,505 Lichess blitz + rapid games with move text, first 12 plies) About 80 s; run this first
code/02_dev_query.py The Anchor C table, forest plot, interval widths, null simulation, tabiya evals Seeded (2026)
code/03_repertoire_tree.py Dev's trees, replies by band, study priorities, coverage, prep load Uses the cache
code/04_where_games_go_wrong.py Engine pass over 99 Dev games, Stockfish 19 depth 14, three workers Engine cache makes reruns fast; a pandas FutureWarning is harmless
code/05_model_games.py Polgar–Gelfand, Vachier-Lagrave–Tabatabaei, explorer after 6.Be3 Master + broadcast games
code/06_style_map.py Opposite castling / queens-off by family; Dev's split game_features
code/07_grace_black.py Grace's OTB pool Broadcast data, engine/online events excluded
code/08_…, 09_exercise_boards.py, case_study_01.py, case_study_02.py, project_checkpoint.py Exercises, case studies, module demo Outputs saved in code/_out*.txt

Expect 26 board diagrams and 10 charts. One teaching point from the engine work: the engine cache keys ignore move counters, so the 6...Ng4 position at move 7 and move 9 return identical evaluations — the engine evaluates the FEN and cannot see repetition history (Exercise B5 builds on this).

In-class demos

Board demo

Set up Dev's game before move 11: r2qk2r/3nbppp/p2pbn2/1p2p3/N3P3/1N2BP2/PPPQ2PP/R3KB1R w KQkq - 0 11. Ask: "You're White in an English Attack. What's your plan move?" Many will reach for f4 or g4 ("in the spirit of the opening"). Then ask: "What did 10...b5 attack?" Reveal 11.f4?? (−7.99, depth 24) against 11.Nc3 (−0.63). Follow with the move-34 position (3r3r/3Pbkpp/p4p2/6P1/7P/1PpN4/P1P5/1K1RR3 w - - 2 34): +6.09 before, 34.Nc5?? −4.01. Ask the class: "Which of these losses would more opening theory have prevented?"

Data demo

Run the interval table from 02_dev_query.py live (or project the _out text). Then project the null simulation and ask students to guess first: "A player with no weak opening, seven lines, one season — how often does some line look 10 points below expectation?" Typical guesses are 5–20%. Reveal 72.3%. Close with the 30-node study list: one "below" in 30 tests is about what chance produces (about 1.5 false alarms expected at 5% each).

Exercise guidance

  • Part A: everyone. A4 (remove yourself from the yardstick) and A7 (shrinkage arithmetic: 45% and about 34.6%) are the core checks.
  • Part B: Improver and Competitor.
  • B1: students say "f4 is thematic". It ignores the attack on a4; 11.Nc3 is the only move that keeps the game (−0.63).
  • B2: most find 34.gxf6 (+5.96); ask what checking habit would have stopped 34.Nc5??.
  • B4: students pick 9.Be2 as "developing". It is +0.03 against +0.33/+0.36 for 9.Qd2/9.g4 — it doesn't belong to the plan.
  • B5: students answer only with a move. The point is the decision (accept a repetition or deviate with 9.Bg5) and that the engine cannot see repetition history.
  • B6: students rank by the second decimal. All four Italian replies are playable; pick by structure.
  • Part C: Analyst C1, C2, C4; Developer C3, C5–C7. C3's answer (fewer games needed at 70% than 50%) is a nice variance check.
  • Part D: D1 (should a 1200 learn the Najdorf?), D3 (+0.40 vs +0.11 — does the engine pick the repertoire?) and D5 (an advertised "61% for White" line) are excellent short essays.
  • Part M: M1 (Chapter 7) and M4 (Chapter 13) connect Dev's blunders to habits rather than openings.

Assessment ideas

  1. Interval write-up. Give a student-sized record (for example 9/20 in one line, database 52%). Students compute the Wilson interval, state the verdict, and say how many games a ±10 interval needs.
  2. Census trap. Short answer: "Why is comparing Dev's 36.0% with the 97-game census of 44.3% wrong, and what test replaces it?" A strong answer names the overlap (50 of 97 games are Dev's) and the two-sample interval [−36.7, +2.3].
  3. Own-tree project. Students draw their own three-ply tree from at least 100 games, mark every node "above / below / cannot tell", and write which branch they would study first and why (reach × deficit after shrinkage).
  4. Quiz. The chapter quiz (20 questions: 10 multiple choice, 5 true/false, 3 short answer, 2 positions) fits a 25-minute slot.
  5. Developer milestone. build_tree and render on the student's games, with verdict producing at least one two-sample comparison.