Exercises — Chapter 33: Playing Style Analysis

Difficulty: ⭐ recall and understanding · ⭐⭐ application · ⭐⭐⭐ analysis and judgment · ⭐⭐⭐⭐ open-ended research.

All engine evaluations below are Stockfish 19, from White's point of view, at the depth stated. All positions come from real games in the book's data; the diagrams are in this chapter's images/ folder.


Part A — Concepts ⭐

A1. In your own words, define playing style so that it excludes playing strength. Why does the chapter locate style in "choices among moves of roughly equal value"?

Answer

Style is a player's consistent preferences when several moves or plans are about equally good — for example, keeping tension rather than resolving it, attacking the king rather than playing on the queenside, steering for endgames rather than avoiding them. Strength is how good the chosen moves are. When one move is clearly best, every strong player chooses it, so the choice reveals strength, not preference; only near-equal alternatives reveal preferences.

A2. Name the four "impostors" a style measurement must be separated from, with one example of how each can fake a style.

Answer

Skill (weaker play produces more swings and more material lost — it looks "aggressive"); circumstance (weak opponents or a sharp opening repertoire change the games you get); era (nineteenth-century games were more decisive and error-prone for everyone); noise (forty games contain only a handful of rare events such as early queen trades).

A3. Why does the mean |Δ win %| per ply ("sharpness") mostly measure errors? Answer in two or three sentences without using any numbers.

Answer

The engine's evaluation already anticipates the best continuation, so if both players played the best moves the evaluation would barely change from ply to ply. Large changes come from moves the engine did not expect — usually mistakes by either side. A sharp position only produces swings if someone errs in it.

A4. What does the tension feature count, exactly? What does king pressure count? Why is one about contacts and the other about aim?

Answer

Tension = the number of attacker → target pairs between opposing pieces (any piece attacking an enemy piece other than the king, both colours), averaged over positions after the player's moves 10–40. King pressure = the number of the player's pieces (pawns included, king excluded) attacking at least one square of the enemy king zone. Tension counts pieces touching enemy pieces (decisions pending); king pressure counts pieces pointed at the king's area even if they touch nothing.

A5. What is a null model in clustering? Explain the difference between the permuted null and the Gaussian null, and which one the real data must beat to support "style types".

Answer

Artificial data with no clusters, used to see what silhouette k-means achieves on structure-free data. The permuted null shuffles each feature column independently (same marginals, no correlations); the Gaussian null draws from a normal distribution with the real means and covariance (same correlations, one smooth cloud). To support discrete types the real data must beat the Gaussian null — beating the permuted null only shows the features are correlated.

A6. Define split-half reliability and the Spearman–Brown correction. What value does the chapter use as a rule of thumb for describing individuals?

Answer

Split each player's games at random into two halves, compute the feature on each half, and correlate the halves across players (r). Spearman–Brown, 2r/(1 + r), estimates the reliability of the full set. The chapter averages 20 random splits and uses about 0.7 as the threshold for describing individuals.

A7. True or false, with a reason: "If k-means returns the same partition for almost every random seed, the clusters are real."

Answer

False. In the OTB data, k = 2 gave a seed-stability ARI of 0.950, yet the silhouette never beat the Gaussian null. A stretched cloud is cut in the same place every time; stability says nothing about whether the cut separates real groups.

A8. Why does the qoff20 feature credit a queen trade to both players, and why is that a problem for a style measure?

Answer

It is a game-level flag (both queens gone by ply 40), so it is 1 for both sides whoever initiated the trade. In Yurtaev – Carlsen 2004, White played 12.Qxd8; the flag still counts toward Carlsen's "early queen trade" tendency. A style feature should record who offered the trade and whether the other side could reasonably avoid it.


A9. The 22-way classifier identified the player from one game 5.7% of the time (chance 4.5%), but Steinitz vs Carlsen was separated 81.2% of the time. What is the classifier mostly recognising?

Answer

The era (and with it the error rate and the decisiveness of the games), not the individual. Players 130 years apart differ in everything that changed between eras; contemporaries such as Tal and Petrosian (55.0%) or Karpov and Kasparov (58.8%) are barely separable from single games.


