Chapter 34 Exercises — Pit Stop Analytics
Difficulty: ⭐ concept check · ⭐⭐ calculation or short code · ⭐⭐⭐ multi-step analysis · ⭐⭐⭐⭐ open research
All data come from the book's snapshot: OpenF1 races 2023–2026 (to the Las Vegas GP), Jolpica race pit
stops 2011–2026, and the reference tables in data/reference/. Load stops with
from boxbox import pitstops as ps. Numeric answers quoted here come from the chapter's scripts; if
yours differ, check your filters first.
Part A — Concepts ⭐
A1. Define stationary time, pit-lane time and pit loss in one sentence each. For each, name the source in the book's data that measures it, and say how complete that source is.
A2. A headline reads "Ferrari's 22-second pit stop cost Leclerc the win". Which clock is the number most likely to be, and what would you check before using it?
A3. Explain in your own words why we subtract the race median before comparing pit-lane times across circuits. What does the subtraction remove, and what does it keep?
A4. The 1.80 s record is sometimes credited to Red Bull. Who set it, where, and which file in the book's data supports that? Who held the record before it?
A5. Why is the DHL fastest-stop table useless for ranking crews on reliability?
A6. List the five filters that turn "all race stops" into the crew sample. For each, give one example of a slow stop it removes that is not the crew's fault.
A7. Section 34.3 found a season-to-season rank correlation of 0.763 for teams' median stops but 0.252 for their slow-stop shares. State the practical consequence for (a) ranking crews and (b) feeding a simulator.
A8. Why are double stacks concentrated under safety cars? Give two reasons, one about pit loss and one about the field.
A9. A race-control thread ends with "WILL BE INVESTIGATED AFTER THE RACE". What can and can't you conclude about the incident from the book's data?
A10. Name three things about a pit stop that the free timing data cannot see, and for one of them say where a sourced answer could come from.
Part B — Calculations & Physics ⭐⭐
B1. Pit-lane transit. A pit lane is 400 m from entry line to exit line, and the limit is 80 km/h. Using the chapter's model with braking and launch both at 1 g (🧪 assumption), and a 2.5 s stationary time, compute the pit-lane time. Then redo it at 60 km/h.
Solution
At 80 km/h, $v$ = 22.22 m/s. Cruise $D/v$ = 400/22.22 = 18.00 s. Manoeuvre = $v/2a_b + v/2a_a$ = 22.22/19.62 × 2 = 2.27 s. Total = 18.00 + 2.5 + 2.27 = 22.77 s.
At 60 km/h, $v$ = 16.67 m/s. Cruise = 24.00 s. Manoeuvre = 16.67/19.62 × 2 = 1.70 s. Total = 24.00 + 2.5 + 1.70 = 28.20 s. The lower limit adds 6.00 s of cruise and saves 0.57 s of manoeuvre: 5.43 s net. (This is an illustrative model; real lanes have different lengths.)
B2. Implied lane length. At the Hungaroring, the median transit time (pit-lane time minus stationary time) was 19.15 s (2024–26). Using the 2.27 s manoeuvre term at 80 km/h, what lane length does that imply? Why is this only a sanity check?
Solution
$D = v(t_{\text{transit}} - \text{manoeuvre}) = 22.22 \times (19.15 - 2.27) = 22.22 \times 16.88 \approx$
375 m, as in the chapter's output. It is only a sanity check because the manoeuvre term rests on
assumed accelerations, the cars don't drive the whole lane at exactly the limit, and stop_s is rounded
to 0.1 s.
B3. The mixture's expected stop. For the 2023–2026 crew sample, the mixture fit gives core median −0.079 s, $p$ = 0.084 and mean excess $m$ = 4.77 s above the 2 s threshold. Compute $E[r]$ and the expected tail cost per stop. Over a two-stop race, how much time does the tail cost an average team in expectation?
Solution
$E[r] \approx (1-p)\mu + p(c+m) = 0.916 \times (-0.079) + 0.084 \times 6.77 = -0.072 + 0.569 =$ 0.496 s. Tail cost $p \times m = 0.084 \times 4.77 =$ 0.40 s per stop. Over two stops that is about 0.80 s in expectation, almost all of it in the rare races where something goes wrong.
B4. Shrinkage. A team has 4 slow stops in 35 crew-sample stops in 2026, and the field rate is 10.8%. With a prior worth 40 stops, compute the shrunk slow-stop risk. Then compute it for 4 in 70.
Solution
$\hat p = (4 + 40 \times 0.108)/(35 + 40) = 8.32/75 =$ 0.111 (11.1%). The raw rate, 4/35 = 11.4%, is already close to the field rate, so shrinkage moves it only slightly. This matches McLaren 2026 in the chapter (11.12% with the unrounded field rate). For 4 in 70: raw 5.7%; $\hat p = 8.32/110 =$ 0.076 (7.6%). The larger sample keeps more of its own rate.
B5. Places for seconds. On average a second of delay costs 0.075 places, and 0.220 places in the front six. A front-runner has a 3.5 s slow stop. What is the expected number of places lost from the delay? From the binned table in Section 34.5, what is the chance it loses at least one?
Solution
Front-six rate: 0.220 × 3.5 ≈ 0.77 places expected. Field rate: 0.075 × 3.5 ≈ 0.26. From the table, stops 3–5 s slow lost at least one place 43% of the time (all positions pooled). For a front-runner, expect higher, consistent with the larger front-six rate.
B6. Break-even with a bad crew. Chapter 12's break-even for an extra stop is pit loss ÷ fresh-tyre advantage: 22.512 / 1.078 = 20.9 laps. Williams's 2026 crew costs an expected 1.274 s per stop above the base. Compute Williams's break-even. How many laps does the crew add?
Solution
(22.512 + 1.274)/1.078 = 23.786/1.078 = 22.07 laps, about 1.2 laps longer than the 20.9-lap average. A tail-heavy crew should prefer fewer stops, other things being equal.
B7. The penalty stop. A car serves a 10 s time penalty at its stop and its rel_s is +11.4 s. Using
the chapter's finding that penalty stops run a median 1.10 s beyond the penalty, how much of the 11.4 s
would you attribute to the crew? Is this a slow stop by the crew-sample definition?
Solution
11.4 − 10 = 1.4 s beyond the penalty, only about 0.3 s more than the typical penalty-stop overrun (1.10 s). Little or none of it is a crew error. It isn't in the crew sample at all, because a time penalty was pending, so it can't be a crew-sample slow stop.
B8. Rounding or a different clock? OpenF1 rounds stop_s to 0.1 s; DHL reports to 0.01 s. At the
2025 Qatar GP, OpenF1's fastest stop is 1.8 s and DHL's is 2.08 s. What is the largest difference
rounding alone could produce? What do you conclude? At the 2025 Italian GP the values are 1.9 and 1.91 s.
Is that consistent with rounding?
Solution
A value reported as 1.8 s could be anything from 1.75 to 1.85 s, so rounding alone can produce at most about 0.05 s of difference from a true value, plus DHL's own 0.005 s. The Qatar gap of 0.28 s is more than five times that, so the two systems are not measuring the same thing in the same way (a different start or end trigger, for example). At Monza, 1.91 s rounds to 1.9 s exactly, so that pair is consistent with rounding.
Part C — Data & Code ⭐⭐–⭐⭐⭐
C1. Analyze this session ⭐⭐. 2025 Italian Grand Prix, Race. Run ps.openf1_stops(2025), keep that
race, and print every stop's stop_s, pit_lane_s, rel_s and penalty_s. Then regress pit_lane_s
on stop_s for that race alone. Expected shape: 19 stops, all green; a slope near 1 but with a wide
interval, because one race has few stops. Which two stops have the largest influence on the fit, and
why?
Hints
Start from O = ps.openf1_stops(2025) and s = f1data.session(2025, "monza", "R"), then keep
O[O.session_key == s.session_key]. Fit with statsmodels OLS and compute leverage with
get_influence().hat_matrix_diag. Look at Stroll's 16.2 s stop and Ocon's 8.6 s penalty stop (Case
Study 1). Points far from the bulk on the x-axis dominate a 19-point regression, and Ocon's penalty makes
his stop a poor test of the crew. Refit without the penalty stop and compare the slope.
C2. Compare these drivers ⭐⭐. For 2025, compare the stops of Lando Norris and Oscar Piastri. Use the
crew sample and stop_s. Report each driver's n, median, IQR and number of stops over 3.0 s. Same
crew, same car: is there evidence that one driver's stops are systematically slower? Expected shape:
two rows with medians a tenth or two apart and overlapping IQRs; argue whether any difference is crew,
driver (entry and box positioning) or noise.
Hints
C = ps.crew_sample(ps.openf1_stops(2025)); C[(C.team_ref == "mclaren") & C.stop_s.notna()], grouped
by acronym. With about 25 stops per driver, a bootstrap CI on each median will be several tenths
wide. Before you call a difference, think about which stops each driver drew. The second car of a
double stack (Section 34.7) is one systematic reason a driver's stops could look slower.
C3. Build the table ⭐⭐. Reproduce the 2011–2026 Jolpica season table of Section 34.3 (median,
IQR, slow share with Wilson CI) from ps.jolpica_stops(). Then add one column: the slow share
excluding the 10% of stops with the largest rel_s in each season. Expected shape: 16 rows; the new
column is lower in every season. Explain why trimming the top 10% is not a fair way to remove penalties.
C4. Analyze this session ⭐⭐⭐. 2026 British Grand Prix, Race. For every stop with rel_s > 4 s,
compute places_lost_to_delay and compare it with pos_out − pos_before. Expected shape: six or so
rows; Antonelli's lap-41 stop shows a large position change. Explain each disagreement between the two
columns (cars pitting on the same lap, lapped cars, the end of a safety car).
Hints
places_lost_to_delay counts only cars on the same lap that crossed the line inside the delay window.
pos_out − pos_before also moves when cars around you pit on the same lap (you can gain a place that
way), when a car retires, and when a neutralisation reshuffles gaps. Albon's lap-1 stop at this race,
from the back of the field, is a good test case: a 14.6 s delay with almost nobody near him.
C5. Build the strategy ⭐⭐⭐. Extend code/09_stop_time_in_the_sim.py. For k = 1, 2 and 3 (the
defender stops one to three laps later), compute P(gain > gap) for gaps 0–3 s for a Ferrari attacker
against a Cadillac defender in 2026. Expected shape: three curves, shifted right as k grows, each
starting near 0.9. At what gap does each curve cross 50%?
Hints
Call undercut.undercut_gain(20, k=k, ...) for each k to get the deterministic gain, then add the
crews' draws exactly as in the script (gain = g["gain_s"] + (rd - ra)). The 50% crossing is the median
of gain, so you can read it directly with np.median(gain). For k = 1 the chapter's run gives a
median gain of 2.132 s for this pairing. Larger k adds about one deterministic gain per extra lap.
C6. Predict the race ⭐⭐⭐. Use sample_stop_time (method "mixture", with each team's shrunk
slow-stop rate in place of p_slow) to forecast each 2026 team's total pit-stop cost for a two-stop
Qatar race. Base: the losail pooled green-flag pit loss from the book's pit-loss table (27.548 s,
2023–25). Expected shape: an 11-row table of mean, P10 and P90 of the two-stop total. Which team has
the widest P10–P90 band, and why?
C7. Compare these teams ⭐⭐⭐. Use ps.persistence(ps.jolpica_stops(), "median_rel_s") and plot each
lineage's median rel_s in season t against season t + 1, 2011–2026. Label the three biggest
year-to-year improvements. Expected shape: a scatter with a clear positive slope (Spearman 0.763
pooled) and a few large off-diagonal points, which are usually new or restructured teams.
C8. Build the table ⭐⭐⭐. Using ps.pit_lane_incidents(("FP1", "FP2", "FP3", "Q", "SQ", "R", "S")),
make a session-kind × category table for 2023–2026. Expected shape: qualifying has more unsafe releases
than races (the chapter counts 25 against 18). Explain why qualifying produces more release incidents.
Hints
In qualifying the whole field leaves the garages within a few minutes of a session start or a red flag, and the fast lane fills. In a race, stops are spread over the laps and most releases have clear lane. Check the timestamps: group qualifying release incidents by minutes after the session (or segment) start.
Part D — Strategy & Judgment ⭐⭐⭐
D1. Call the pit stop: 2026 British GP, Ferrari under the late safety car. At the end of lap 47 of 52, Leclerc leads Hamilton by 20.309 s and Russell by 32.490 s. Both Ferraris are on HARDs (21 and 23 laps old), Russell on 18-lap-old MEDIUMs. The SC pit loss is 12.722 s [11.02, 14.50]. Decide, before opening the reveal: stop neither, stop Leclerc only, or stop both? If both, what minimum separation between the cars would you ask for?
Reveal and discussion
Ferrari stopped both on lap 48, 27.3 s apart by the pit timestamps, so there was no queue. Hamilton's stop was 0.852 s quicker than the race median. His 12.181 s cushion over Russell sat inside the SC pit-loss interval, and Russell, who stayed out, came out 0.887 s ahead. Russell finished second, 0.345 s ahead of Hamilton. A defensible alternative was "Leclerc only": his 32.5 s cushion made his stop free, and Hamilton would have defended P2 on old hards for four laps against a car on 19-lap-old mediums. Which is better depends on how much four laps of fresh softs were worth against the near-certainty of keeping track position, and that is a Chapter 14 question.
D2. Call the pit stop: 2025 Italian GP, McLaren's order. It's lap 44. Norris leads Piastri by 3.589 s, and Verstappen has already stopped. Both McLarens need one stop. You can stop Piastri first (lap 45) and Norris second (lap 46), or the reverse. Using only this chapter's tools (the crew distribution and the places-lost logic) and Case Study 1's counterfactuals, which order exposes the team to less risk of the leader losing the lead in the stops? What would you need to know that the data don't contain?
Discussion
Stopping the leader first removes the undercut effect between team-mates: the second car to stop loses a lap on old tyres, worth about 1.8 s here (Case Study 1). In the order actually used, Norris's lead was expected to shrink from 3.6 s to about 1.7 s even with two ordinary stops, leaving him exposed to any delay above about +1.7 s, roughly the crew sample's P90. Stopping Norris first keeps his lead near 3.6 s plus that lap's advantage. What the data don't contain: the team's priorities between its drivers, what each driver was told, and any reason for choosing the order. Those are statements, not timing.
D3. Design the setup: the pit-crew procedure. You run the pit operations of a midfield team whose median stop is fine but whose slow share is 17%. You have budget for one of: (a) faster wheel guns that cut the median stationary time by 0.2 s, or (b) a procedure change that halves the slow-stop rate without changing the median. Using the mixture model and the 2025 Williams numbers (slow 17.4%, mean excess 4.12 s), which saves more time per stop in expectation? Is expectation the right criterion for a team chasing points?
Discussion
(a) saves 0.2 s per stop on every stop. (b) halves the tail cost $p \times m$: from 0.174 × 4.12 = 0.72 s to 0.36 s, a saving of about 0.36 s per stop. On expectation, (b) wins. It also cuts the variance, which matters more when a single bad stop can cost a points finish: the places-lost table shows that large delays are where positions go. A team chasing a specific result should value the tail cut even more than the expectation suggests.
D4. Judgment: publishing a crew ranking. A website ranks 2026 pit crews by "average stop time",
using all OpenF1 stop_s values, with Cadillac last and Ferrari first. List every methodological
objection from this chapter, in order of importance, and say which of them would change the order.
Discussion
- Penalty stops are included. A 5 s or 10 s penalty served at a stop shows up as a 7–12 s "stationary time" (Section 34.4). This can change the order for any team that served several.
- Neutralised and wet stops are included. SC queues, double stacks and wet stops inflate some teams' figures more than others.
- "Average" means the mean, which the tail dominates. Mercedes 2026 has the quickest median but one disaster. On the median Mercedes ranks first, and on the mean it drops into a group (Section 34.9).
- Coverage:
stop_scovers 71.1% of 2026 race stops, and not uniformly. - Sample size: 20–40 stops per team, so the middle of the table isn't separable (Section 34.6).
- Rounding:
stop_sis rounded to 0.1 s, so ties are common at the top.
Objections 1, 3 and 5 can change the order. Cadillac would very likely stay last on any reasonable
method (median +0.96 s in the crew sample). Ferrari "first" depends on the measure: on the crew-sample
median rel_s, Mercedes leads.
Part M — Mixed / Interleaved ⭐⭐–⭐⭐⭐
M1. (Chapters 12 and 34) ⭐⭐. Chapter 12's break-even for an extra stop uses one pit-loss number per circuit. Recompute the one-stop against two-stop decision for the 2026 Barcelona GP (Chapter 12's worked race, green pit loss 23.682 s) with a Cadillac-like crew (expected +1.507 s per stop) and a Ferrari-like crew (−0.017 s). How much does the crew change the two-stop margin? Is it enough to flip the decision Chapter 12 found?
Sketch
Each extra stop costs the crew's expected excess once more. Going from two stops to three adds 1.507 s for the Cadillac-like crew and saves 0.017 s for the Ferrari-like one, a gap of about 1.52 s per extra stop between the two crews. Compare that with Chapter 12's margins for that race: the best 3-stop under the 2026 allocation was +3.994 s against the best 2-stop. The crew effect moves the margin but does not flip that decision. Look for races where the margin between stop counts is under a second; there the crew can decide it.
M2. (Chapters 13 and 34) ⭐⭐⭐. Chapter 13 found that the attacker's pit loss was lower than the
defender's in 73.6% of successful undercuts but only 30.2% of failures. Using the undercut pairs from
undercut.study(), join each pair's two stops to ps.openf1_stops() and split the pit-loss difference
into its stationary part (stop_s difference, 2024–26) and the rest. How much of "stop execution" is
the crew's box work?
M3. (Chapters 14 and 34) ⭐⭐⭐. Chapter 14's near-field SC pit loss is 12.722 s. Do second cars in a
double stack under SC lose more than that? Compute the near-field SC pit loss (Chapter 14's
near_field_pit_loss) separately for first cars, second cars and non-stacked stops in 2023–2026, and
compare the medians with bootstrap CIs.
M4. (Chapters 2 and 34) ⭐⭐. Chapter 2 introduced RaceData and the data checks. Write a check that
flags every race where OpenF1's stop_s coverage is under 50% of race stops, and list the 2026 races it
flags. Why does a coverage check belong in the data layer, not in each analysis?
M5. (Chapters 21 and 34) ⭐⭐⭐. Chapter 21 used a teammate chain to compare drivers across teams.
Could a similar chain compare pit crews across eras, using drivers who changed teams? Explain why it
would fail, using what this chapter found about what rel_s measures.
Part E — Research & Extension ⭐⭐⭐⭐
E1. The 2014 step. The median Jolpica pit-lane time rose about 1.4 s between 2013 and 2014. Use the per-circuit medians for circuits raced in both seasons to test whether the step is everywhere (a rule change or lane change everywhere) or concentrated at a few circuits (lane or calendar changes). Find sourced pit-lane speed limits for those seasons if you can, and add them to your analysis as a sourced table. Report what the data support and what they don't.
E2. A better slow-stop model. The core-plus-exponential mixture underestimates the P90 (+0.94 s against +1.60 s). Propose and fit a better model, such as a three-part mixture with a "minor problem" component, or a skew-t core. Compare it with the chapter's mixture on held-out 2026 races (fit on 2023–2025), using the log-likelihood and the P90/P95/P99 errors. Does the better fit change any simulator decision in Section 34.9?
E3. Do crews choke? Using the crew sample, test whether stops are slower (higher rel_s or slow
share) when the stakes are higher: the car running in the top three, the last third of the race, or a
car within 3 s behind at the in-lap. Control for team-season. Report effect sizes with intervals, and
discuss what you could and could not conclude about "pressure" from timing data alone.