Chapter 14 Exercises — Safety Cars, VSCs, and Red Flags

Difficulty: ⭐ recall and concepts · ⭐⭐ calculation or a short script · ⭐⭐⭐ multi-step analysis or judgement · ⭐⭐⭐⭐ open-ended research

All data come from the book's free snapshot (OpenF1 2023 → 2026 R21; Jolpica 1950 → 2026 R21). Every script runs offline from data/processed/. Where an answer is numeric, it comes from the chapter's own runs; if your run differs, check your filters first.


Part A — Concepts ⭐

A1. Name the three kinds of neutralisation in modern F1 and, for each, say what happens to (a) the gaps between cars and (b) the cost of a pit stop.

Answer
  • Safety car (SC): the field queues behind a physical car, so gaps collapse (the leader-to-P10 spread kept a median 14% of its size in 2023–26). A stop costs a median 12.7 s (near-field), about 55% of a green stop.
  • Virtual safety car (VSC): every car slows to a delta time, so gaps stay roughly frozen (median after/before ratio 1.06). A stop costs a median 15.7 s, about 65% of a green stop.
  • Red flag: the race is suspended and cars wait in the pit lane; tyres may be changed, so a tyre change costs nothing, and the restart resets the gaps.

A2. Why does the pit-lane time hardly change under a safety car while the pit loss falls by about 10 s?

Answer

The pit lane has a speed limit, so the time spent in it is set by the limit, not by the race (23.3 s green vs 23.6 s SC, median). The loss is the lane time minus the time the car would have spent driving the bypassed stretch of track (plus slowdown and warm-up). Under an SC the field drives that stretch slowly, so the difference shrinks.

A3. What is an incident in this chapter, and why do we count incidents rather than deployments when fitting a hazard?

Answer

An incident groups SC, VSC and red-flag windows that overlap or follow within 30 s, so a VSC upgraded to an SC, or an SC that becomes a red flag, counts once. A hazard model is about new events arriving; counting the VSC and the SC that replaced it as two arrivals would double-count one crash.

A4. What are "laps at risk", and why does a lap that starts under a safety car not count?

Answer