Part B — Positions ⭐⭐

B1. Find the tactic. Ostrauskas – Tal, USSR Championship semi-final 1955. Black to move.

Ostrauskas – Tal, before 31...Bg2+

♟️ Position: White Kh1, Qh2, Re1, Bc2, Ng1, a2, b2, c3, d5, e4; Black Kh8, Qh5, Rf8, Bh3, Nc5, a6, b5, c4, g7, h7 — Black to move. FEN: 5r1k/6pp/p7/1pnP3q/2p1P3/2P4b/PPB4Q/4R1NK b - - 3 31

FEN: 5r1k/6pp/p7/1pnP3q/2p1P3/2P4b/PPB4Q/4R1NK b - - 3 31

What is Black's strongest move, and what does it win?

Solution

31...Bg2+! Stockfish 19 at depth 20 (multipv 2): 31...Bg2+ −7.96, the next best 31...Nd3 only −1.51. The principal variation is 31...Bg2+ 32.Kxg2 Rf2+ 33.Kxf2 Qxh2+ 34.Kf3: Black gives a bishop and a rook with check to win the queen with check and remains decisively ahead (−8.35 at depth 20 after the move). Style note: the chapter's give100 feature counts this as a material-giving move — the same as a speculative sacrifice from a level position.

B2. Analyze this position. Chigorin – Steinitz, St Petersburg 1895/96, round 4. Black to move.

Chigorin – Steinitz, before 25...Qxh4

♟️ Position: White Kg1, Qc3, Rc1, Rd3, Bb2, Nh4, a2, f2, g3, h2; Black Kc8, Qh5, Rg8, Rh6, Bg4, Nc6, b5, b7, c7, f7, h7 — Black to move. FEN: 2k3r1/1pp2p1p/2n4r/1p5q/6bN/2QR2P1/PB3P1P/2R3K1 b - - 4 25

FEN: 2k3r1/1pp2p1p/2n4r/1p5q/6bN/2QR2P1/PB3P1P/2R3K1 b - - 4 25

Steinitz played 25...Qxh4. Evaluate that move, and find the engine's preferred continuation.

Solution

25...Qxh4 gives the queen for a knight: after 26.gxh4 White is winning. Stockfish 19 at depth 20 rates the position after the game move +6.66; before it, the best moves are 25...b4 −4.80 and 25...Bh3 −3.93 (multipv 2). In the depth-16 game analysis the move swung the evaluation from −4.56 to +5.27, 71.7 win-% points — the largest single swing in Steinitz's 40-game sample. 25...b4 attacks White's queen first and keeps Black's winning attack.

B3. Build the plan. Moiseev – Petrosian, Moscow Championship 1950. Black to move after 14.g4.

Moiseev – Petrosian, before 14...Nfd7

♟️ Position: White Kc1, Qe3, Rd1, Rh1, Be2, Nc3, Ng1, a2, b2, c4, d5, e4, f2, g4, h3; Black Kg8, Qd8, Ra8, Re8, Bc8, Nc5, Nf6, a5, b7, c7, d6, e5, f7, g7, h7 — Black to move. FEN: r1bqr1k1/1pp2ppp/3p1n2/p1nPp3/2P1P1P1/2N1Q2P/PP2BP2/2KR2NR b - - 0 14

FEN: r1bqr1k1/1pp2ppp/3p1n2/p1nPp3/2P1P1P1/2N1Q2P/PP2BP2/2KR2NR b - - 0 14

White threatens to gain time with g4–g5. Suggest Black's plan and the move that starts it.

Solution

Petrosian played 14...Nfd7: the knight leaves the square that g5 would attack, heads for f8 and then e6 or g6, and Black keeps the dark-square blockade on c5/e5. Stockfish 19 at depth 20 (multipv 2): 14...Nfd7 +0.29, 14...a4 +0.32; after the game move +0.35. (At depth 16 the engine preferred 14...c6 — a reminder that rankings of near-equal moves change with depth.) The retreat removes six contacts compared with 14...c6: tension falls to 2.

