Chapter 30 Exercises — Optimal Batting Order
Difficulty: ⭐ recall and concepts · ⭐⭐ calculation and interpretation · ⭐⭐⭐ code and judgement · ⭐⭐⭐⭐ open-ended research.
All numbers come from the chapter's scripts (code/01_… to code/07_…, the case studies and project_checkpoint.py). Selected answers are in Appendix I.
Part A — Conceptual ⭐
A1. Cricsheet doesn't record batting positions. Describe in two sentences how the chapter infers them, and name two kinds of event that make an inferred position "out of step" with the dismissals.
A2. In IPL 2023–26 the No. 3 faced 18.15 balls per team innings and the No. 6 9.93. Explain the difference between "balls per team innings" and "balls when he batted", and why the first is the right measure of a slot's budget.
A3. Chapter 19's Markov chain is indexed by (over, wickets lost). Explain why that chain can't simply be reused with a named batter plugged in, and what the chapter's "situation cell" adds.
A4. What are a run tilt and a dismissal multiplier? Why does a batting-order model need both, rather than a single strike-rate figure?
A5. Tail-enders are shrunk toward the average of usual Nos. 8–11, not toward the league-average batter. Give the cricket reason and the statistical reason.
A6. What are common random numbers, and why do they make comparing two batting orders cheaper without making either estimate more accurate on its own?
A7. Explain the optimiser's curse in the context of screening 5,040 orders. What is the chapter's defence against it?
A8. "Promoting a batter is a transfer, not a gift." Explain what is being transferred, from whom, and why that limits the team's gain.
A9. Define the chapter's inferred nightwatchman. Give one kind of real nightwatchman the rule would miss and one kind of non-nightwatchman it would wrongly include.
A10. Why is the nominal 90-over day a reasonable clock on day 1 of a Test but an unreliable one on day 3?
A11. The out-of-time test found that batter-specific phase deviations made forecasts worse. Explain in plain words what a "phase deviation" is, and why a model can still give a batter different powerplay and death profiles without one.
A12. Women's T20Is give the top three 55.5% of the balls faced; men's Tests give them 38.8%. Explain what that difference means for how much batting order can matter in each format.
A13. The simulator always treats the striker as the batter dismissed, and lets extras rotate the strike only through runs actually run. Explain why simplifications like these can be acceptable for comparing batting orders even when they would bias the level of the expected total. What kind of simplification would not be acceptable?
Part B — Calculation & Interpretation ⭐⭐
B1. Using the IPL 2023–26 position table, what share of team innings saw the No. 8 bat at all, and how many balls did he face on average when he did? If a team's No. 8 were replaced by a batter who scores 0.3 runs per ball more, roughly how many extra runs per team innings would that be worth?
Answer
No. 8 batted in 56.19% of team innings and faced 7.22 balls when he did. His budget is 4.06 balls per team innings, so a 0.3-runs-per-ball improvement is worth about 4.06 × 0.3 ≈ 1.2 runs per team innings. That's before counting any change in dismissals, and before the extra balls a better No. 8 would take from Nos. 9–11. A better No. 8 matters less than people think, because he bats so little.
B2. The defend curve for the IPL is P(win) = logistic(−0.340 + 0.349 × (total − env)/10). At env 190.1, compute P(win) for totals of 195 and 205. How many points of win probability are 10 runs worth near par?
Answer
At 195: z = −0.340 + 0.349 × 0.49 = −0.169, so P = 1/(1 + e^0.169) ≈ 0.458. At 205: z = −0.340 + 0.349 × 1.49 = 0.180, so P ≈ 0.545. Ten runs are worth about 8.7 points near par, matching the chapter's printed 0.415 at 190 and 0.501 at 200.
B3. Tim David at No. 6 faced 11.425 balls and made 19.593 runs (simulated). At No. 3 he faced 22.202 and made 38.105. The team total rose by 1.609. How many runs did the other batters lose between them, and what does that imply about the batters he displaced?
Answer
David gained 38.105 − 19.593 = 18.51 runs; the team gained 1.61, so the others lost about 16.9 runs. They lost roughly the 10.8 balls he gained (plus a little more from changes in the order of dismissals), at about 1.5–1.6 runs a ball. Since David scores at about 1.7 a ball at No. 3, the displaced batters weren't much worse than him per ball. The gain is the difference, which is small.
B4. The screen of RCB's 5,040 orders had a mean of 198.86 and a standard deviation of 2.63 runs. The re-check gave the usual order 198.85 and the best 203.80. How many standard deviations above the mean of all orders is the best? Why is the screen's best (206.16) higher than the re-checked best?
Answer
(203.80 − 198.86)/2.63 ≈ 1.9 standard deviations. The screen's best is higher because it was selected as the maximum of 5,040 noisy estimates (400 simulations each). The re-check on fresh simulations removes the luck that made it look best: the optimiser's curse, 205.2 → 203.2 on average for the top 25.
B5. The paired margin of error for best − usual was ±0.43 runs (95%, 20,000 innings) and the unpaired one ±0.73. By what factor would you need to multiply the number of unpaired simulations to match the paired precision?
Answer
Precision scales with 1/√n, so the factor is (0.73/0.43)² ≈ 2.9. Common random numbers are worth almost three times the simulations here.
B6. Inferred nightwatchmen were dismissed every 40.8 balls and scored 16.27 runs per dismissal; specialists arriving at Nos. 3–6 were dismissed every 76.2 balls and scored 39.68. If a nightwatchman faces the last 18 balls of a day, how many runs and dismissals would you expect from him, compared with a specialist facing the same balls?
Answer
Nightwatchman: 18/40.8 ≈ 0.44 dismissals; runs ≈ 0.44 × 16.27 ≈ 7.2 (he scores at about 0.40 runs a ball). Specialist: 18/76.2 ≈ 0.24 dismissals; runs ≈ 0.24 × 39.68 ≈ 9.4 (about 0.52 a ball). The nightwatchman is almost twice as likely to fall, but his wicket is the cheap one. That is the trade the chapter describes.
B7. The protected batter averaged 31.40 runs when protected against 35.40 in his other innings, with a 90% interval of −6.64 to −1.42 for the difference. Is this evidence that nightwatchmen hurt protected batters? Answer in three sentences.
Answer
It shows the protected innings are lower, beyond chance. It doesn't show the nightwatchman caused it. The protected batter always arrives with one more wicket down (less batting left to support him), often the next morning against fresh bowlers, and his "other innings" mix every situation. Without the counterfactual innings, the honest conclusion is "no sign of a benefit", not "harm".
B8. Across ten IPL 2026 sides, the median gain from moving the power hitter to his best slot was 0.38 runs (0.0023 WP). Over a 14-match league season in which a side bats first seven times, how many wins does that represent?
Answer
7 × 0.0023 ≈ 0.016 wins: about one-sixtieth of a win per season. Even RCB's best case (David, +0.013 WP) would be worth about 0.09 wins over seven first innings.
B9. The fully floating rule (§30.6) gave David 19.1 balls and Padikkal 8.4, against 11.4 and 17.0 in the usual order, and gained 3.48 runs. The best fixed order gained 4.95. Using only these numbers, explain why a rule that moves balls in the right direction can still finish behind a fixed order.
Answer
The floating rule kept Iyer and Kohli as the fixed openers and only re-ordered Nos. 3–7. The best fixed order also moved Kohli into slot 1, David into slot 2 and Iyer down to No. 4, so it changed who faces the first, most plentiful balls of the innings. Floating can only reallocate the balls that become available after wickets fall; the two opening slots, which face about 41 balls per team innings in the real IPL (47.6 for RCB's simulated openers), are fixed. Where the biggest transfer is available at the top, a fixed order captures it and a floating rule that leaves the openers alone can't.
B10. In the nominal-day check, 48 inferred nightwatchmen arrived on day 1 of a first innings, 52.1% of them in overs 80–90; 3,334 specialist arrivals at Nos. 3–6 had 2.1% there. If the rule were picking nightwatchmen at random from all arrivals, what share would you expect in overs 80–90? What does the gap say about the rule's precision?
Answer
About the specialists' share, a few per cent. Even an even spread over 90 overs would give 11.1%. The observed 52.1% is far above both, so at least half of the day-1 flags are very likely genuine end-of-day promotions. The rest may be real nightwatchmen on days shortened by weather (when the nominal clock runs ahead of the real one), or promotions for other reasons. The rule is clearly informative, but not perfectly precise.
Part C — Code It ⭐⭐–⭐⭐⭐
C1. Build this metric — the slot budget for your league. ⭐⭐ Run bo.entry_order and bo.position_table on the BBL ("bbl") and the PSL ("psl") for 2023–26. Output: two tables like the IPL one in §30.1, plus a one-line summary of the share of balls faced by slots 1–3, 4–5, 6–7 and 8–11. Is the No. 3 − No. 6 gap bigger or smaller than the IPL's 8.22 balls?
Expected shape: an 11-row table per league (columns batted_pct, balls_if_batted, balls_per_inns, runs_per_inns, median_entry_over, sr), and four percentages per league that sum to 100. Remember to drop super overs before calling entry_order.
C2. Evaluate this player — a profile card. ⭐⭐ Write profile_card(model, name, env) that prints a batter's balls by phase, run index by phase, dismissal index, and his raw versus shrunk tilt, using model.profiles and model.indices(env). Test it on Suryakumar Yadav, Heinrich Klaasen and Sai Sudharsan (IPL 2022–26). Expected output: one small table per player. Which of the three would you want facing the most balls, and why?
Expected shape: for each player, one row of balls (total, powerplay, middle, death), three run indices, a dismissal index and the raw and shrunk tilts. Players with few death balls will show death indices close to their middle-overs index. That isn't a bug: by default the model carries one tilt across phases (§30.2).
C3. Optimize this strategy — Sunrisers Hyderabad. ⭐⭐⭐ Adapt code/04_order_search.py to SRH's most-used 2026 XI (Abhishek Sharma, Head, Ishan Kishan, Klaasen, Nithish Kumar Reddy, Aniket Verma, Arora, …). Report: the usual order's rank among 5,040; the best re-checked order and its gain in runs and WP; the slot heat map for the top 100. Then run bo.local_search from three random starting orders. Do all three reach the same plateau?
Hint: build the XI exactly as code/05_power_hitter.py does (most appearances in 2026, ordered by mean entry position). Seed the random starting orders (np.random.default_rng(30).permutation(7)). Expect a run time of under a minute for the full search; local search should take a few seconds per start.
C4. Analyze this match — a real innings re-ordered. ⭐⭐⭐ Pick a real IPL 2026 first innings that collapsed (find one with 5+ wickets down before over 12 in entry_order). Simulate the side's real XI in its real order and in the order the search recommends, both at that match's env_par. Output: the expected totals and P(≥ the real total) for both orders. Then write two sentences on whether the batting order or the collapse explains the real total.
C5. Optimize this strategy — a matchup-aware floating rule. ⭐⭐⭐ Extend floating_policy so that, when a wicket falls, the choice between two candidates also uses the bowling types due to bowl the next two overs. Use Chapter 11's shrunk matchup deviations (crease.matchups) to adjust each candidate's run tilt for those overs. Test it on Anchor D's semi-final XI (South Africa, 2026 T20 World Cup, match 1512771), giving de Kock's off-spin deficit (shrunk SR 115.5 v expected 125.8) to the simulator. Report the gain over the fixed order in runs, with a paired margin of error. Expect a run or less, and say whether the gain survives a fresh seed.
Hint: the simulator has no bowler identities. The simplest version assumes a bowling plan, for example "off-spin bowls overs 2, 7 and 12", and applies the matchup deviation to the tilt only in those overs. Convert a shrunk strike-rate deviation into a tilt with the same bisection BatterModel._solve uses, or approximate: a 1% change in expected runs per delivery is about a 0.005 change in tilt at the IPL 2026 scoring level (check this with model._er).
C6. Settle this debate — how robust is the nightwatchman rule? ⭐⭐ Rerun code/07_nightwatchman.py under four rule variants: usual position ≥ 8 or ≥ 7; ≤ 5 down or ≤ 4 down. For each variant, output the count of inferred nightwatchmen, the day-1 share arriving in nominal overs 80–90, the median balls faced, and the protected-batter difference with its interval. Which conclusions are stable across variants, and which move?
Expected shape: a 4-row table (one per variant) with columns rule, n, share_80_90_day1, median_balls, protected_diff, lo90, hi90. Loosening the rule to usual position ≥ 7 will pull in genuine No. 7 all-rounders promoted for tactical reasons, so expect the day-1 share to fall.
C7. Build this metric — runs per ball transferred. ⭐⭐⭐ Modify promotion_table to also report, for each slot, the expected balls and runs of every batter, so that you can compute where the promoted batter's extra balls came from. Output for David No. 6 → No. 3: a table of each batter's change in balls and runs. Confirm that the team's +1.6 runs equals David's gain minus the others' losses.
Expected shape: an 11-row table (one per batter) with balls and runs at No. 6 and at No. 3 and their differences. The batting-runs differences won't sum exactly to the team's change, because the simulator's team total also includes extras. Report the gap and explain it.
C8. Predict this match — the profile model, out of time. ⭐⭐⭐ Repeat the §30.3 test for a different competition: fit BatterModel on the BBL 2021/22–2024/25 seasons and simulate each complete first innings of the latest BBL season in the data with the real XI in the real order. Output: MAE and bias for the slot-average and lineup forecasts, the standard deviation of the lineup effect, and the regression slope with its 90% interval. Is the conclusion ("lineup quality is real but untestable in one season") the same as in the IPL?
Part D — Judgment & Format Transfer ⭐⭐⭐
D1. Would the chapter's T20 method (situation cells, run tilts, an order search) work for ODIs? Name two things you'd have to change (think about the length of an innings, the phases, and how often the tail bats) and one result you'd expect to differ.
D2. In Tests, nobody optimises the top order by simulation, yet the nightwatchman is argued over constantly. Why does the order matter less in Tests than in T20, while one specific slot decision (the nightwatchman) matters more? Use the slot-budget numbers from §30.1 (Tests: Nos. 8–11 face 15.4% of balls).
D3. Wendell says: "Your model treats a batter like a dice with weights on it. Real batters bat differently depending on who's at the other end, how they're feeling, and whether they've been told they're opening." Which of these does the chapter test (and what did it find), which could be tested with more data, and which can't be tested from ball-by-ball data at all?
D4. A franchise analyst presents the "best order" from §30.4 to a coach as the answer. Write the 100-word version you would present instead, using the plateau, the extrapolation warning and the win-probability conversion.
D5. The out-of-time test in §30.3 couldn't confirm that the model's lineup ratings predict totals (slope 0.44, 90% CI −0.94 to 1.82). Does that mean the batting-order recommendations should be ignored? Argue both sides, then say what evidence would change your mind.
D6. Kohli's run index (98.0) is below average, yet the search puts him in the top three of RCB's best orders. A journalist calls this "the model contradicting itself". Write a short reply (four or five sentences) that explains the result without any formula, then name the one piece of evidence in the chapter you'd point the journalist to.
Part M — Mixed / Interleaved ⭐⭐–⭐⭐⭐
M1. (Chapters 6 and 30) Chapter 6 found ~98 balls as the half-signal point for strike rate; this chapter's out-of-time test chose k = 100 for run tilts. Explain why two different methods (a reliability split and a forecasting test) should land near the same number, and name one situation where they wouldn't.
M2. (Chapters 12 and 30) Chapter 12 measured a settling-in cost of about 2.47 runs per new batter in the IPL. Add a simple settling effect to OrderSimulator (each batter's tilt reduced by a fixed amount for his first 10 balls, calibrated so the cost is about 2.5 runs). Rerun the David promotion table. Does the best slot change?
M3. (Chapters 20 and 30) Replace fit_defend_curve with Chapter 20's winprob model (WP v1, WPModel.predict for a chase of total + 1 off 120 balls). Compare the WP gains from §30.4 under both curves. Is the ranking of orders by WP different from the ranking by expected runs? Why might it be at the extremes?
M4. (Chapters 21 and 30) Chapter 21 found an extra bowling option has no measurable effect on winning. Use this chapter's simulator to price the batting side of that choice. Replace RCB's No. 7 (Krunal Pandya) with a specialist batter of run index 105 and dismissal index 95 (a generic profile), and report the change in expected runs. Is it bigger or smaller than the best re-ordering gain?
M5. (Chapters 27 and 30) Chapter 27's in-match chain projects totals with a league-average batting order. Write a function that projects a total from a live state (score, balls, wickets) with the actual batters still to come, by starting OrderSimulator mid-innings. Compare its projections with Chapter 27's project_total at the 10-over mark for five IPL 2026 first innings. How different are they, and when?
M6. (Chapters 29, 33 and 30) The nightwatchman's costs (§30.8) are in runs; Test decisions are in win/draw/loss. Using Chapter 33's WTC points (win 12, draw 4, loss 0), sketch an argument for when a 4–5-run cost is worth paying for a cheaper wicket. Which match situations (lead, overs left, chasing or setting) make the nightwatchman more or less attractive?
M7. (Chapters 10 and 30) Chapter 10's Kaplan–Meier tools measured how long specialists survive in Tests. Use them to compare protected batters' survival curves after a nightwatchman with their own survival curves in other innings (same batters, same positions). Report P(survive 30 balls) and the median for both. Does the survival comparison tell the same story as the runs comparison in §30.8 (−4.0 runs), or a different one?
Part E — Research & Extension ⭐⭐⭐⭐
E1. Translated profiles for the BPL. The checkpoint showed Kane Williamson profiled on 54 BPL balls. Extend BatterModel to accept deliveries from several leagues, with each league's run tilts adjusted by Chapter 26's translation factors (crease.translation) before shrinkage. Fit it on the BPL plus the PSL, the IPL and men's T20Is (2022–26), re-profile Rajshahi Warriors' final XI and rerun the local search. Report how much the recommended order changes, and test whether translated profiles forecast BPL 2025/26 batter-phase runs better than BPL-only ones (the out-of-time test of §30.2).
E2. A chase-aware batting order. Build a policy for OrderSimulator that runs second innings against a target. At each wicket, choose the next batter (from those remaining in the top seven) to maximise win probability rather than expected runs, using a quick look-ahead (simulate the rest of the chase for each candidate with 200 common-random-number innings). Compare it with the fixed order for targets of 170, 200 and 230 at the IPL 2026 level. This is where floating roles should earn their keep: by how much, and for which targets?
E3. The women's game, everywhere. Run Case Study 1's pipeline on every WPL 2026 side and on the 2026 women's T20 World Cup semi-finalists (women's T20Is). For each side, report the usual order's rank among 5,040, the best gain, and the best slot for the batter with the highest run index. Do women's sides leave more or less on the table than the IPL's ten (§30.5)? Write up the result as a one-page note for a women's franchise, with the plateau and the extrapolation warnings stated plainly.