Laps on which a new incident could start: race laps that were not already neutralised when they began (an incident's own start lap is included). A lap that starts under an SC is already neutralised, so counting it as exposure would dilute the estimated hazard.

A5. The lap-time detector has lap-level precision 0.94 and recall 0.87 on 2023–25. Explain each in one sentence, and say which way each error biases a "share of races neutralised" from 1996–2022.

Answer

Precision: of the laps it flags, 94% really were neutralised (false flags push rates up, mostly wet laps). Recall: of truly neutralised laps, it catches 87% (misses push rates down, mostly short VSCs and boundary laps). At race level, sensitivity is 95.5% and specificity 92.0%, so the two biases partly cancel; the book's Rogan–Gladen correction gives about 52.4% for 1996–2022 overall.

A6. True or false, with a reason: "Because a VSC stop is cheaper than a green stop, a car should always pit under a VSC if its tyres are more than ten laps old."

Answer

False. Under a VSC the gaps freeze, so a stop still costs about 15.7 s against every car behind you; it pays only if the fresh-tyre gain over the remaining laps exceeds that, or if the car needed to stop soon anyway. In 2023–26 only 11.9% of running cars pitted under a VSC, and none did in the final ten laps (0/107).

A7. Why is lap 1 about nine times riskier than a later lap? Give two physical reasons and one reason the data can't confirm.

Answer

Physical: cold tyres and brakes, and the whole field in close company through the first corners (more cars per metre of track). The data show the hazard (0.176 vs 0.020 per lap) but not the cause; whether it comes from contact, from cold-tyre spins or from race control's readiness to neutralise early cannot be separated from timing data.

A8. What changed in race control's red-flag wording in 2026, and what does it do to a red-flag count that reads only flag-category messages?

Answer

2026 messages read "RED FLAG - RACE SUSPENDED" with category "Other", not a flag-category RED message. A count that reads only flag-category messages shows 0 red flags in 2026 (10 in total) instead of 4 (14 in total). The toolkit's track_periods normalises both wordings, and the module's red_flag_windows reads both; each finds 14.


Part B — Calculations & Physics ⭐⭐

B1. The SC discount from physics. A pit lane replaces a stretch of track that takes 6.0 s at racing speed; the lane takes 24.0 s; slowdown and warm-up add 4.0 s at green pace. Under an SC the field drives the bypassed stretch at 55% of racing speed, and (assume) slowdown/warm-up add only 1.0 s because everyone is slow. Estimate the green and SC losses and the SC/green ratio. Compare with the measured 0.547.

Solution

Green: 24.0 − 6.0 + 4.0 = 22.0 s. SC: bypassed stretch takes 6.0/0.55 = 10.9 s, so 24.0 − 10.9 + 1.0 = 14.1 s. Ratio 14.1/22.0 = 0.64. That is close to the field-relative 0.632 and above the near-field 0.547; the remaining gap is the bunching effect (a car that stops early in the SC period rejoins a queue that is still forming). The inputs here are assumptions for illustration; the chapter measures the real thing.

B2. Probability of an incident in a window. Using the 2023–26 phase hazards (lap 1 0.1758, laps 2–10 0.0323, middle 0.0186, final 10 0.0149), compute the probability of at least one incident (a) on laps 2–10, (b) in the final 10 laps, (c) anywhere in a 53-lap race.

Solution

(a) 9 × 0.0323 = 0.291; 1 − e^−0.291 = 0.25. (b) 10 × 0.0149 = 0.149; 1 − e^−0.149 = 0.14. (c) lap 1 0.1758 + 0.291 + middle laps 11–43 (33 laps) × 0.0186 = 0.614 + 0.149 = 1.229; 1 − e^−1.229 = 0.71.

B3. A circuit multiplier. A circuit had 6 incidents in 4 races where the all-circuit phase hazards would have produced 4.5 in expectation. Compute $k$. Then compute the exact Poisson 95% interval using nz.poisson_ci(6, 4.5) (it returns the interval for the rate per unit of expectation, so it is the interval for $k$).

Solution

k = 6/4.5 = 1.33. Running nz.poisson_ci(6, 4.5) gives roughly 0.49 to 2.90: four races cannot distinguish a dangerous circuit from an average one. (Check your run; the exact values come from the χ² quantiles.)

B4. When does an extra stop pay? Linear wear $d$ = 0.0417 s/lap per lap of age (Singapore MEDIUM), an SC stop costs 15.08 s. For a car with 20 laps to go, what tyre age makes an extra stop to a new set of the same compound break even? What about 30 laps to go?

Solution

G = R d a − Δ = 0 ⇒ a = Δ/(R d). R = 20: a = 15.08/(20 × 0.0417) = 18.1 laps. R = 30: a = 15.08/(30 × 0.0417) = 12.1 laps. The project checkpoint prints the same logic: age 20 with 20 laps left gives +1.60 s, age 10 gives −6.74 s.

B5. Break-even under SC. Using the book's median fresh-tyre delta (1.078 s/lap) and the near-field SC loss (12.7 s), compute the break-even stint length and compare with the green-flag break-even of 20.9 laps.

Solution

12.7/1.078 = 11.8 laps, so under an SC a stop "pays back" in about 12 laps instead of about 21. That is why cars with plenty of laps left take it, and why 48% of running cars still pitted under an SC with 10 or fewer laps to go (often for SOFTs at the restart).

B6. Poisson check. The mean number of SC deployments per race in 2023–26 is 0.681. What share of races should have no SC if deployments are Poisson? The observed share with ≥ 1 SC is 48.4%. Is that consistent?

Solution

P(0) = e^−0.681 = 0.506, so P(≥ 1) = 0.494. Observed 0.484 (44/91), well within sampling error (Wilson interval 38.4–58.5%).

B7. Gap compression. Before an SC the leader is 3.2 s ahead of P2 and 27.9 s ahead of P10 (the 2023–26 medians). After it, the medians are 0.59 s and 4.0 s. If P10 is on tyres 1.0 s/lap faster than the leader's, how many laps does P10 need to catch the leader (a) without the SC, (b) after it, ignoring traffic?

Solution

(a) 27.9 laps; (b) 4.0 laps. A safety car turns a hopeless chase into a five-lap problem, which is why cars that pit under it for fresh tyres can still gain places at the restart.

B8. Expected neutralised laps. Using the incident library (SC 52 incidents, mean 4.87 laps; VSC 52, mean 1.73; RED 14, mean 2.50) and a mean of 1.30 incidents per race, estimate the expected number of neutralised laps per race. Compare with the 7.3% of race laps neutralised in 2023–26 for a 57-lap race.

Solution

Mean incident length = (52 × 4.87 + 52 × 1.73 + 14 × 2.50)/118 = (253.2 + 90.0 + 35.0)/118 = 3.21 laps. Expected neutralised laps ≈ 1.30 × 3.21 = 4.2 per race, or 4.2/57 = 7.3% of a 57-lap race, matching the season table.


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

C1. Analyze this session: 2023 Singapore GP, Race. ⭐⭐ Extend code/case_study_01.py to list, for every car running on lap 19, its tyre age, whether it pitted under the lap-20 SC, and its position on lap 19 and at the flag. Expected shape: a 19-row table; 14 cars pitted on lap 20; Verstappen and Pérez (both on HARDs from the start) did not.

C2. Compare these drivers: 2026 Singapore GP, Race. ⭐⭐ Using f1data.laps(s, clean=True), compute the median clean lap of Leclerc, Antonelli, Verstappen and Hamilton over laps 42–62 and the tyre age each was on. Expected (from 05_gap_compression_and_hook.py): LEC 96.205 s, ANT 96.371 s, VER 96.606 s, HAM 98.579 s. Then fit a linear slope of lap time on tyre age for Hamilton over laps 42–62. Does it look like 0.0324 s/lap?

C3. Build the strategy: hazard by circuit type. ⭐⭐⭐ Group the 2023–26 races into street circuits (Monaco, Baku, Singapore, Jeddah, Las Vegas, Miami, Albert Park, Montreal, Madring) and the rest. Use nz.race_summary() and nz.hazard_by_phase() for each group. Is the middle-race hazard different? Report both λ's with their Poisson intervals and say whether they overlap. (State your circuit list; "street circuit" is a judgement call.)

C4. Analyze this session: VSC stops by circuit. ⭐⭐ From code/_near_field_stops.parquet (written by script 04), compute the median near-field VSC loss by circuit, keeping circuits with at least 5 VSC stops. Expected shape: a short table (about ten circuits), with stops concentrated in one or two races each. Why should you quote the number of races as well as stops?

C5. Predict the race: the detector on 2026. ⭐⭐⭐ Run nz.detector_periods(2026, r) for every 2026 round and compare with nz.race_summary() for 2026. Count races where the detector finds a neutralisation and race control does not, and vice versa. The README's 2026 hold-out shows lap recall 0.76: does the race-level picture look better or worse than the lap level? Which kind of incident does it miss?

C6. Analyze this session: a red flag in detail. ⭐⭐ For the 2026 Mexico City GP (red flag on leader lap 45), list every car's compound and tyre age on its last lap before the stoppage and its first lap after. Expected: 19 running cars, 18 changed (by the chapter's strict test), all 19 restarting on SOFT.

