Chapter 20 Exercises — Building an Opening Repertoire
Difficulty: ⭐ recall and concepts · ⭐⭐ apply to a position or a table · ⭐⭐⭐ analyse, extend code, judge · ⭐⭐⭐⭐ open-ended research.
Every position below comes from a real game in the book's data, and every engine number was produced by
Stockfish 19 for this chapter (code/09_exercise_boards.py, code/08_exercise_positions.py). Evaluations
are from White's point of view, in pawns.
Part A — Concepts ⭐
A1. Explain in two sentences why a repertoire tree branches at your opponent's nodes but not at yours. What does that imply about where your preparation time should go?
Answer
At your own nodes you choose one move, so every alternative disappears from your preparation; at your opponent's nodes every reasonably common reply must be answered. Preparation should be narrow and deep under your own moves and wide, weighted by frequency at your level, under your opponent's.
A2. In Dev's White tree, 1...c5 occurs in 20% of his 1.e4 games, he answers with 2.Nf3 in 70% of those, and 2...d6 follows in 57% of the 2.Nf3 games. About what share of all his White games reach 1.e4 c5 2.Nf3 d6? Why do frequencies multiply down a path?
Answer
0.20 × 0.70 × 0.57 ≈ 0.08, about 8% (the study table shows 21 of 269 games, 7.8%). Each share is conditional on reaching the parent node, so the probability of the whole path is the product of the conditional shares.
A3. Using the interval table from 20.3, give the approximate ±95% half-width for a score near 50% after 20, 50, 100 and 385 games. How many games does it take to halve the width of an interval?
Answer
About ±20, ±13, ±10 and ±5 points. Width shrinks with the square root of n, so halving it takes four times as many games (e.g. ±10 at about 100 games → ±5 at about 385).
A4. Why should your own games be removed from the "database expectation" you compare yourself with? Give the Najdorf example.
Answer
Otherwise you partly compare yourself with yourself, pulling the reference toward your own score. At Dev's level only 97 English Attack games exist in the sample and 50 are his; the census figure (44.3%) is dragged toward his 36.0%. Without his games the reference is 47 games at 53.2% — so thin that the right test is the interval for the difference (−17.2 points, from −36.7 to +2.3), which includes zero.
A5. What is the "forking paths" problem, and what did the null simulation in 20.3 show for a player with seven lines and 233 games?
Answer
When you scan many lines and report the most extreme, something will look remarkable by chance. In the simulation — a player with no real opening strengths or weaknesses — at least one line fell 10 or more points below expectation in 72.3% of seasons, and one rose 17 or more above it in 31.3%.
A6. The masters explorer says 6...e5 is 71.5% of Black's replies to 6.Be3; Lichess blitz at all ratings says 57.5% (from 234 games with moves). Which number should a 1600 player use for frequency, which for seriousness, and why?
Answer
Frequency should come from games at your own level (here the Lichess figure, though at Dev's exact band the sample is tiny, so the all-rating blitz figure is the practical substitute). Seriousness — which replies are objectively important and well-tested — comes from master games. You prepare what you will meet, in the depth that strong players have shown it deserves.
A7. With a prior worth 30 games, compute the shrunk score for a node where you have 10 games and 3 points, and the database expectation is 50%. Then do the same for 100 games and 30 points.
Answer
(3 + 30 × 0.5) / (10 + 30) = 18/40 = 45%. (30 + 15) / (100 + 30) = 45/130 ≈ 34.6%. The small sample is pulled most of the way to 50%; the large one keeps most of its own deficit.
A8. Define coverage and prep load in your own words. Why does coverage fall so fast with ply?
Answer
Coverage is the share of games at your level still inside your prepared tree after a given ply; prep load is the number of opponent replies you must prepare to cover a target share (80%) at every node you reach. Coverage falls roughly geometrically because each opponent node keeps only the share of games covered by the replies you prepared, and those shares multiply down the tree.
Part B — Positions ⭐⭐
B1. Find the tactic (and the habit). Dev, White, in an English Attack blitz game. Black has just played 10...b5. Dev played 11.f4. What is wrong with it, and what should he play?

♟️ Position: White Ke1, Qd2, Ra1, Rh1, Bf1, Be3, Nb3, Na4, a2, b2, c2, g2, h2, f3, e4; Black Ke8, Qd8, Ra8, Rh8, Be6, Be7, Nf6, Nd7, b5, e5, a6, d6, f7, g7, h7 — White to move. FEN:
r2qk2r/3nbppp/p2pbn2/1p2p3/N3P3/1N2BP2/PPPQ2PP/R3KB1R w KQkq - 0 11
Answer
10...b5 attacks the knight on a4, and 11.f4?? ignores it: after 11...bxa4 Black is a piece up, −7.99 (Stockfish 19, depth 24). The only move that keeps the game going is 11.Nc3 (−0.63 at depth 24; MultiPV at depth 20: Nc3 −0.92, then Qc3 −7.04 and Na5 −7.13 — everything else loses material). 11.Nb6 also fails (−7.76). Black is already a little better because 9.Na4 misplaced the knight. The habit that prevents this is the one from Chapter 7: after every opponent move, ask what does it attack?
B2. Find the move. Same structure, a different Dev game: he has a pawn on d7 and a winning position. White to play move 34.

♟️ Position: White Kb1, Rd1, Re1, Nd3, a2, c2, b3, h4, g5, d7; Black Kf7, Rd8, Rh8, Be7, c3, a6, f6, g7, h7 — White to move. FEN:
3r3r/3Pbkpp/p4p2/6P1/7P/1PpN4/P1P5/1K1RR3 w - - 2 34
Answer
34.gxf6 keeps a decisive advantage: +5.96 (depth 24), and the depth-20 MultiPV lists gxf6 +5.61, Nf2 +4.48, Re4 +4.42 — several moves win. Dev played 34.Nc5??, which drops the knight to 34...Bxc5: −4.01 (depth 24). The lesson is about blunder-checking in winning positions, not about the opening: the English Attack gave Dev everything he wanted.
B3. Find the tactic. Polgar–Gelfand, Novgorod 1996. White to play move 28.

♟️ Position: White Kb1, Qh2, Rd1, Rh5, Bd3, Nd4, a2, b2, c2, d5; Black Kg6, Qf6, Rc8, Rf8, Bg5, Nc5, f4, b5, f5, a6, d6, h6 — White to move. FEN:
2r2r2/8/p2p1qkp/1pnP1pbR/3N1p2/3B4/PPP4Q/1K1R4 w - - 4 28
Answer
28.Bxf5+! (Stockfish 19: +6.71 at depth 24 after the move; MultiPV depth 20: Bxf5+ +5.20, Rxg5+ +4.12, Nf3 +1.53). The game went 28...Qxf5 29.Nxf5 Rxf5 30.Rh1, and White's heavy pieces picked up the loose black pieces. The engine's main line at depth 24 is 28...Kf7 29.Bxc8 Rxc8 — Black declines the queen trade but simply stays a piece down. The tactic works because of the English Attack's long-term gains: the open g- and h-files, the exposed black king and the knight's route to f5.
B4. Build the plan. Polgar–Gelfand after 8...Nbd7. White to play move 9. Compare 9.Qd2, 9.g4 and 9.Be2. Which one does not belong to the English Attack plan, and how much does the engine care?

♟️ Position: White Ke1, Qd1, Ra1, Rh1, Bf1, Be3, Nb3, Nc3, a2, b2, c2, g2, h2, f3, e4; Black Ke8, Qd8, Ra8, Rh8, Be6, Bf8, Nf6, Nd7, e5, a6, d6, b7, f7, g7, h7 — White to move. FEN:
r2qkb1r/1p1n1ppp/p2pbn2/4p3/4P3/1NN1BP2/PPP3PP/R2QKB1R w KQkq - 1 9
Answer
9.Qd2 (+0.33 at depth 24) and 9.g4 (+0.36) are both the plan — queen to d2, king to c1, pawns to g4 and g5 to drive the f6 knight from d5 — in different orders; the engine's depth-24 line is 9.g4 Be7 10.Qd2 O-O 11.O-O-O b5 12.g5. 9.Be2 (+0.03) is a normal developing move that does not fit: it spends a tempo on a square the bishop does not need and gives up the kingside initiative, and the edge disappears. Polgar chose 9.Qd2.
B5. Analyze this position (the repetition decision). Vachier-Lagrave–Tabatabaei, Olympiad 2026, after 6.Be3 Ng4 7.Bc1 Nf6 8.Be3 Ng4. White to play move 9. The position has now occurred twice. What are White's options, and what does the engine not know here?

♟️ Position: White Ke1, Qd1, Ra1, Rh1, Bf1, Be3, Nc3, Nd4, a2, b2, c2, f2, g2, h2, e4; Black Ke8, Qd8, Ra8, Rh8, Bc8, Bf8, Ng4, Nb8, a6, d6, b7, e7, f7, g7, h7 — White to move. FEN:
rnbqkb1r/1p2pppp/p2p4/8/3NP1n1/2N1B3/PPP2PPP/R2QKB1R w KQkq - 6 9
Answer
Stockfish 19 (MultiPV depth 20): 9.Bg5 +0.37, 9.Bc1 +0.29, 9.Qd2 −0.04; after 9.Bg5 +0.32 and after 9.Bc1 +0.37 at depth 24; 9.Bd2? is −0.40 (9...Qb6 hits d4 and b2). The engine evaluates the FEN without the game history, so it does not know that 9.Bc1 Nf6 10.Be3 Ng4 would repeat the position a third time and give Black a draw by repetition. A White repertoire must decide in advance: accept the draw (fine in some events), or play 9.Bg5 as Vachier-Lagrave did (9...h6 10.Bh4 g5 11.Bg3), which keeps the game going at almost no objective cost.
B6. Engine analysis (soundness). The Italian after 1.e4 e5 2.Nf3 Nc6 3.Bc4. Black to move. Which of 3...Bc5, 3...Nf6, 3...Be7 and 3...d6 are sound enough for a repertoire?

♟️ Position: White Ke1, Qd1, Ra1, Rh1, Bc1, Bc4, Nb1, Nf3, a2, b2, c2, d2, f2, g2, h2, e4; Black Ke8, Qd8, Ra8, Rh8, Bc8, Bf8, Nc6, Ng8, e5, a7, b7, c7, d7, f7, g7, h7 — Black to move. FEN:
r1bqkbnr/pppp1ppp/2n5/4p3/2B1P3/5N2/PPPP1PPP/RNBQK2R b KQkq - 3 3
Answer
Stockfish 19, position after each move at depths 20 / 24: 3...Bc5 +0.22 / +0.22, 3...Nf6 +0.16 / +0.22, 3...Be7 +0.37 / +0.43, 3...d6 +0.55 / +0.50. All four are playable; 3...Bc5 and 3...Nf6 are the most accurate (within ±0.3 of the start position's +0.30 — effectively "equal"), while 3...Be7 and 3...d6 concede a little space and time. For a club repertoire, any of the first two is a sound choice; pick by the structures you want, not by the second decimal.
Part C — Data & Code ⭐⭐–⭐⭐⭐
C1. Database research ⭐⭐. Extend code/02_dev_query.py to Dev's Black games: one row per Black
family with at least 10 games, his score with a Wilson interval, his Elo expectation, and the database
(Lichess blitz, Black rated 1550–1750, his games removed). Expected output: a six-row table (the
Sicilian, Caro-Kann, Queen's Pawn Game, Italian, Scandinavian and French); most verdicts "cannot tell". Which family, if any, clears its database value?
C2. Database research ⭐⭐. Re-run the "reply to 1.e4 by band" table of code/03_repertoire_tree.py
for rapid instead of blitz. Expected shape: eight bands × seven replies plus other and n. Does
the shift from 1...e5 to 1...c5 with rating look the same at the slower speed?
C3. Statistics ⭐⭐. Using repertoire.games_needed, tabulate the games needed for ±3, ±5, ±7, ±10 and
±15 points at a score of 50% and at a score of 70%. Why does the required number fall slightly at 70%?
Answer
score 50%: ±3 → 1068, ±5 → 385, ±7 → 196, ±10 → 97, ±15 → 43 games
score 70%: ±3 → 897, ±5 → 323, ±7 → 165, ±10 → 81, ±15 → 36 games
The variance of a score is p(1 − p), which is largest at 50% (0.25) and smaller at 70% (0.21), so a lopsided score is slightly more precise for the same number of games. The difference is small; the dominant factor is always the square-root law.
C4. Simulation ⭐⭐⭐. Modify the null simulation in code/02_dev_query.py so that the player has 12
lines instead of 7 (use every family with at least 5 games). Report P(some line ≥ 10 points below
expectation). Expected shape: a single probability, higher than 72.3%. Explain why more lines make
the problem worse.
Hint
Each additional line is another draw from the same lottery: the chance that none of k independent lines falls 10 points below expectation is roughly the product of each line's chance of staying above that mark, and that product shrinks as k grows. Short lines (5–9 games) also have wider spreads, so they are the likeliest to produce an extreme value — which is why the "worst opening" in any personal report is usually one of the rarely played ones.
C5. Prep load ⭐⭐⭐. Use repertoire.prep_load on the Black tree of code/03_repertoire_tree.py for
the replies to 1.d4 (1...d5, 1...Nf6, 1...e6, 1...g6). Expected output: four lines with a
position count and a by-ply dictionary. Check how many reference games sit at each first-move node before
comparing the counts.
C6. Engine analysis ⭐⭐⭐. Adapt code/04_where_games_go_wrong.py to Dev's Scandinavian games as
Black (1.e4 d5; his weakest Black branch by score). Report the median evaluation after move 10 (from
Black's side), Black's opening and later accuracy, and the phase of his first mistake. Expected shape:
one summary block like the chapter's. Is his Scandinavian problem an opening problem?
C7. Coverage ⭐⭐⭐. Plot coverage curves (k = 1, 2, 3, 5) for Grace's Black repertoire against 1.e4 in
the broadcast data with 1...c5 and with 1...e6 (code/07_grace_black.py builds the tree). Expected
output: one figure, two panels. Which defence stays "in book" longer with two prepared replies per
node?
Part D — Judgment & Transfer ⭐⭐⭐
D1. A 1200-rated Lichess player asks whether to learn the Najdorf as Black. Using the reply tables in 20.1 and 20.2 (how often 1...c5 players reach an Open Sicilian at their level), make the case for and against, and give a recommendation.
Answer
Against: at 1200–1399 only about 11% of Sicilian games reach an Open Sicilian by ply 7; most games feature 2.Bc4, 2.Nc3, 2.d4 or other second moves, so Najdorf theory pays off rarely. For: the Sicilian scores slightly better than 1...e5 for Black below 2000 in our data (by +0.8 to +2.9 points by band), and learning one sound defence early avoids switching later. Recommendation: play 1...c5 with simple, principled answers to the common sidelines first; learn Najdorf structures (not long lines) as the Open Sicilian share grows with rating.
D2. Grace's coach says, "the Scandinavian scores terribly in classical OTB at your level, so never play it." Dev says, "it is the lightest defence to prepare, so it's perfect." Who is right?
Answer
Both describe real numbers — −9.1 points below Elo expectation over 668 classical OTB games at Grace's level, and a prep load of 25 positions against 53–75 for the main defences in Lichess blitz — but they answer different questions. The score is partly selection (who chooses the Scandinavian) and the interval is a few points wide; the prep load matters most in fast online chess. For Grace's long OTB games the evidence leans against it; for Dev's blitz, light preparation is a genuine advantage.
D3. The engine rates the English Attack tabiya at +0.40 (depth 24) and the Italian at +0.11. Does that mean the English Attack is the better choice for a 1600? What would change your answer at 2200?
Answer
No: both are inside the "equal, play for both sides" zone, and at 1600 the practical factors dominate — the English Attack scores 44.3% for White at Dev's level (n=97) against 49.0% at all blitz ratings, and its middlegames are sharp racing positions where one oversight decides. At 2200, where players handle those middlegames better and opponents more often play the Najdorf, the objective edge and the richer positions start to matter more — but the choice still depends on whether you understand the plans.
D4. Dev's Italian scores 67.5% [56.6–76.8] over 80 games. Should he build his whole repertoire around reaching the Italian? What could make that strength smaller than it looks?
Answer
It is the only result in his table that clears the database expectation, so it is probably a real strength — but its size is uncertain (+5 to +25 points), a result this good appears in about a third of luck-only seasons when scanning seven lines, and he only reaches it when Black plays 1...e5 (about half of his games). He should keep it and understand why it works (the engine pass shows he leaves the opening at a median +0.41), not reshape everything around one number.
D5. A friend shows you an opening course advertised with "this line scores 61% for White in the database". List four questions you would ask before believing it applies to you, and say which of them the chapter's data could answer.
Answer
(1) Which database and which level — masters, online, your band? Scores differ by pool (the Italian is 53.0% among masters, 51.6% on Lichess, 54.3% in broadcast OTB games). (2) How many games, and what is the interval? (3) Who chooses the line — is the 61% partly the strength or preparation of the players who play it (selection)? (4) What is the Elo expectation in those games — is 61% above what the ratings predict? The book's data answers (1), (2) and (4) directly; (3) can only be reduced by comparing within rating bands and adjusting for expectation, never removed entirely.
Part M — Mixed / Interleaved ⭐⭐–⭐⭐⭐
M1 (with Chapter 7 — prophylaxis). In Exercise B1, Dev's 11.f4?? ignored the threat to his knight. Apply Chapter 7's "what does my opponent want?" question to the position before 10...b5 (after 10.Qd2): what was Black threatening to do, and which White move would have prevented it?
Answer
Black wanted ...b5 to hit the a4 knight and gain queenside space; the knight on a4 had no safe retreat
except c3, and 9.Na4 had invited exactly this. Bringing the knight back (or never playing Na4) is the
prophylactic fix. Use outpost.prophylaxis to confirm the null-move threat in that position.
M2 (with Chapter 4 — king safety). In the English Attack White castles queenside and Black usually kingside. Use Chapter 4's shelter and attacker-count ideas to explain why the g4–g5 advance is the natural plan, and why Black's ...b5–b4 is the natural reply.
Answer
Each side attacks where the enemy king is and where its own king is not: White's g- and h-pawns can advance without weakening the shelter of a king on c1/b1, and they remove the f6 knight that defends h7 and d5; Black's a- and b-pawns can advance without exposing a king on g8 and they open lines against c2/b2. The race is decided by tempo and by who opens a file first.
M3 (with Chapter 6 — material imbalances). In Vachier-Lagrave–Tabatabaei, after 23.Rxa8 White has two rooks, a bishop and a knight against Black's queen and knight (material signature RRBN–QN). Using Chapter 6's fitted piece values, roughly count the material and compare it with the engine's evaluation.
Answer
The knights cancel, leaving two rooks and a bishop against the queen: with the book's fitted values (rook 4.81, bishop 3.06, queen 9.01) that is about 12.7 against 9.0, roughly +3.7 in White's favour. The engine's +3.21 (depth 20) / +3.43 (depth 24) after 21...hxg4 — two moves before the rooks are collected — is close to that count: Stockfish already "sees" that both black rooks will fall, and the queen's activity against White's loose pawns accounts for the rest.
M4 (with Chapter 13 — practical decisions). Dev's 34.Nc5?? came in a 3+2 game. Design a two-step in-game routine for blitz that would have caught it, and estimate how many seconds it costs per move.
Answer
Step 1: before moving, name every piece your move leaves undefended or newly attackable (one glance, about 1–2 seconds). Step 2: list the opponent's captures and checks after your move (about 2–3 seconds). Here step 1 flags the c5 knight (attacked by the e7 bishop, defended by nothing). In a 3+2 game with a winning position, five seconds is cheap insurance.
M5 (with Chapter 19 — opening principles). The engine rates 9.Be2 in Exercise B4 at only +0.03 although it develops a piece. Which principle explains why a developing move can be wrong here?
Answer
Development serves a plan: the English Attack's pieces are placed for a kingside pawn storm and long castling, and the f1 bishop is not needed on e2. Chapter 19's real principle is "use every tempo for the fight that is coming", not "move a new piece every move".
M6 (with Chapter 2 — pawn structure). The 6...e5 English Attack and the 6...e6 English Attack lead to different pawn skeletons. Describe the key square or weakness in each skeleton, and explain why a repertoire sheet should be organised by structure rather than by move order.
Answer
After ...e5 Black has a backward d6-pawn and a hole on d5, so both sides fight for d5 (White's Nd5, the g4–g5 push to remove the f6 knight). After ...e6 Black has the "Scheveningen" small centre (d6/e6) with no hole on d5 but less space, and the fight is about the e6/f5 squares and Black's ...d5 or ...b5 breaks. Move orders can transpose between lines; structures decide the plans. A sheet organised by skeleton covers every move order that reaches it.
Part E — Research & Extension ⭐⭐⭐⭐
E1. Your own tree. Download 300+ of your own games (outpost.games.fetch_user_games), build both
trees with repertoire.build_tree, attach a database expectation from the book's Lichess sample at your
band, and produce your study list. Write a one-page report: the three branches you reach most often, the
verdicts with intervals, what the engine pass says about where those games go wrong, and the model games
you will study.
E2. Opening "sharpness" by branch. The style map in 20.6 works at the level of opening families.
Rebuild it at the level of named variations (the Lichess Opening header after the colon) for the
Sicilian only, with at least 1,000 weighted games per variation. Is the English Attack among the sharpest
Sicilian branches by opposite-side castling at 1600–1799? How do the sharpest branches score?
E3. Do model games help? Design (do not run) a study that could tell whether learning model games for a branch improves results in that branch. What would you measure (score? evaluation after move 10? first-mistake ply?), how many games would you need for each, and how would you separate the effect from ordinary rating improvement and from luck?