Chapter 22 Exercises: Match Strategy and Tactics
Section 22.1: Formation Analysis
Exercise 1: Formation Template Construction
Create a set of canonical formation templates (4-4-2, 4-3-3, 3-5-2, 4-2-3-1, 5-3-2) as NumPy arrays of shape (10, 2), using a normalized pitch coordinate system where the pitch spans [0, 1] in both dimensions. Ensure the positions are realistic---for example, in a 4-3-3, the wingers should be wider than the central midfielder.
Exercise 2: Hungarian Algorithm Application
Given the following player positions (in meters) and a 4-4-2 template, use the Hungarian algorithm to find the optimal assignment and compute the total cost:
Players: [(15, 10), (15, 25), (15, 43), (15, 58), (40, 15), (38, 28), (42, 40), (40, 53), (65, 22), (63, 46)]
Template (4-4-2): [(18, 12), (18, 27), (18, 41), (18, 56), (42, 12), (42, 27), (42, 41), (42, 56), (65, 25), (65, 43)]
Exercise 3: Formation Compactness
Compute the compactness of the following team shape using the eigenvalues of the covariance matrix of player positions. Is this team more stretched vertically or horizontally?
Positions (meters, x=length, y=width):
[(20, 15), (22, 25), (18, 43), (21, 55),
(45, 12), (43, 34), (47, 50),
(68, 18), (70, 34), (66, 50)]
Exercise 4: Dynamic Formation Detection
Write a function that takes a time series of player positions (shape (T, 10, 2)) and a set of formation templates, and returns the detected formation at each time step. Apply it to simulated data where the team switches from 4-4-2 to 4-3-3 at $t = 45$.
Exercise 5: Formation Transition Matrix
Given a sequence of detected formations over 38 matches (sampled every 5 minutes), compute the formation transition matrix. Which transitions are most common? Which formations are most "sticky" (highest self-transition probability)?
Exercise 6: Voronoi-Based Defensive Coverage
Implement the Defensive Coverage Index (DCI) from Section 22.1.4. Given 4 defender positions and a defensive third boundary, compute the Voronoi tessellation and calculate the fraction of the defensive third covered. Use scipy.spatial.Voronoi.
Section 22.2: Tactical Fingerprinting
Exercise 7: Fingerprint Computation
Using the following per-match data for Team A (10 matches) and league averages (all 20 teams), compute Team A's standardized tactical fingerprint:
| Dimension | Team A Mean | League Mean | League SD |
|---|---|---|---|
| Possession % | 62.3 | 50.0 | 8.5 |
| PPDA | 10.2 | 13.4 | 2.8 |
| Directness | 0.31 | 0.38 | 0.05 |
| Pressing intensity | 2.4 | 1.6 | 0.5 |
| Width in attack | 42.1 | 35.6 | 7.2 |
Exercise 8: Radar Chart Visualization
Create a radar chart comparing the tactical fingerprints of three teams: a possession-dominant team, a counter-attacking team, and a pressing team. Use at least 8 tactical dimensions and ensure the chart is clearly labeled.
Exercise 9: Style Clustering
Generate synthetic tactical fingerprint data for 20 teams across 10 dimensions. Apply $k$-means clustering with $k = 3, 4, 5$ and use the silhouette score to determine the optimal number of clusters. Visualize the clusters using PCA.
Exercise 10: Cosine Similarity Matrix
Compute the pairwise cosine similarity matrix for 6 teams given their tactical fingerprints. Identify which pair of teams is most similar and which is most different.
Exercise 11: Season-Over-Season Style Evolution
Design a method to track how a team's tactical fingerprint evolves over a season using a rolling window of 5 matches. Plot the trajectory of 3 key dimensions over 38 matchdays. Discuss what events might cause sudden shifts (e.g., managerial change, key player injury).
Exercise 12: Fingerprint Stability
Compute the match-to-match variance of each fingerprint dimension for a team over 10 matches. Which dimensions are most stable? Which are most variable? What does this tell you about the team's tactical consistency?
Section 22.3: Opponent Analysis
Exercise 13: Build-Up Channel Analysis
Given a dataset of 500 passes from a team's last 5 matches, classify each pass as left channel, central channel, or right channel (using pitch thirds). Compute the percentage for each channel and identify the dominant build-up side. Test whether the distribution is significantly different from uniform using a chi-squared test.
Exercise 14: Passing Network Construction
Build a directed weighted passing network from event data. Compute betweenness centrality for each player and identify the key pivot player(s). Visualize the network on a pitch diagram with edge widths proportional to pass frequency.
Exercise 15: Defensive Vulnerability Heatmap
Create a heatmap of xG conceded by pitch zone (divide the pitch into a 6x4 grid). Identify zones where the opponent concedes significantly more xG than the league average. Overlay the heatmap on a pitch diagram.
Exercise 16: Temporal Vulnerability
Analyze xG conceded in 15-minute intervals across 10 matches. Test whether the opponent concedes significantly more in the final 15 minutes compared to other intervals using a paired t-test.
Exercise 17: Set-Piece Categorization
Classify 50 corner kicks by delivery type (inswinger, outswinger, short, driven low) and target zone (near post, far post, penalty spot, edge of box). Compute the xG per delivery type and identify the most dangerous combination.
Exercise 18: Counter-Press Effectiveness
Define a counter-press as a ball recovery within 5 seconds and 20 meters of the initial loss of possession. Compute the counter-press success rate for a team and the xG generated from counter-press recoveries vs. other recoveries.
Section 22.4: In-Game Tactical Adjustments
Exercise 19: Change-Point Detection
Apply the change-point detection method from Section 22.4.2 to the following xG rate series (xG per 5-minute window):
[0.05, 0.08, 0.04, 0.06, 0.07, 0.05, 0.03, 0.06,
0.15, 0.18, 0.12, 0.14, 0.16, 0.11, 0.13, 0.17, 0.14, 0.15]
Identify the change point and test its statistical significance.
Exercise 20: Pressing Intensity Monitoring
Track PPDA in 10-minute rolling windows throughout a match. Plot the time series and identify any significant shifts. Correlate PPDA changes with known tactical events (substitutions, goals, red cards).
Exercise 21: Defensive Line Height Tracking
Compute the average y-coordinate of the deepest 4 outfield players at each minute of a match. Plot the defensive line height over time and identify any systematic changes.
Exercise 22: Real-Time Dashboard Design
Design (on paper or as a wireframe) a real-time tactical dashboard for use during a match. Include at least 6 widgets showing: formation display, momentum graph, pressing stats, fatigue indicators, key matchup stats, and win probability. Justify your layout choices.
Section 22.5: Substitution Strategy
Exercise 23: Substitution Timing Analysis
Using a dataset of 1,000 matches, analyze the relationship between substitution timing (minute of substitution) and match outcome (win/draw/loss). Control for game state at the time of substitution. Present your findings as a visualization showing outcome probability by substitution minute.
Exercise 24: Fatigue Curve Modeling
Fit the fatigue model from Section 22.5.4 to the following data for a midfielder:
| Minute | Distance (km) | Sprint Distance (m) | Accelerations | Performance Rating |
|---|---|---|---|---|
| 15 | 1.8 | 120 | 8 | 9.2 |
| 30 | 3.5 | 210 | 14 | 9.0 |
| 45 | 7.1 | 280 | 18 | 8.8 |
| 60 | 8.6 | 330 | 21 | 8.3 |
| 75 | 9.9 | 360 | 23 | 7.8 |
| 90 | 11.1 | 380 | 24 | 7.2 |
Predict the performance rating at minute 80 and determine when the player should be substituted (when predicted rating drops below 8.0).
Exercise 25: Substitution Impact Score
Compute the Substitution Impact Score for the following scenario: - Player being taken off: 0.15 xG/90, 0.10 xA/90, current fatigue level high (projected 40% performance decline over remaining 30 minutes). - Substitute: 0.25 xG/90, 0.05 xA/90, fresh. - Game state: Losing 0-1, 60th minute.
Define a reasonable weighting scheme and compute the SIS.
Exercise 26: Optimal Substitution Simulation
Simulate 10,000 match scenarios where a team is losing 0-1 at the 55th minute. Model the effect of substituting at minutes 55, 60, 65, 70, and 75, using simple goal-scoring rates that depend on game state and freshness. Determine the optimal substitution time.
Section 22.6: Game State Analysis
Exercise 27: Game-State-Adjusted xG
A team has the following xG generation by game state:
| Game State | Minutes | xG Generated |
|---|---|---|
| Losing | 450 | 30.5 |
| Drawing | 900 | 35.2 |
| Winning | 1,050 | 24.1 |
Compute the per-90 xG for each game state. Then compute the game-state-adjusted xG per 90, using league-average proportions of time spent in each state (30% losing, 35% drawing, 35% winning).
Exercise 28: Win Probability Model
Build a logistic regression win probability model using the following features: score difference, time remaining (minutes), xG difference, venue (home=1, away=0), and numerical advantage. Train on a simulated dataset of 5,000 match-minute observations and evaluate using cross-validation.
Exercise 29: Markov Chain Score Model
Construct a Markov chain model for score progression with states $\{-2, -1, 0, +1, +2\}$ (capping at $\pm 2$). Estimate transition probabilities from the following goal rates: - Team goal rate: 1.5 per 90 minutes - Opponent goal rate: 1.0 per 90 minutes
Compute the probability of each final score after 90 minutes, starting from 0-0.
Exercise 30: Score Effect Quantification
Using the tactical fingerprint framework, compute the score effect vectors $\Delta \mathbf{v}_{+1}$ and $\Delta \mathbf{v}_{-1}$ for a team with the following data:
| Dimension | Drawing | Winning +1 | Losing -1 |
|---|---|---|---|
| Possession % | 55 | 48 | 60 |
| PPDA | 10 | 14 | 8 |
| Directness | 0.35 | 0.42 | 0.30 |
| Pressing intensity | 1.8 | 1.2 | 2.5 |
| Territorial dominance | 0.52 | 0.40 | 0.62 |
Compute the magnitude of each score effect vector and interpret which game state causes the largest behavioral change.
Section 22.7: Communicating Tactical Insights
Exercise 31: Pre-Match Report
Draft a one-page executive summary for a pre-match report against a team with the following profile: - Formation: 4-2-3-1 - Style: High-pressing, possession-based - Weakness: Vulnerable to quick transitions through the left channel - Key player: Central midfielder who is the primary build-up pivot
Include at least two data visualizations (describe what they show).
Exercise 32: Pitch Visualization
Create a publication-quality pitch visualization showing: 1. The opponent's average formation (player positions as circles) 2. Pass flow arrows showing the top 5 passing connections 3. A shaded zone highlighting the identified vulnerability area
Use matplotlib and the draw_pitch function from Section 22.7.6.
Exercise 33: In-Game Alert System
Design an automated alert system that monitors tactical metrics during a match and generates alerts when thresholds are crossed. Define at least 5 alert types with specific triggers, priority levels, and suggested messages. Implement the alert logic in Python.
Exercise 34: Post-Match Analysis Report
After a match that ended 2-1 (your team won), create a post-match analysis that includes: 1. xG timeline showing when goals were scored vs. expected 2. Formation comparison between first half and second half 3. Substitution impact analysis 4. Three key tactical findings with supporting data
Exercise 35: Visualization Critique
Critique the following visualization choices and suggest improvements: 1. A bar chart showing 20 tactical dimensions for 2 teams (40 bars) 2. A 3D scatter plot of team positions during a match 3. A table of 50 numerical statistics printed on A4 paper for half-time review 4. A heat map using a red-green color scale
For each, explain why it might be ineffective and propose a better alternative.