B4. Find the move. Yurtaev – Carlsen, Aeroflot Open 2004. White to move.

Yurtaev – Carlsen, before 28.Rd1

♟️ Position: White Kh1, Rd2, Bf1, Na5, a2, b3, c4, d5, g2, h2; Black Kg8, Ra8, Be1, Nd7, a6, b5, f7, g7, h7 — White to move. FEN: r5k1/3n1ppp/p7/Np1P4/2P5/1P6/P2R2PP/4bB1K w - - 1 28

FEN: r5k1/3n1ppp/p7/Np1P4/2P5/1P6/P2R2PP/4bB1K w - - 1 28

The a5-knight is attacked by the e1-bishop. Which rook move keeps White in the game, and what is wrong with 28.Rd1?

Solution

28.Rb2 (−0.64 at depth 20, multipv 2) keeps the rook on the second rank. 28.Rd1, played in the game, is −3.22: it attacks the bishop but allows 28...Bxa5, and White cannot regain the piece. The depth-16 game analysis rated it a blunder (21.8 win-% points). This one move produces most of the game's "sharpness" — a sharpness score that belongs to White's error, not to Carlsen's style.

B5. Analyze this position. Tal – Vaganian, USSR Championship 1974. White to move.

Tal – Vaganian, before 33.Kh2

♟️ Position: White Kg3, Qd3, Rh8, Be4, a4, c3, e3, g2, g4; Black Ka7, Qe2, Bb7, Ng1, a5, b6, c7, d6, g5 — White to move. FEN: 7R/kbp5/1p1p4/p5p1/P3B1P1/2PQP1K1/4q1P1/6n1 w - - 2 33

FEN: 7R/kbp5/1p1p4/p5p1/P3B1P1/2PQP1K1/4q1P1/6n1 w - - 2 33

Compare 33.Qxe2 and 33.Kh2. Which keeps more tension, and what does the engine think of each?

Solution

At depth 20 (multipv 2) both are 0.00: 33.Kh2 and 33.Qxe2. The engine's line after 33.Kh2 is 33...Nf3+ 34.Kg3 Ng1 35.Kh2 — a repetition; the game was drawn. 33.Qxe2 trades queens and removes most contacts; 33.Kh2 keeps the queens and leaves more tension on the board (the chapter's code counts six more contacts than after the engine's depth-16 choice, 33.Qxe2). It is the largest "complicating deviation" among the seven attacking players' samples — and it is a king move in a dead-drawn position.

B6. Build the plan. Karpov – Pomar, Nice Olympiad 1974. White to move.

Karpov – Pomar, before 21.O-O-O

♟️ Position: White Ke1, Qe2, Ra1, Rh1, Bc3, a2, b2, c4, d4, e5, h5; Black Kc8, Qe7, Rd8, Rh8, Nh7, a7, b7, c6, e6, f7, g7, h6 — White to move. FEN: 2kr3r/pp2qppn/2p1p2p/4P2P/2PP4/2B5/PP2Q1P1/R3K2R w KQ - 1 21

FEN: 2kr3r/pp2qppn/2p1p2p/4P2P/2PP4/2B5/PP2Q1P1/R3K2R w KQ - 1 21

There is only one contact on the board. Where should White's king go, and what is White's long-term plan?

Solution

21.O-O-O (+1.43 at depth 20) or 21.O-O (+1.36) — the engine rates both close. Karpov castled long. The plan is structural: the e5 and h5 pawns take f6, g6 and d6 from Black's pieces and leave the h7-knight without a future; White can prepare d4–d5 to open the long diagonal for the c3-bishop and use the d-file. Nothing needs to be calculated — which is why tension (1) and king pressure (0) are minimal here.

B7. Endgame technique. Yurtaev – Carlsen, Aeroflot Open 2004. White to move.

Yurtaev – Carlsen, before 29.cxb5

