Chapter 38 Exercises — F1 Betting Analytics
Difficulty: ⭐ concept check · ⭐⭐ calculation or short code · ⭐⭐⭐ multi-step analysis · ⭐⭐⭐⭐ open-ended project
Every price in these exercises is hypothetical unless the exercise asks you to build one from a model with betting.hypothetical_book(). The book's data contain no historical odds. Where a numeric answer is given, it comes from the chapter's own scripts (code/*_output.txt).
Part A — Concepts ⭐
A1. In one sentence each, define implied probability, overround and edge. Then explain why a bet can have a model probability above the market's fair probability and still be a losing bet.
A2. The chapter says, "A forecast is not a bet." What is the second half of a bet, and why does this book refuse to supply it from memory or from "typical" figures?
A3. Name the four methods of removing a bookmaker's margin covered in §38.3. Which two take proportionally more margin from long shots? Why does the choice of method matter more for a 50/1 shot than for the favourite?
A4. Explain, without equations, why the Kelly criterion maximises the growth of the logarithm of a bankroll rather than its expected value. What happens to a bettor who maximises expected value instead?
A5. Half Kelly keeps about 75% of full Kelly's growth rate. In plain words, why is that trade worth making for a bettor whose probabilities come from a model?
A6. §38.5 found that the last race deserves about 1.4–1.5 times the weight of each of the four races before it. Does this support or undermine the claim that "the market overreacts to the last race"? What extra data would you need to settle the claim?
A7. Explain what a beta-binomial prior weight of "about 8,000 races" means for the 2023–2026 per-circuit full safety-car rates. Does it prove that circuits have the same safety-car risk?
A8. Why is a backtest against "a market equal to the bettor's own model" a necessary part of §38.9? What would it mean if that row had produced bets?
A9. A quarter of teammate H2Hs in 2014–2026 were decided by exactly one car retiring. Why does this make the market's settlement rules part of the probability you must estimate?
A10. Give two reasons why a single profitable season of paper bets (Case Study 2) is weak evidence of an edge.
A11. §38.7 found that favourites won more often in races with a full safety car (30 of 44) than without (27 of 47), yet eight of the ten 2023–2026 winners the GBM rated below 10% came in neutralised races. Explain how both can be true at once, and why the second fact is weaker evidence than it sounds (hint: 66 of 91 races were neutralised).
A12. The fastest-lap bonus point (2019–2024) raised the share of fastest laps set after a pit stop in the last ten laps from 15.0% to 37.8%, and the share fell to 13.3% once the point was removed. Why is a rule change like this a more trustworthy source of "edge" than the hypotheses tested in §38.5–§38.8? What would a pricing model fitted on 2019–2024 have got wrong in 2025?
A13. A bettor says, "My model's log loss is worse than the market's, but my bets made money last year." Using the identity in §38.9's "Why this works" box, explain what you would expect over the long run and why the bettor's year is not a contradiction.
Part B — Calculations ⭐⭐
B1. Converting prices. Convert each price to decimal odds and implied probability: (a) 9/4, (b) 1/2, (c) +175, (d) −250.
Solution
(a) 9/4 + 1 = 3.25 → 1/3.25 = 30.8%. (b) 1/2 + 1 = 1.50 → 66.7%. (c) 1 + 175/100 = 2.75 → 36.4%. (d) 1 + 100/250 = 1.40 → 71.4%.
B2. Overround. A hypothetical four-runner market (the other runners are not offered) is priced VER 1.80, NOR 4.50, LEC 6.00, "any other driver" 5.50. Compute the booksum and overround, then the fair probabilities by the multiplicative method.
Solution
Implied: 0.5556, 0.2222, 0.1667, 0.1818. Booksum B = 1.1263; overround = 12.6%. Multiplicative fair probabilities = implied / 1.1263: VER 0.493, NOR 0.197, LEC 0.148, other 0.161 (sum 1.000).
B3. Edge at the real price. In the chapter's hypothetical 2026 United States GP book, Antonelli was priced at 1.90 and the GBM gave him 52.32%. Compute the EV. Then compute the lowest price at which the GBM would have seen a +5% edge.
Solution
EV = 0.5232 × 1.90 − 1 = −0.006 (−0.6%, as in 01_output.txt). For EV = +0.05 we need o = 1.05 / 0.5232 = 2.007. Any price of 2.01 or longer clears the rule.
B4. Kelly. For each hypothetical bet, compute the full-Kelly fraction and the quarter-Kelly stake on a 1,000-unit bankroll: (a) p = 0.62 at 1.80; (b) p = 0.08 at 15.0; (c) p = 0.45 at 2.10.
Solution
(a) f = (0.62 × 1.80 − 1)/0.80 = 0.116/0.80 = 0.145 → quarter Kelly 0.03625 → 36.25 units. (b) f = (1.20 − 1)/14 = 0.01429 → 0.00357 → 3.57 units. (c) EV = 0.45 × 2.10 − 1 = −0.055 → f* < 0 → no bet.
B5. The cost of over-betting. For the chapter's hypothetical bet (p = 0.30 at 4.0), compute the expected log growth at f = 0.10 by hand, and compare it with the full-Kelly growth of +0.00640 reported in 02_output.txt.
Solution
g(0.10) = 0.30 ln(1 + 0.10 × 3) + 0.70 ln(0.90) = 0.30 × 0.26236 + 0.70 × (−0.10536) = 0.07871 − 0.07375 = +0.00496. That is about 77% of full Kelly's growth, at 1.5 times the stake. The curve falls steeply past f*, and growth reaches zero at f = 0.138 (02_output.txt).
B6. Shrinkage by hand. Suppose a prop-market prior is Beta(a = 5.02, b = 5.97), the fitted value for "≥ 1 full SC" from 2023–2024 (04_output.txt). Jeddah had an SC in 2 of 2 races in those seasons. Compute its shrunk rate and the fair decimal price for "safety car: yes".
Solution
(k + a)/(n + a + b) = (2 + 5.02)/(2 + 10.99) = 7.02/12.99 = 0.540. Fair price = 1/0.540 = 1.85. The raw rate (2/2 = 1.00) would have priced it at 1.00, a price no book would offer and no bettor should believe.
B7. Bets needed. Using the chapter's formula $n = ((1.645 + 0.842)\sigma/e)^2$ with $\sigma^2 = p o^2 - (p o)^2$ and $p = (1+e)/o$, compute the bets needed to detect a +5% edge at decimal 2.0. Check your answer against bets_needed.csv.
Solution
p = 1.05/2 = 0.525; σ² = 0.525 × 4 − (1.05)² = 2.100 − 1.1025 = 0.9975, σ = 0.9987. n = (2.487 × 0.9987 / 0.05)² = (49.68)² ≈ 2,468, matching the 2,467.9 in the table. At 24 bets a season, that is about 103 seasons.
B8. Break-even in a two-way market. A hypothetical H2H is priced 1.83 / 2.00. Compute the overround, the fair probabilities (multiplicative) and the win rate you need to break even on each side.
Solution
Implied: 0.5464 + 0.5000 = 1.0464 → overround 4.6%. Fair: 0.522 / 0.478. Break-even: 54.6% at 1.83, 50.0% at 2.00. Note that the longer side's break-even equals its fair probability only if the margin is loaded entirely on the other side; here the multiplicative fair 47.8% is below 50%, so the 2.00 side has a negative EV for anyone who agrees with the multiplicative fair price.
B9. A podium market. A hypothetical podium market has a booksum of 3.621 (the chapter's checkpoint book for Las Vegas 2026). What is its overround? Verstappen is priced at 1.18 and the GBM gives him 0.809 to finish on the podium. Compute the EV, and the fair probability by the multiplicative method with three winners.
Solution
Overround = 3.621 − 3 = 0.621, i.e. 20.7% of the 3 winners' worth of probability. Implied = 1/1.18 = 0.847; multiplicative fair = 0.847 × 3/3.621 = 0.702, matching checkpoint_output.txt. EV = 0.809 × 1.18 − 1 = −0.045. The GBM is far more bullish than the fair price (0.809 against 0.702) and still has no bet, because the implied probability (0.847) is higher still.
B10. Exclusive Kelly. Three hypothetical runners are priced 2.20, 4.00 and 6.00 (booksum 0.871; the other runners are not offered). You believe p = 0.50, 0.25 and 0.10, with 0.15 on the field. Use the algorithm in betting.kelly_exclusive by hand: rank by p·o, compute the reserve rate after adding each runner, and give the stakes.
Solution
p·o: 1.10, 1.00, 0.60. Add runner 1: R = (1 − 0.50)/(1 − 0.4545) = 0.9167; 1.10 > 0.9167, keep. Try runner 2: R = (1 − 0.75)/(1 − 0.4545 − 0.25) = 0.25/0.2955 = 0.846; its p·o = 1.00 > 0.846, keep. Try runner 3: R = (1 − 0.85)/(1 − 0.7045 − 0.1667) = 0.15/0.1288 = 1.165; 0.60 < 1.165, stop. Stakes with R = 0.846: f1 = 0.50 − 0.846/2.20 = 0.115; f2 = 0.25 − 0.846/4.00 = 0.038. Runner 2 is a zero-EV bet on its own (p·o = 1.00), yet it earns a stake, because it pays out in races where runner 1 loses.
Part C — Data & Code ⭐⭐–⭐⭐⭐
C1. Analyze this session: a second hypothetical book (⭐⭐). Copy the block in code/01_odds_math.py that builds the 2026 United States GP book and change it to the 2026 Mexico City GP (round 19). Print the four removal methods for the top ten drivers and the edge report for the GBM.
Expected shape: a 10-row table like §38.3's. The methods should agree to within a few points for the top three and diverge for long shots. Record which driver, if any, clears the +5% rule, and compare with the result (Verstappen won from fifth on the grid; see Case Study 2).
C2. Calibration by era (⭐⭐). Using C.walkforward(("gbm",)), compute the reliability table of §38.3 separately for 2014–2021 and 2022–2026. Use the same bins.
Expected shape: two tables of about nine bins each. Report expected against actual wins for forecasts below 10% in each era. (All seasons together: expected 30.4, actual 41.) Is the long-shot under-forecasting concentrated in one era?
C3. Compare these drivers: the recency weights by driver tier (⭐⭐⭐). Refit the "before qualifying" lag regression of 03_recency.py separately for drivers whose five-race average finish is better than 6th and for the rest.
Expected shape: two sets of five lag coefficients with clustered CIs. Hypothesis to test: for front-runners, whose finishing positions are bounded near 1, the last race should carry less extra weight. Report the lag-1/mean(lag2–5) ratio for each group (all drivers: 1.44).
C4. Predict the race: the wet-race test with more data (⭐⭐⭐). The chapter's wet sample is 11 races. Extend it with sprints: label every 2023–2026 sprint as wet if any car ran INTERMEDIATE or WET tyres (f1data.stints with kind="S"), and compute the pole-sitter's (sprint-qualifying P1's) win rate in wet and dry sprints with Wilson intervals.
Expected shape: a 2 × 3 table (dry / wet × n, wins, rate with CI). Say whether adding sprints narrows the interval enough to change §38.6's verdict.
C5. Build the strategy: a shrunk SC prop for 2026 (⭐⭐⭐). Using only 2023–2025 race control, fit betting.shrink_rates for "any SC/VSC/red" by circuit. Price every 2026 race with the shrunk rate (fair, no margin) and compute the Brier score of those prices against what happened in 2026. Compare with a constant 2023–2025 pooled rate.
Expected shape: two Brier scores and a list of 21 circuits. Expect both to be poor, because 2026 had a neutralisation in 20 of 21 races (§38.7). Then refit using 2023–2025 plus the 2026 races before each race (a rolling update). Does updating within the season help?
C6. Analyze this session: the 2024 São Paulo GP from three models (⭐⭐). From walkforward_predictions.parquet (Chapter 26), extract the gbm_pre, gbm and grid win probabilities for 2024 round 21. Build a hypothetical consensus book from grid, logit and gbm (18% margin, as in §38.3) and run edge_report for gbm_pre.
Expected shape: the Thursday model (gbm_pre, 36.5% for Verstappen) should show a very large "edge" on Verstappen against a post-qualifying book. Explain why this edge is not real: what information did the Thursday model lack?
C7. Fastest lap by team (⭐⭐). Using code/fastest_laps_2014_2026.csv, add each fastest-lap setter's team (from history.results) and compute, for 2019–2024, the share of each team's fastest laps that followed a pit stop in the last 10 laps.
Expected shape: a table of about ten teams with n and share. Overall the share was 37.8% (48 of 127). Which teams used the late stop most? Keep the sample sizes beside the shares.
C8. Kelly with estimation error (⭐⭐⭐). In 02_kelly.py, replace World B's fixed overconfidence (×1.12) with random error: belief = p_true × exp(ε), ε ~ Normal(0, 0.15), drawn once per bet. Keep the price at 1.00 / p_true (zero true EV). Run 1,000 paths at full, half and quarter Kelly.
Expected shape: the same six-column table as §38.4. Even with unbiased noise, the bettor only bets when the noise is positive, so it loses. Report the median final bankroll for each fraction.
C9. H2H calibration by era (⭐⭐). Using code/h2h_2014_2026.csv, refit the H2H logistic of 07_markets.py on 2014–2018 and test it on 2019–2021, then on 2022–2026. Compare accuracy and calibration for the two test periods.
Expected shape: two calibration tables. The chapter found the 2014–2021 model under-confident on 2022–2026 in its upper bins (pairs rated 0.70 went 0.83). Is it also under-confident on 2019–2021, or is the effect specific to the ground-effect era? Report the better-qualifier-ahead rate for each test period beside the model's accuracy.
C10. The margin at which the edge dies (⭐⭐⭐). In 06_backtest.py, extend MARGINS to 0.40, 0.50 and 0.75 for the grid-baseline market. At what margin does the GBM's flat-stake ROI interval first include zero? Then repeat with MAX_ODDS set to 11.0 (bets at 10/1 or shorter only).
Expected shape: a table of ROI with intervals by margin, for two price caps. The chapter's result with the 51.0 cap: the lower bound is +0.3% at a 30% margin. Explain why the answer depends on the price cap.
Part D — Strategy & Judgment ⭐⭐⭐
D1. Call the pit stop: an in-play price at Las Vegas 2026. It is lap 19 of 50 at the 2026 Las Vegas GP. A full safety car has just been deployed (race control, lap 19). At the end of the lap, Verstappen leads on SOFTs, Hadjar and Russell are second and third, and Antonelli, who started sixth on MEDIUMs, is fifth. A hypothetical in-play book offers Antonelli at 6.0 to win. Before you open the reveal, decide: (a) which pieces of information from earlier chapters change Antonelli's probability now (pit loss under SC, Chapter 14; tyre offset; track position); (b) whether you would bet, and at what stake under quarter Kelly if you estimate p = 0.20.
Reveal
All the leaders stopped under this safety car, from SOFT to MEDIUM; Antonelli went from MEDIUM to SOFT (stints, case_study_01.py). Under an SC the measured pit loss is about 12.7 s, against about 22.5 s under green (Chapter 14), so the stop cost everyone less and preserved the order. Antonelli rose to second by lap 38 and finished fourth. At p = 0.20 and 6.0, EV = +0.20 and f* = 0.20/5 = 0.04, so quarter Kelly is 1% of the bankroll. The bet lost. The decision quality depends on whether 0.20 was a calibrated estimate, which one race cannot tell you.
D2. Design the setup: your betting rules. Write a one-page rulebook for a paper-trading season: which markets, which model (and why that one, from its walk-forward record), minimum EV, maximum price, Kelly fraction, per-bet and per-race caps, what you record for each bet, and the condition under which you would stop. Justify each number with a result from this chapter.
D3. The specialist tip. A friend says, "Team X always qualifies well at this circuit; they were 0.8% better than their season level here last year." Using §38.8, compute the expected carry-over this year and decide whether the tip should move your price. Then list two pieces of information that would make you trust the tip more.
D4. Four models, one race. In Case Study 1, the four models backed four different drivers. Design a procedure to combine them before you look at prices, using only their 2014–2025 walk-forward log losses. Explain why choosing after you see the edge reports is a biased procedure.
Part M — Mixed and Interleaved ⭐⭐–⭐⭐⭐
M1. Chapter 14 + Chapter 38: hazard to prop price (⭐⭐). Chapter 14 measured a full-SC deployment hazard of 0.0115 per lap (2023–2026), with lap 1 about 8.8 times riskier than later laps. For a 57-lap race, compute P(at least one SC) assuming a constant hazard on laps 2–57 and 8.8 times that hazard on lap 1. Compare with the observed 48.4% of races with an SC. Hint: the per-lap hazard of 0.0115 is an average over all laps, so solve for the later-lap hazard h with (8.8h + 56h)/57 = 0.0115, then compute 1 − (1 − 8.8h)(1 − h)^56.
M2. Chapter 26 + Chapter 38: leakage as fake edge (⭐⭐⭐). Chapter 26 showed that leaky features improved log loss by 0.062 nats per race. Using §38.9's 🔍 identity (expected log growth = market log loss − your log loss), explain what a backtest using the leaky model would have shown against a market equal to the honest GBM. Then run it: price a hypothetical market from the honest GBM and bet with the leaky predictions if you can rebuild them from Chapter 26's 05_leakage.py.
M3. Chapter 27 + Chapter 38: fixing the phantom edge (⭐⭐⭐). The Monte Carlo underrates pole-sitters. Propose a calibration step (for example, Platt scaling or isotonic regression of its win probabilities on 2023–2025 results). Apply it to the fifteen 2026 races in _calibration_2026.csv using leave-one-race-out fitting, and re-run Part 2 of 06_backtest.py. Does the phantom edge disappear?
M4. Chapter 21 + Chapter 38: H2H from the teammate gap (⭐⭐). Chapter 21 measures teammate qualifying gaps as a percentage of lap time. The H2H logistic in §38.10 has a coefficient of −0.434 per % of qualifying gap. Compute the model's H2H probability for a driver who qualifies ahead by 0.3% with an even prior record. (Use the grid-ahead coefficient +0.322 with the indicator = +1, and the prior term = 0; the intercept is about zero by symmetry.)
M5. Chapter 36 + Chapter 38: the weather information edge (⭐⭐⭐). Chapter 36 found that a wet qualifying session was followed by a wet race 50% of the time (9 of 18), against 16.4% otherwise. Suppose a hypothetical market prices a race as if P(wet) = 0.20 after a wet qualifying session. Using the chapter's dry and wet pole-win rates (52/80 and 5/11), compute the pole-sitter's win probability under P(wet) = 0.20 and under P(wet) = 0.50, and the resulting EV of backing the pole-sitter at the fair price implied by the first.
M6. Chapter 24 + Chapter 38: team pace trends and the specialist effect (⭐⭐⭐). Chapter 24 tracks team pace through a season with development.py. The §38.8 team-circuit residual subtracts a season median gap, which ignores in-season development. Recompute the residual against a trailing five-race team gap instead (the Chapter 26 feature team_gap_trail) and re-estimate the year-to-year correlation. Does accounting for development make the specialist effect stronger or weaker? Explain why either is plausible.
Part E — Research & Extension ⭐⭐⭐⭐
E1. Find real prices and test the overreaction hypothesis. If you can obtain historical F1 prices legally and with permission (some exchanges and data providers publish historical market data under licence), repeat §38.5's lag regression with the market's implied probability (log-odds) as the dependent variable. Compare the market's lag weights with the data's. That is the test this book could not run. Document the source, its licence, its margin and its timestamps.
E2. A combined pricing model. Build a Box Box pricing model that combines the Chapter 26 GBM and logit (weighted by walk-forward log loss), a calibrated Chapter 27 Monte Carlo, a heavily shrunk team-circuit term (§38.8) and a weather adjustment (Chapter 36). Evaluate it walk-forward on 2014–2026 by log loss and by the §38.9 backtest against each component. Report whether the combination beats its best component by an interval that excludes zero. Then answer the harder question honestly: given Case Study 2's sample-size table, how many seasons of forecasts would you need before a log-loss improvement of the size you found could be distinguished from zero? Log loss uses every runner in every race, so it should need far fewer races than a profit test; compute how many.
E3. The cost of the fastest-lap rule. Using Jolpica pit stops and lap times for 2019–2024, estimate how many late stops were made for the fastest-lap point, and what they cost or gained in race position. Compare with 2025–2026. Write it up as a short paper with your methods, uncertainty and limitations.