C7. Build the strategy: re-run Anchor C with k = 0.74. ⭐⭐⭐ Edit 07_anchor_c_singapore.py so the main run uses the race-control-only multiplier (0.74) and 10,000 races. Expected shape: E[two − one] near +10 s and P(two-stop better) below 10% (the chapter's 3,000-race sensitivity row gave +9.97 s and 6.7%). Does the flexible strategy still win on average?

C8. Compare these drivers: the one-stopper's opportunity. ⭐⭐⭐ In the Monte Carlo output, the one-stop car took its single stop under a neutralisation in 34.2% of races. Add a column with the lap of that stop and plot its distribution. Where does it concentrate, and why (think about when the planned stop is, and which phases carry the most hazard)?


Part D — Strategy & Judgment ⭐⭐⭐

D1. Call the pit stop: 2023 Singapore GP, lap 20. You run Verstappen's Red Bull. He started 11th on HARDs and is 8th, 16.7 s behind the leader, at the end of lap 19. A safety car is deployed on lap 20 and the cars ahead (all on MEDIUM or used SOFT) are diving into the pit lane. Do you pit for MEDIUMs now, or stay out on HARDs and take the track position?

Reveal

Verstappen stayed out (his HARD stint ran to lap 40). He was 2nd on the road at the end of lap 21, 1.5 s behind Sainz, with the field bunched behind. But he still owed a stop: his green-flag stop at the end of lap 40 cost 28.24 s (near-field) against about 15 s for the lap-20 SC stops, and he fell to 15th. On newer MEDIUMs he recovered to finish 5th, 21.4 s behind the winner. In hindsight the cheap stop was worth more than the track position; the data cannot say what the team expected the rest of the race to bring (another SC would have changed everything).

D2. Call the pit stop: 2026 Singapore GP, lap 39 VSC. You run Hamilton's Ferrari, 3rd on SOFTs that have 23 laps on them (fitted at the end of lap 18), 8.3 s behind the leader with 23 laps to go. Leclerc and Antonelli are pitting. Use the closed form with the model VSC loss (18.4 s), the model SC loss (15.1 s), and Leclerc's measured VSC stop (12.5 s). What would you do, and what did the data show happened?

Reveal

With linear SOFT wear (0.0324 s/lap) the gain of an extra stop is −1.28 s at the 18.4 s VSC price, +2.03 s at 15.1 s and +4.64 s at 12.5 s: a marginal call on the model. Hamilton stayed out, was 2nd after the stops, and then lapped 2.4 s/lap slower than Leclerc over laps 42–62, finishing 6th. The linear model badly understated late-stint SOFT wear, which is the honest lesson: decisions on the edge depend on the part of the tyre curve your model has least data on.

D3. Design the setup: the strategy room's pre-race brief. You are briefing for a 57-lap race at a circuit with k ≈ 1 and low degradation (≈ 0.04 s/lap). Write five bullet points that cover: the probability of an incident before your planned stop on lap 30, the probability of one in the last ten laps, what you will do under an SC on laps 15–25, under a VSC on laps 15–25, and under any neutralisation after lap 45. Use the phase hazards and the decision checklist in 14.9.

A model brief
  • Before our stop. Lap 1 alone carries a 0.176 chance of an incident; laps 2–10 add 9 × 0.0323 and laps 11–29 add 19 × 0.0186. Total 0.820, so P(≥ 1 incident before lap 30) = 1 − e^−0.820 ≈ 0.56. Better than even odds that something happens before our planned stop.
  • Last ten laps. 10 × 0.0149 = 0.149, so P ≈ 0.14. Have a set of SOFTs available for a late restart.
  • SC on laps 15–25. Our tyres will be 15–25 laps old with 32–42 laps to go: R d a is 0.04 × 15 × 42 ≈ 25 s at worst, well above the ≈ 13 s SC stop. Stop on the deployment lap and convert to a one-stop from there.
  • VSC on laps 15–25. Stop only if we are within about 10 laps of the planned stop or have a gap of about 16 s or more behind; otherwise hold. Decide before it happens: most VSCs last one lap.
  • Any neutralisation after lap 45. Under an SC, consider fresh SOFTs for the restart if the cars behind are within reach anyway (the SC will bunch them); under a VSC, stay out (nobody stopped under a final-ten-laps VSC in 2023–26, 0/107).

D4. Should 2026 change your hazard? 2026 had 25 VSC deployments in 21 races against 9–13 in each earlier season. Argue for and against using a 2026-only VSC hazard for the 2026 Qatar GP. What would you need to see to be confident the change is real?

Points to cover

For: the 2026 cars, power units and energy rules are new, and if they stop on track more often (or race control now prefers a VSC to local yellows), the 2023–25 rate is out of date; 20 of 21 races had a neutralisation. Against: 21 races is a small sample, VSCs cluster in some races (the 2026 Australian and Canadian GPs had three each), and Qatar's own history (3/3 races with an SC in 2023–25) may matter more than the season trend. To be confident: a rate ratio for VSCs 2026 vs 2023–25 with a Poisson interval that excludes 1, a look at what caused the VSCs (race-control messages naming stopped cars), and whether the excess persists across circuit types.

D5. Explain it to Ray. Ray insists that because "something happens" in 84% of simulated Singapore races, the two-stop must be the safer bet. Write a five-sentence reply that uses the conditional results of the Monte Carlo (the two-stop is still +8.4 s on average even in races with two or more incidents) and the difference between an option and a commitment.

A model reply

An 84% chance of a neutralisation is not the same as an 84% chance that a second stop pays. Even in the simulated races with two or more incidents, the planned two-stop was 8.4 s slower on average, because the one-stop can also move its single stop into a neutralisation (it did so in 34% of races). What the safety car gives you is the option of a cheap stop, and the flexible plan keeps that option without paying for a second stop in advance. It was identical to the one-stop in 79% of races, faster in 17.6% and slower in 3.5%. That is the robust choice: you lose almost nothing when nothing happens, and you collect when it does.


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

M1. (Ch 12 + Ch 14) Use boxbox.strategy from Chapter 12 to compute the break-even stint length at Singapore with the 2025–26 green loss (23.866 s) and, separately, under an SC (15.08 s). Use the Singapore MEDIUM degradation from this chapter and explain why break_even_laps with a fresh-tyre delta and neutralised_stop_gain answer slightly different questions.

M2. (Ch 13 + Ch 14) Chapter 13 measured an undercut success rate of 42.9% (n = 168) under green conditions. Find the undercut attempts in that study that were interrupted by an SC or VSC within three laps of the first stop. Do they succeed more or less often? Explain using the gap-compression result (SC ratio 0.14, VSC 1.06).

M3. (Ch 2 + Ch 14) Chapter 2 showed that 2023 rounds 1–6 have no OpenF1 pit data and are filled from Jolpica. Does that affect the near-field pit loss for SC stops in 2023 Australia (three red flags)? Check the source column of f1data.pit() for that race and say what you would do.

M4. (Ch 4/22 + Ch 14) The Anchor C tyre model is linear. Refit it with a quadratic tyre-age term for SOFT only and re-run the Monte Carlo. If late-stint SOFT wear is convex (as Hamilton's 2026 laps suggest), does the flexible strategy gain more or less? Link your answer to the degradation models of Chapter 22.

M5. (Ch 17 + Ch 14) Lap 1 carries 16 of 118 incidents. Combine this chapter's lap-1 hazard with the lap-1 position changes of Chapter 17: in races with a lap-1 SC, are positions gained on lap 1 kept less often than in races without one?


Part E — Research & Extension ⭐⭐⭐⭐

E1. Does the detector see the VSC era differently? Re-run validate_detector.py logic yourself on 2023–26 separately for SC laps and VSC laps. Estimate the detector's recall for each, then use those recalls to adjust the 2015–2022 share of races with a neutralisation. Write up how much of the post-2015 rise survives the adjustment.

E2. A position-aware simulator. The chapter's Monte Carlo races one car against the clock. Extend it to two cars 3 s apart with a simple overtaking rule (for example, a pass needs a pace advantage above a threshold and succeeds with a fixed probability; label every assumption 🧪). Does the flexible strategy still dominate when track position has value? This is a preview of Chapter 27.

E3. Has Singapore changed? Build a Bayesian estimate of Singapore's multiplier with a Gamma prior centred on the 2008–2022 detector estimate and updated with the four race-control races. Show the posterior for k and the implied P(≥ 1 incident). How many more quiet Singapore races would it take before the posterior mean falls below 1?