Chapter 14 Instructor Notes — Safety Cars, Virtual Safety Cars, and Red Flags
Chapter: Safety Cars, Virtual Safety Cars, and Red Flags: How Random Events Destroy the Best-Laid Strategy · Exercises · Quiz · Case Study 1 · Case Study 2 · Key Takeaways · Discussion guide
Chapters 12 and 13 planned a clean race. Chapter 14 adds randomness. Students build base rates for safety cars (SC), virtual safety cars (VSC) and red flags, fit a per-lap hazard model, measure why stops under neutralisation are cheap, and then test the Singapore "safety-car gamble" with a Monte Carlo simulation. The module built here is neutralisation.py. This is the first chapter where the answer is a distribution and a robust choice rather than a single optimum.
Learning objectives
By the end of the session, students should be able to:
- Distinguish SC, VSC and red flag by what each does to lap times, gaps and pit-stop cost.
- Quote base rates with intervals and explain why "neutralisations are the norm" in 2023–2026.
- Build a per-lap hazard by race phase and use $1 - \exp(-\sum\lambda)$ to get the chance of an incident in a window of laps.
- Explain why circuit histories are short and how a circuit multiplier with an interval handles that.
- Measure the pit loss under SC and VSC with a near-field comparison, and explain why the pit lane is not faster but the field is slower.
- Explain why an SC collapses the gaps while a VSC freezes them, and how that changes the decision.
- Read a Monte Carlo result as an expected value, a probability of being better and a robust choice.
Threshold concept
This chapter has no designated threshold concept. It extends Chapter 12's (strategy minimises total race time) from a single clean race to a distribution of races: the plan that minimises the expected total, and protects against the bad cases, can differ from the clean-race optimum.
Suggested 75-minute session plan
| Time | Segment | What happens |
|---|---|---|
| 0–8 min | Hook | 2026 Singapore GP: VSCs from leader laps 8 and 39. Leclerc and Antonelli took their second stops under the lap-39 VSC for a near-field loss of 12.48 and 13.83 s, against a green near-field median of 23.73 s that day. Hamilton, P2 after the stops, finished P6. Ask: "Planned brilliance or luck?" |
| 8–25 min | Concept | Base rates: 48.4% of 2023–26 Grands Prix had at least one SC and 72.5% had an SC, VSC or red flag (66 of 91). Hazard by phase: lap 1 about nine times riskier than any later lap. Poisson counts: mean 1.30 incidents per race, variance 1.28. |
| 25–42 min | Live demo | Run code/03_hazard_model.py for the per-phase hazard, then code/04_pit_loss_under_neutralisation.py for the stop cost: green 22.56 s, VSC 15.67 s, SC 12.72 s (near-field medians). Show that pit-lane time barely changes (23.3 vs 23.6 s green vs SC); the cars on track are slower. |
| 42–62 min | Activity | Anchor C: groups predict, before seeing results, whether a planned two-stop beats a one-stop at Singapore given its safety-car history. Then run or read code/07_anchor_c_singapore.py. Discuss the three strategies: planned one-stop, planned two-stop, flexible one-stop. |
| 62–75 min | Wrap-up | The robust answer is a flexible one-stop: stop once and take a second stop only under an SC or VSC. Exit ticket: "Why does the flexible strategy almost never lose?" |
Key numbers students should leave with
- Base rates (91 GPs, 2023–26): ≥ 1 SC in 48.4% of races; SC, VSC or red flag in 72.5%. About 7% of race laps run neutralised. 14 red flags, i.e. 0.154 per race.
- Hazard: lap 1 0.176 per lap; laps 2–10 0.032; middle 0.019; final ten 0.015. Lap 1 is about nine times riskier than later laps.
- Singapore multiplier: 0.74 (0.20–1.89) from four race-control seasons; 1.33 (0.89–1.91) pooled with the longer detector history.
- Stop cost (near-field medians): green 22.56 s, VSC 15.67 s, SC 12.72 s. An SC stop costs about 55% of a green one.
- Gaps: under an SC, leader→P10 keeps about 14% of its spread (27.9 → 4.0 s); under a VSC the gaps barely move (ratio 1.06).
- Who takes the cheap stop: 50.8% of running cars pit under an SC, 11.9% under a VSC; about 19% of cars on 0–5-lap tyres vs 87–94% on tyres older than 20 laps.
- Red flags as free tyre changes: 128 of 186 running cars (68.8%) restarted on fresher or different tyres.
- Anchor C (Singapore): across 10,000 simulated races in the book's fuller model (Chapter 27, the standard figure), a planned two-stop is +10.10 s slower on average and better in only 18.9% of runs; the flexible one-stop gains 0.84 s on average. This chapter's simplified Monte Carlo gives the same verdict (+9.44 s, better in 10.7%). No hazard up to 3× Singapore's rate flips the average.
Common misconceptions and remedies
| Misconception | Remedy |
|---|---|
| "Safety cars are rare surprises." | Nearly three races in four were neutralised in 2023–26. Plan for them. |
| "The pit lane is faster under a safety car." | Pit-lane time is the same; the field on track is slower, so the relative loss shrinks. Show the 23.3 vs 23.6 s lane times. |
| "Singapore always has a safety car, so plan two stops." | Singapore had an SC in 1 of 4 races and an SC or VSC in 2 of 4 (2023–26). Even at 3× its hazard, the planned two-stop loses on average. |
| "SC and VSC are the same thing for strategy." | An SC compresses the gaps and makes stops cheapest; a VSC freezes the gaps. Different decisions follow. |
| "The circuit's history tells you its safety-car rate." | Four races is a tiny sample. Use a multiplier on the all-circuit hazard and quote the interval. |
| "A stop under SC is always right." | Tyre age decides: few cars on fresh tyres pit. Case Study 2 shows already-stopped cars that stayed out gained places on average. |
Exercises to assign
- Core (everyone): Part A — A1–A4; Part B — B1 (the SC discount from physics), B2 (probability of an incident in a window), B5 (break-even under SC), B7 (gap compression).
- Code lab: Part C — C1 (Analyze this session: 2023 Singapore GP, Race) and C7 (Build the strategy: re-run Anchor C with k = 0.74).
- Judgment: Part D — D1 (Call the pit stop: 2023 Singapore GP, lap 20) and D5 (Explain it to Ray), which works well as a short written piece for the betting track.
- Stretch: Part C — C6 (a red flag in detail); Part E — E2 (a position-aware simulator) or E3 (has Singapore changed?).
- Interleaving: Part M — M1 (Ch 12 + Ch 14) and M2 (Ch 13 + Ch 14).
Lab tips
- All scripts run without a network. Cache files (
_race_summary,_detector_summary,_incident_library,_near_field_stops,_who_pits, as.parquet) are written tocode/. - Run order:
01_neutralisation_map.pywritescode/_race_summary.parquet, which02_base_rates_history.pyreads. Run 01 first. - Runtime:
04_pit_loss_under_neutralisation.pytakes about 45 s;07_anchor_c_singapore.pyabout 25 s (10,000 plus 7 × 3,000 simulations). Both are fine to run live. - Gotcha — missing values in race control:
race_control.flagcontains pandas NA, which breaks naive boolean tests such asm.flag != "RED". Cast to string first. - Gotcha — leaders under SC: the near-field pit loss is undefined when everyone near a car pits on the same lap (for example the front runners at 2023 Singapore lap 20). Expect gaps in those rows.
- Gotcha — seeds: the Monte Carlo is seeded (seed 42). Ask students to change the seed and check that the verdict, not the third decimal, is what matters.
Connections
- Backward: Chapter 12 (pit loss, optimiser; its "too few stops" bias is partly explained here) and Chapter 13 (pairs of cars).
- Forward: Chapter 15 (rain as another random event), Chapter 17 (why lap 1 is so risky), Chapter 18 (deciding under a live neutralisation) and Chapter 27 (the fuller simulation).