♟️ Position: White Kh1, Rd1, Bf1, a2, b3, c4, d5, g2, h2; Black Kg8, Ra8, Ba5, Nd7, a6, b5, f7, g7, h7 — White to move. FEN: r5k1/3n1ppp/p7/bp1P4/2P5/1P6/P5PP/3R1B1K w - - 0 29

FEN: r5k1/3n1ppp/p7/bp1P4/2P5/1P6/P5PP/3R1B1K w - - 0 29

White is a piece down. What is White's best practical try, and why is it not enough?

Solution

29.cxb5 (−3.50 at depth 20, multipv 2; 29.Rc1 is −5.24). After 29...axb5 30.Bxb5 White has two pawns for the piece and a passed d-pawn. It is not enough because Black's minor pieces can blockade and win the d-pawn (in the game 33.d7 Ke7 34.a3 Nxd7) while Black's kingside pawn majority stays intact. In the final position after 37...Kd6, the engine gives −4.46 (38.a5) at depth 20.


Part C — Data & Code ⭐⭐–⭐⭐⭐

C1. Database research ⭐⭐. Using code/champion_games.csv, compute each player's median (instead of mean) per-game sharpness. Does the correlation with ACPL across the 22 players fall below 0.97? Expected output: a 22-row table and one correlation coefficient.

Hint

df.groupby("player")[["sharp", "acpl"]].median() then .corr(). Think about what a median does to a single huge swing such as Steinitz's 25...Qxh4.

C2. Database research ⭐⭐. Extend 03_otb_population.py: for each feature, compute the split-half reliability with 10, 20 and 40 games per player (subsample each player's games first). Expected output: a table of features × sample size. At what sample size does give100 reach 0.7, if ever? Use the Spearman–Brown prophecy formula, n·r/(1 + (n − 1)·r), to extrapolate.

Hint and expected shape

Subsample with d.sample(min(n, len(d)), random_state=2026) inside a groupby("player"), keep only players who have at least 40 games so every column uses the same players, and call style.split_half_reliability for each n. Expect reliability to rise with n for every feature, fastest for the clock features. For a feature with reliability 0.19 at 40 games, the prophecy formula with a length multiplier m gives m·0.19/(1 + (m − 1)·0.19); solve for 0.7 to see how many times forty games you would need (about ten times as many) — and ask whether any player has that many classical games in a year.

C3. Engine analysis ⭐⭐⭐. Improve the aggression feature. For each material-giving move in the 22-player samples, classify it with the engine as sound (win-% loss < 5), speculative (5–15) or unsound (≥ 15) — the categories of Chapter 11 — and compute per player a "sound sacrifices per 100 moves" rate. Expected output: 22 rows with counts per category. How does the ranking compare with raw give100? (The analysis is cached; the depth-16 results are already in the engine cache.)

Hint

style.game_features returns give_plies; join them with the per-ply table from engine.analyse_game(samples.truncated_pgn(pgn, 80), depth=16) and read wp_drop on those plies. Keep only plies in moves 10–40, because the samples are analysed to ply 80. Remember the lesson of Tal's 31...Bg2+: many material-giving moves in won positions are "sound" combinations rather than risky sacrifices, so also record the evaluation before the move and split sound sacrifices into "from a level position" (|eval| < 1.00) and "in a decided position".

C4. Database research ⭐⭐. In 04_lichess_style.py, Part A, add a column for the share of the player's material-giving moves that were blunders (win-% loss ≥ 15 by the server evals). Expected output: one value per band. What share would you predict below 1200 and at 2400+?

Hint

Use the per-ply table from style.plies_from_movetext to compute the mover's win-% drop on each ply (cd.win_pct on the mover-signed eval before and after). Predict before you run it: the game-level sharpness–ACPL correlation of 0.88 below 1200 suggests most material-giving moves there are blunders; at 2400+ the share should be much lower, but the correlation is still 0.79, so do not expect zero.

C5. Engine analysis ⭐⭐⭐. Re-run the only-move feature with a filter that excludes recaptures and moves out of check (positions where the previous move was a capture on the square the best move captures on, or the side to move is in check). Does the split-half reliability within the 22-player samples rise above 0.05? Expected output: the new per-player rates and one reliability number.

Hint

python-chess gives you board.is_check() and the previous move from board.peek(); a recapture is a best move that captures on the previous move's destination square. Expect the rate to fall for everyone; whether reliability rises is an empirical question — eight sampled positions per game may still be too few. Try sampling every move from 12 to 40 instead.

C6. Database research ⭐⭐⭐. Use style.classify_players on the OTB population (otb_player_games.parquet) for pairs of elite players with 40 games each. Which pair is easiest to tell apart from single games, and which features drive it? Expected output: a ranked list of pairs with cross-validated accuracy.

Hint

Filter players with mean FIDE ≥ 2700, loop over itertools.combinations of their FIDE ids, and call style.classify_players(d, FEATS, seed=2026) on each pair's games. With about 80 games per pair, an accuracy of 60% has a wide interval (a Wilson 95% interval of roughly ±11 points) — report it. Expect the clock features to drive most of the separable pairs.

C7. Code ⭐⭐. Add a who_traded_queens(game) function to style.py that returns 'white', 'black' or None for the side that first captured a queen when both queens left the board within two plies. Test it on Yurtaev – Carlsen 2004 (expected: 'white', 12.Qxd8).

Hint

Replay the moves; when a capture removes a queen, record the capturing side and the ply; if the other queen leaves the board within the next two plies, return the side of the first capture. Then split qoff20 into qoff20_initiated and qoff20_accepted, and compare their split-half reliabilities with the original.


Part D — Judgment & Transfer ⭐⭐⭐

D1. A coach tells a 1300-rated student: "You're an aggressive player; play the King's Gambit." Using the Lichess band table (material-giving 3.86 per 100 moves below 1200, 2.91 at 1200–1399; sharpness–ACPL correlation 0.86 at 1200–1399), write the coach a short, respectful reply.

Model answer

At 1200–1399, games that look aggressive are mostly games with blunders: material-giving moves are frequent, and how wildly a game swings tracks how inaccurate it was (r = 0.86). Before choosing an opening for "style", check whether the student's material-giving moves are sound. If most are not, the priority is tactical safety; the King's Gambit may still be fun and instructive, but not because the data says the student is aggressive.

D2. Grace's opponent file says "positional player, avoids sharp lines" based on 25 games. What would you measure instead, and how many games would you want?

Model answer

Measure the clock: share of time spent on moves 1–12 and time concentration on the five longest moves. These were reliable at about forty games (0.75 and 0.87 among 2400+ OTB players). Board features such as material-giving or opposite castling needed far more games (reliability 0.19 and 0.22 at forty). Report everything with its sample size; with 25 games, treat even the clock as a hint.

D3. Engine versus human. Petrosian's 14...Nfd7 was a "deviation" at depth 16 and the engine's first choice at depth 20. What does that imply for style features built from engine top-move matches?

Model answer

Near-equal moves change rank with depth (and with multipv). A top-match or deviation feature computed at one depth partly measures that depth's opinions, not the player's. Its reliability was low (complicating deviations 0.04 at forty games). Such features need deeper searches, multipv, and a tolerance (e.g. "within 0.2 pawns of the best") rather than exact matches.

D4. What changes between 1200 and 2000 for the usefulness of style analysis? Give two features that behave differently across that range.

Model answer

At 1200 errors dominate every swing-based and material-based feature; at 2000 they matter less and choices start to show. Tension rises with rating (4.91 at 1200–1399 to 5.21 at 2000–2199 on Lichess blitz), material-giving falls (2.91 to 1.97), and time concentration rises (0.470 to 0.512). Style analysis becomes meaningful only once skill-driven variation shrinks.


Part M — Mixed / Interleaved ⭐⭐–⭐⭐⭐

M1 (with Chapter 11 — Combinations). Chapter 11 found that the share of sound sacrifices rises from 8.2% in Lichess games below 1000 to 87.2% in OTB games at 2400+ (from level positions). Combine that with this chapter's band table: estimate how many sound material-giving moves per 100 moves a sub-1200 player makes, and compare with a 2400+ player. State your assumptions.

Model answer

Assume Chapter 11's sound shares apply to this chapter's material-giving moves (they were measured on sacrifices from level positions, a narrower set — that is the key assumption, and it is shaky). Below 1200: 3.86 × 0.082 ≈ 0.32 sound material-giving moves per 100 moves. At 2400+: 1.70 × 0.872 ≈ 1.48 (mixing pools: Lichess 2400+ blitz for the rate, OTB 2400+ for the share — say so). The strong player gives up less material in total but makes several times more sound sacrifices. "Aggression" defined as sound sacrifice is a feature of strong play — the opposite of what raw give100 suggests.

M2 (with Chapter 13 — Practical Decision-Making). Chapter 13 showed blunders rise sharply as the clock runs low. Design a study using the broadcast data that tests whether players with high time concentration (time_top5) reach time trouble more often. What confounders would you control for?

Model answer

Per player-game, record time_top5 over moves 1–30 and whether the player's clock fell below 10% of the base before move 40; correlate across players, using each player's mean as the unit to avoid pseudo-replication. Confounders: rating (stronger players concentrate more and may manage the clock better), time control (base and increment differ between events), opening (theory-heavy openings save early time) and game difficulty (hard positions both demand long thinks and cause time trouble). Control with rating bands, a single time control, and a difficulty proxy such as the number of large swings.

M3 (with Chapter 4 — King Safety). Chapter 4 found that counting attackers aimed at the king tracks the evaluation better than measuring the pawn shelter. Using king_pressure, check in the 22-player samples whether per-game king pressure predicts the player's score in that game. Is it a style feature, a skill feature, or both?

Hint

Fit a logistic or linear model of the per-game score on per-game kpress, with and without the game's ACPL as a covariate. If king pressure predicts the score only until ACPL is added, it is mostly a skill (or position-quality) feature; if it keeps predictive power, it carries something else — but remember the direction of causality is unclear: pieces aimed at the king may be the result of an opponent's errors.

M4 (with Chapter 24 — Opponent Preparation). Add a "clock profile" section to the Chapter 24 scouting report: opening time share and time concentration with bootstrap intervals and the reference percentiles of the population in 33.6. Write the two sentences of advice it would print for an opponent in the top quarter of opening time share.

Model answer

Example output for an opponent in the top quarter of opening time share: "This player spends an unusually large share of the clock on moves 1–12 (top 25% of 2400+ OTB players, measured over N games, interval shown). Steer toward an early position they are unlikely to know, keep the game complex into the middlegame, and expect them to be shorter of time than you by move 30." The report must print N and the interval: with fewer than about forty games, write "hint", not "trait".

M5 (with Chapter 29 — History). Chapter 29 compares champions' accuracy by era. Re-run this chapter's PCA on the champions using only champions whose sampled games have a mean year after 1960. Does the aggressive ↔ solid axis survive without the early era?

Model answer

Filter prof.year > 1960 (this keeps Tal, Petrosian, Spassky, Fischer, Karpov, Kasparov, Smyslov and the modern players — check the list), refit style.fit_style_space and read PC1's loadings and explained variance. If sharpness, material-giving, tension and opposite castling still load together against draws, the axis is not just "old vs new". With fifteen or so players, add the bootstrap ARI and the Gaussian-null silhouette before claiming anything about clusters.


Part E — Research & Extension ⭐⭐⭐⭐

E1. A style instrument with honest reliability. Design a set of at most six style features that each reach a split-half reliability of 0.7 at 100 games in the OTB 2400+ population and correlate with ACPL at |r| < 0.3. Report the features, their reliability curves by sample size, and a PCA of the result. Is there still no evidence for types?

E2. Style within players over time. Using the broadcast panel (players with games in both the first and last four months of the window), test whether players' clock and tension features change over the year. Compare with the Hikaru 2014–2019 vs 2020–2026 result. What would count as evidence that someone changed style?

E3. Engines with styles. Analyse games between two engines (the broadcast data's flagged TCEC games) with the same features. Do engine games show the same aggressive ↔ solid axis? What does the answer suggest about which part of human style comes from errors?