Bengaluru, 5 April 2026. Royal Challengers Bengaluru are 151/3 against Chennai Super Kings when the fifteenth over begins, and Tim David walks out at No. 5. He faces 25 balls and makes 70 not out. RCB finish on 250 and win. It is one of the innings...
In This Chapter
- Ten balls a night
- 30.1 Who batted where? Positions from the order of arrival
- 30.2 A batter's per-ball profile
- 30.3 Simulating innings with real people at the crease
- 30.4 Searching for the best order
- 30.5 "Promote the power hitter": the test
- 30.6 Floating roles versus fixed slots
- 30.7 Left and right: respecting a small effect
- 30.8 The nightwatchman: what the data allows
- 30.9 What the batting order can't see
- Spaced Review
- Project Checkpoint: crease.batting_order
- Chapter Summary
- What's Next
Chapter 30 — Optimal Batting Order: Where Should Each Batter Bat and Why the Traditional Order Is Often Wrong
Ten balls a night
Bengaluru, 5 April 2026. Royal Challengers Bengaluru are 151/3 against Chennai Super Kings when the fifteenth over begins, and Tim David walks out at No. 5. He faces 25 balls and makes 70 not out. RCB finish on 250 and win. It is one of the innings of their title-winning season, and one of the few in which David got enough of the strike to show what he can do.
Here is his whole 2026 IPL season, as the book's data snapshot records it. Cricsheet doesn't say who batted where, so code/01_entry_positions.py works it out from the order in which batters arrived:
Tim David, IPL 2026: 15 innings, positions {4: 1, 5: 4, 6: 8, 7: 2}
entered in over (median) 15; mean balls 10.80; runs 305 off 162 (SR 188.3); innings of <10 balls: 8
match_id innings position entry_over entry_wkts entry_score runs balls out
1527674 2 6 13 4 163 16 10 0
1527684 1 5 15 3 151 70 25 0
1527689 1 7 9 5 76 13 9 1
1527693 1 4 15 2 185 34 16 0
1529266 2 6 13 4 121 14 8 0
1529269 1 5 11 3 105 26 17 1
1529277 2 6 16 4 171 10 9 0
1529285 1 6 9 4 80 9 6 1
1529293 2 6 11 4 106 40 17 1
1529297 2 7 16 5 131 0 1 1
1529300 2 5 17 3 157 2 3 1
1529304 1 5 16 3 157 28 12 1
1529310 2 6 19 4 178 15 7 0
1535462 1 6 17 4 189 4 5 1
1535465 2 6 9 4 91 24 17 1
Three hundred and five runs at a strike rate of 188.3. The strike rate is runs per 100 balls faced. Yet in eight of his fifteen innings he faced fewer than ten balls. His median arrival was the fifteenth over. In the final against Gujarat Titans (the last row) he came in at 91/4 in the ninth over of a chase and made 24 off 17. Over the whole season he averaged 10.8 balls a night.
So here's the question every T20 fan has shouted at a television. If David scores that fast, why does he get ten balls while the No. 3 gets eighteen? The analyst's version of that shout goes like this: most T20 teams should promote their best power hitter, because batting him at No. 6 wastes 10–15 balls of his potential innings.
It's a good claim to test, because it is half right in an interesting way. The balls are real. In our simulations, moving David from No. 6 to No. 3 gives him about 11 more balls a match. What those balls are worth is a different matter, and it is much smaller than the shouting suggests. Some of the cost lands on whoever he displaces. Some of it depends on an assumption nobody can check from data: that a man who has faced no powerplay balls in five IPL seasons would hit new-ball bowling the way he hits the death.
This chapter builds the machinery to answer the question properly. First we infer batting positions from entry order and measure what each slot really gets. Then we build a per-ball profile for every batter, by phase and properly shrunk, and simulate innings with named people at the crease: Chapter 19's Markov chain with faces. That lets us search all 5,040 orderings of RCB's top seven. We test "promote the power hitter" on all ten IPL 2026 sides, ask whether floating roles beat fixed ones, and respect Chapter 12's finding that left-right combinations show no reliable effect in any format. Last, we leave T20 for the oldest batting-order argument in the game: should a Test side send in a nightwatchman?
You will finish with two kinds of answer. Some questions the data settles, with numbers. Some it can't settle, and we'll say exactly why.
🏏 Fan Track: Read the hook, §30.1 (what each batting position really gets), §30.4's headline result, §30.5 (the power-hitter verdict), §30.8 (the nightwatchman) and the Chapter Summary. Every result is restated in prose.
📊 Analyst Track: Everything, especially §30.2–30.4: separating who is batting from how batters bat in a situation, choosing shrinkage by an out-of-time test, a ball-by-ball simulator with strike rotation, common random numbers, and exhaustive versus local search with the optimiser's curse.
🧑💼 Franchise Track: §30.3 (how much of a lineup's quality you can actually forecast), §30.4–30.6 and the decision framework in the Chapter Summary. The useful output is a short list of orders that are all about equally good. That gives you room for the dressing room's opinions.
30.1 Who batted where? Positions from the order of arrival
The cricket question. Before we can argue about where someone should bat, we need to know where he did bat. Scorecards print a batting order, but Cricsheet's ball-by-ball files don't carry one. They record who was on strike and who was at the other end for every delivery, and that's enough.
📐 Definition — inferred batting position: A batter "arrives" on the first delivery on which he appears as either striker or non-striker. Batters are numbered in order of arrival. On the very first delivery the striker is No. 1 and the non-striker No. 2. Ties within a delivery are broken striker-first. A batter who retires and returns keeps his first number. (Chapter 21's
selection.entry_positionsuses the same rule.batting_order.entry_orderadds what each batter did and the state of the innings when he arrived.)
Two quirks come with it. A batter who never faced a ball and was never at the non-striker's end when a ball was bowled does not appear at all. Think of a No. 11 who walks out as the last ball of the innings is bowled, with nobody out. And an arrival that doesn't follow a dismissal means a retirement, an Impact Player substitution or a data glitch. The script counts these cases:
ipl = load_deliveries("ipl")
ipl = ipl[~ipl["super_over"]]
e_ipl = bo.entry_order(ipl)
first_two = e_ipl[e_ipl["position"] <= 2]
print((first_two["entry_legal"] == 0).mean()) # openers arrive before ball one
odd = e_ipl[(e_ipl["position"] >= 3) & (e_ipl["entry_wkts"] < e_ipl["position"] - 2)]
IPL batter-innings with an inferred position: 19,111 | team innings: 2,480
Positions 1-2 arriving on the first ball of the innings: 100.00%
Arrivals at No. 3+ with fewer dismissals than the slot implies (retirements, Impact-Player swaps): 102 (0.72%)
Fewer than one arrival in a hundred is out of step, and those are real events (retired-out tactics, injuries), not errors. In ODIs and Tests a handful of team innings even have a No. 12. That is a concussion replacement who batted. It happened in 0.20% of men's ODI team innings and 0.37% of Test team innings since 2016.
What each slot actually gets. With positions in hand, the most useful table in the chapter is a simple one. For each position: how often does he bat at all, how many balls does he face, and when does he walk in?
def position_table(entry):
n_inns = entry.groupby(["match_id", "innings"]).ngroups
g = entry.groupby("position")
return pd.DataFrame({
"batted_pct": 100 * g.size() / n_inns,
"balls_if_batted": g["balls"].mean(),
"balls_per_inns": g["balls"].sum() / n_inns, # the slot's real budget (0 if he didn't bat)
"runs_per_inns": g["runs"].sum() / n_inns,
"median_entry_over": g["entry_over"].median(),
"sr": 100 * g["runs"].sum() / g["balls"].sum(),
})
IPL 2023-26 — 582 team innings
batted_pct balls_if_batted balls_per_inns runs_per_inns median_entry_over sr
position
1 100.00 19.62 19.62 30.03 1.0 153.09
2 100.00 21.85 21.85 34.32 1.0 157.11
3 99.31 18.27 18.15 28.19 3.0 155.36
4 98.11 17.36 17.04 25.30 7.0 148.48
5 92.10 14.79 13.62 20.05 11.0 147.20
6 82.82 11.99 9.93 14.75 13.5 148.61
7 71.13 9.82 6.99 10.60 16.0 151.70
8 56.19 7.22 4.06 5.73 17.0 141.11
9 40.89 5.35 2.19 2.49 18.0 113.81
10 28.52 3.79 1.08 0.91 19.0 84.42
11 17.70 2.64 0.47 0.35 19.0 74.63
Read the balls_per_inns column as a budget. In the IPL since the Impact Player rule arrived in 2023, No. 3 gets 18.15 balls per team innings and No. 6 gets 9.93. The gap is 8.22 balls. That's the real version of the "10–15 balls wasted" claim: about eight balls, on average across the league. No. 6 bats in 82.8% of innings and usually walks in during the fourteenth over. In IPL 2026 the No. 6 faced 12.31 balls on average, and 48.3% of the time he faced fewer than ten.
Now compare the formats (full script: code/01_entry_positions.py):
Share of all balls faced (wides excluded) by slot group:
IPL 2023-26 1-3: 51.8% 4-5: 26.7% 6-7: 14.7% 8-11: 6.8%
Men's T20Is (FM) 2023-26 1-3: 47.6% 4-5: 26.9% 6-7: 16.6% 8-11: 9.0%
Women's T20Is (FM) 2023-26 1-3: 55.5% 4-5: 25.7% 6-7: 12.7% 8-11: 6.1%
WPL 2023-26 1-3: 52.4% 4-5: 26.3% 6-7: 13.6% 8-11: 7.7%
Men's ODIs (FM) 2016-26 1-3: 47.2% 4-5: 26.6% 6-7: 15.8% 8-11: 10.3%
Men's Tests 2016-26 1-3: 38.8% 4-5: 25.8% 6-7: 20.1% 8-11: 15.4%

📊 Figure (described): Share of a team's balls faced by batting positions 1–11 in four competitions. All four curves fall steeply after No. 4. The women's T20I curve is highest at the top: positions 1–3 take 55.5% of the balls. Men's T20Is spread the balls a little further down the order than the IPL does. The shape is the same everywhere: the top three get about half the innings and Nos. 6–7 get about a seventh.
In women's T20Is between full members, the top three face 55.5% of the balls: the top order bats longer and the lower order gets less. In Tests the balls are spread further down: Nos. 8–11 face 15.4%, because a Test innings usually ends with all ten wickets down and the tail has to bat. Format changes the budget, and so it changes what a slot is worth.

📊 Figure (described): For each IPL batting position in 2023–26, a box showing the middle half of the overs in which that position arrived, with the death overs (16–20) shaded. No. 3 usually arrives in the powerplay, No. 5 around over 11, No. 6 around over 13–14, No. 7 at the start of the death. The boxes for Nos. 5–7 are wide. When a No. 6 walks in depends heavily on how the top order fared.
That width is the first hint of what follows. A fixed slot is not a fixed job. The No. 6 might arrive in the sixth over to rescue 40/4 or in the eighteenth to slog. Hold that thought for §30.6.
🔄 Check your understanding 1. Why does position 2 face slightly more balls than position 1 in the IPL table (21.85 v 19.62), when both openers arrive on the first ball? 2. A team's No. 6 averages 15 balls per innings when he bats. Why might his "balls per team innings" still be well under 15?
Answer
- Position 1 is simply the opener on strike for ball one. After that, who faces more depends on singles, the end-of-over swap and which opener is dismissed first. The table measures arrival order, not "the better opener", and it can't tell you why the gap exists. If you want to explain it, check which opener is out first more often.
- Because he only bats in some innings: 82.8% of IPL team innings for a No. 6 in 2023–26. The budget counts zero for the innings in which he never walked out, and those are the innings in which the top order batted longest.
30.2 A batter's per-ball profile
The cricket question. To compare orders we need to know what each batter does with a ball, at each stage of an innings. And we need to know it without being fooled by where he has batted.
That second clause is the whole difficulty. Chapter 19's Markov chain (Chapter 19) gives the per-ball outcome mix in each state, (over, wickets lost). It is a chain for a league-average batting order. At six down in over 13, the chain's numbers describe whoever usually bats there. Mostly that's a lower-order hitter or a bowler. The wickets-lost index carries two things at once:
- who is batting (at six down, a worse batter on average), and
- how batters bat in that situation (more carefully when wickets are short, harder when overs are short).
For a batting-order model we must pull these apart. If we didn't, putting Virat Kohli in at six down would give him a tail-ender's outcomes.
📐 Definition — situation cell, run tilt, dismissal multiplier: For a delivery faced by batter b in situation c (innings × over band × wickets-lost band), the outcome probabilities are the Chapter 19/27 chain's probabilities for that over and wicket count with two adjustments. (1) Every run-scoring outcome is reweighted by exp(θ × runs), with θ = θ_env (the match's scoring environment, Chapter 27) + θ_c (the situation) + θ_b (the batter). (2) The wicket probability is multiplied by m_c × m_b. θ_b is the batter's run tilt and m_b his dismissal multiplier. A batter with θ_b = 0 and m_b = 1 is the delivery-weighted average batter. The run index reports θ_b as 100 × his expected runs per delivery ÷ an average batter's, in the same situations.
The tilt is the same device Chapter 27 used to centre the chain on a scoring environment (Chapter 27). There it moved a whole innings up or down. Here it moves one batter.
Fitting it: who versus how. The model is a two-way fit, like the matchup expectations of Chapter 11, and the fitting alternates between the two sides:
for _ in range(self.n_iter):
# (a) batters: given the situation terms, solve each batter's raw tilt so that his expected
# runs equal his real runs; raw multiplier = real outs / expected outs; then shrink
base = th_env + th_cell[cell]
raw_all = self._solve(b, base, o, wl, obs, nb)
th_b = prior_g + (raw_all - prior_g) * n_b / (n_b + self.k_run)
m_b = (outs + self.k_out * r * prior_m) / (e_out + self.k_out * r)
# (b) situations: given the batters, solve each cell's tilt and multiplier
th_cell = self._solve(cell, th_env + th_bp[bp], o, wl, obs, nc) * n_c / (n_c + self.k_cell)
m_cell = (w_c + self.k_cell_out) / (e_c + self.k_cell_out)
Full code: project/crease/batting_order.py, class BatterModel. We fit it on every IPL delivery from 2022 to 2026, both innings, with each delivery judged against its own match's scoring level (Chapter 20's past-only env_par). That's 86,297 deliveries and 341 batters. Chasing deliveries help to measure batters, and the situation cells are fitted separately for each innings so that chase behaviour doesn't leak into the first-innings simulator. Here is what separating who from how does to one awkward state:
First innings 2022-26, overs 12-15: real per-delivery rates by wickets lost, the model's fit for the
batters who actually faced, and the model's rates for an AVERAGE batter in the same situation:
state deliveries real_runs real_p_out model_runs model_p_out avg_batter_runs avg_batter_p_out
2 down 1983 1.6586 0.0540 1.6634 0.0525 1.6242 0.0532
4 down 1811 1.3390 0.0392 1.3410 0.0383 1.3354 0.0394
6-7 down 489 0.9509 0.0716 0.9554 0.0640 1.0014 0.0596
Who faces those balls (usual-slot group of the striker, first innings, overs 12-15, 6-7 down):
6-7 46.8
8-11 34.2
4-5 14.7
1-3 4.3
At six or seven down in overs 12–15, the real batters scored 0.951 runs per delivery and were dismissed on 7.16% of them. An average batter in the same spot would score 1.001 and go out on 5.96%. The difference is the tail: 34.2% of those deliveries were faced by players who usually bat 8–11. The situation still pulls everyone down. Even an average batter scores far less at six down than at two (1.00 against 1.62 per delivery), because batters really do play differently when wickets are short. Both effects are real, and the model now holds them separately.
🔍 Why this works: The two-way fit is identified because batters move between situations. Kohli has batted at 0 down in over 1 and at 4 down in over 15. Bhuvneshwar Kumar has batted almost only at 7+ down. Comparing the same batter across situations measures the situation. Comparing different batters in the same situation measures the batters. Where a cell is visited almost only by tail-enders, the two can't be separated, and the cell is shrunk toward neutral (
k_cell) rather than trusted. That's also why Chapter 11's matchup expectations used leave-one-out cells: an estimate should not be built from the very thing it is trying to separate.
Shrinkage — chosen by a test, not by taste. Each batter's tilt is shrunk toward the average of batters with the same usual slot (1–3, 4–5, 6–7, 8–11). That prior matters most for tail-enders with 30 balls to their name. Shrinking a bowler toward the league average batter would turn him into a respectable No. 6. The usual slot is used only as a prior. For a top-seven batter with 600+ balls it barely matters.
How hard should we shrink, and should each batter get his own phase profile (a powerplay tilt, a middle-overs tilt, a death tilt)? We let the future decide. We fit on IPL 2022–25, predict every batter's runs and dismissals in IPL 2026, and score the forecasts:
Out of time: fit IPL 2022-25, test IPL 2026 (17,260 deliveries; 175 batter-phase cells with 30+ deliveries).
model k_run k_phase k_out mse_x1000 logloss out_mse_x1e5
situation only (every batter average) - - - 82.5694 0.1972 26.5724
batter model 50 no phase deviation 554 74.7369 0.1966 24.0282
batter model 100 200 554 76.5997 0.1966 24.0282
batter model 100 800 554 74.3342 0.1966 24.0282
batter model 100 no phase deviation 554 73.8436 0.1966 24.0282
batter model 400 no phase deviation 554 74.7717 0.1966 24.0282
batter model 1600 no phase deviation 554 76.8300 0.1966 24.0282
batter model 100 no phase deviation 138 73.8436 0.1967 25.7541
batter model 100 no phase deviation 1108 73.8436 0.1966 23.8768
batter model 100 no phase deviation inf (group only) 73.8436 0.1969 26.6221
raw (no shrinkage) 0 0 0 98.7536 0.2061 58.0398
(Rows selected; the script prints the full grid.) Three findings, each worth carrying forward:
- Batter identity helps, but only when shrunk. Knowing who is batting cuts the scoring error from 82.6 to 73.8 (×10⁻³ runs² per ball). Raw records are worse than ignoring batters altogether (98.8). This is the small-sample lesson of Chapter 6 again. The best run-tilt shrinkage is about 100 balls, close to Chapter 6's ~98-ball half-signal point for strike rate.
- Phase-specific deviations made forecasts worse at every strength tried. A batter's death-overs record, beyond his general level, didn't predict his next season's death overs. That matches Chapter 31's finding that phase skill is mostly general skill. So by default each batter carries one tilt across phases. His phase profile still changes, because the same tilt acts on a very different situation in over 3 and in over 19, but it doesn't carry a separate phase "skill".
- Dismissal shrinkage barely matters within a broad range. The error is flat between 554 and 2,216 balls of prior weight. We keep Chapter 6's 554, a half-signal point. Using no batter-specific dismissal information at all (group only) is clearly worse (26.6 against 24.0).

📊 Figure (described): Each IPL batter's raw run tilt (faint dot) and shrunk tilt (cross) against deliveries faced, on a log scale, coloured by usual slot group. Below about 100 deliveries the crosses collapse onto their group's average. Tail-enders are pulled toward a clearly negative value and top-order batters toward a slightly positive one. Above 1,000 deliveries raw and shrunk values nearly coincide.
RCB's batters. Here are the profiles that feed the rest of the chapter, at the IPL 2026 scoring level (mean env_par 190.1):
RCB 2026 squad batters (indices at env 190.1; 100 = average batter in the same situations):
group balls balls_pp balls_mid balls_death run_idx_pp run_idx_mid run_idx_death out_idx
player
VR Iyer 1-3 895 337 420 138 105.8 105.0 104.9 108.9
PD Salt 1-3 746 508 219 19 119.0 116.8 116.1 120.6
V Kohli 1-3 2165 1032 957 176 97.7 98.0 98.0 76.6
D Padikkal 1-3 1014 384 558 72 96.2 96.7 96.7 121.7
RM Patidar 4-5 938 181 624 133 114.3 112.6 112.2 101.0
JM Sharma 4-5 738 23 436 279 104.4 103.9 103.8 108.5
TH David 6-7 674 0 211 463 105.7 104.9 104.8 82.5
KH Pandya 6-7 669 62 403 204 87.5 89.4 89.4 100.6
R Shepherd 6-7 145 0 52 93 104.9 104.2 104.1 98.8
B Kumar 8-11 161 0 45 116 65.9 71.8 71.0 123.7

📊 Figure (described): For each RCB batter, three bars give his run index in the powerplay, middle overs and death (100 = an average batter in the same situations), and a diamond gives his dismissal index. Phil Salt and Rajat Patidar have the tallest bars. Virat Kohli's bars sit just under 100, but his diamond is the lowest of the top order (76.6): he is very hard to dismiss. Devdutt Padikkal combines a below-average run index with a high dismissal index. Bhuvneshwar Kumar's bars are about 70.
Two things stand out. First, Kohli's value is survival, not speed. Relative to the situations he batted in, his scoring is a shade below average (run index 98). His dismissal index of 76.6 is among the lowest in the league: only Sai Sudharsan (75.6) is lower among IPL regulars with 600+ balls. Second, David is unusual for a "finisher": his run index is solidly above average (104.9 in the middle overs) and he is hard to dismiss (82.5). That combination, scoring above average while rarely getting out, is exactly what makes a batter worth more balls.
Notice also the balls_pp column. David has faced no powerplay balls in IPL 2022–26. His powerplay run index of 105.7 is an extrapolation: his general tilt applied to powerplay situations. Remember that zero. It decides how far to trust §30.5.
⚠️ Common pitfall: Comparing batters' raw strike rates by position. A No. 6's strike rate is inflated by death-overs hitting and deflated by rescue jobs, and a No. 3's is shaped by the powerplay. Players are also chosen for slots because of their records, so the position and the record aren't independent. Compare each batter with the average batter in the same situations, then shrink. The position table in §30.1 describes slots, not the people in them.
🔄 Check your understanding 1. The model gives Kohli a run index below 100 but ranks him among the most valuable batters in RCB's order. How can both be true? 2. Why shrink a tail-ender toward the average of Nos. 8–11 rather than toward the league-average batter?
Answer
- Value in a batting order comes from runs per ball and from balls survived. Each dismissal costs the team a batter and brings in someone worse. A batter who scores at about the average rate but is dismissed 23% less often than average keeps better batters' resources in hand and faces more of the innings himself.
- Because a tail-ender with 30 balls has told us almost nothing, and the best guess for "a bowler we know little about" is the typical bowler-who-bats, not the typical batter. The out-of-time test confirms the general point: the shrinkage target matters most where the data is thinnest.
30.3 Simulating innings with real people at the crease
The idea. With a profile for every batter, an innings can be played out ball by ball. The simulator, batting_order.OrderSimulator, keeps track of:
- the striker and non-striker, by name: strike changes on odd runs and at the end of every over;
- the new batter, who comes in on strike after a dismissal (the 2022 Law change: the new batter takes strike regardless of crossing, unless the over has ended);
- the over and the wickets lost, which select the situation cell;
- each batter's tilt and multiplier, applied to that cell;
- the innings' own scoring level, as in Chapter 27: each simulated innings draws its tilt from the environment plus a spread.
for _ in range(240): # deliveries; an innings ends at 120 legal balls or 10 wickets
rr = rng.random(n) # the SAME random numbers for every order (see §30.4)
act = (u < 120) & (w < 10)
idx = np.flatnonzero(act)
c = self.cum[lev[idx], striker[idx], u[idx] // 6, w[idx], lr] # striker's outcome CDF in this cell
k = (c < np.tile(rr, no)[idx][:, None]).sum(1) # draw the outcome
tot[idx] += R[k]; u[idx] += L[k]
swap = (np.where(L[k], R[k], np.maximum(R[k] - 1, 0)) % 2 == 1) & ~W[k]
# ... wicket: striker replaced by the next batter (on strike); end of over: swap ends
Two simplifications, stated plainly. The batter dismissed is always the striker: non-striker run-outs are a percent or two of dismissals, folded in. And extras rotate the strike only through runs actually run. Neither moves the orders' ranking.
The spread. Chapter 27 tuned the innings-to-innings spread on the whole men's T20 pool (associates included) at 0.07. On the IPL alone that is too wide: our first runs gave a standard deviation of 41 runs against a real 36.7 in 2026. We use Chapter 19's IPL 2023–26 value, 0.04, instead.
Check one: does an average lineup look like the IPL? We give every slot its group's average profile and simulate 20,000 innings at the IPL 2026 level (full script: code/03_simulate_validate.py):
IPL 2026: 71 complete first innings, mean 195.8, sd 36.7; mean env_par 190.1
Average lineup at env 190.1: mean 192.6, median 193, sd 37.3, all out 10.0%, mean wickets 6.42
Balls faced per team innings by slot — real IPL 2023-26 v simulated average lineup:
1 2 3 4 5 6 7 8 9 10 11
real_balls_per_inns 19.62 21.85 18.15 17.04 13.62 9.93 6.99 4.06 2.19 1.08 0.47
sim_balls_per_inns 21.53 20.92 19.21 17.67 14.30 11.23 7.24 3.35 1.89 1.22 0.57

📊 Figure (described): Paired bars of balls faced per team innings by slot: real IPL 2023–26 (blue) against the simulator with an average lineup (orange). The two profiles match closely. The simulator gives Nos. 1–6 slightly more balls and No. 8 slightly fewer. That's expected, because the real table includes second innings that stop when the target is reached.
The simulated spread (37.3) matches the real one (36.7), and the balls-by-slot budget is close. The real table includes chases that end early, which trims the real top order's balls. The mean is 192.6 against a 2026 environment of 190.1 and a real 2026 mean of 195.8. Chapter 20's environment is past-only, so it always lags a rising league a little.
Check two: RCB's final XI in its usual order. RCB's team sheet for the 2026 final lists twelve names, because the Impact Player rule allows a substitute. We take the eleven batters (leaving out the seamer Jacob Duffy) in RCB's usual 2026 order: Venkatesh Iyer, Kohli, Padikkal, Patidar, Jitesh Sharma, David, Krunal Pandya, Romario Shepherd, Bhuvneshwar Kumar, Josh Hazlewood, Rasikh Salam. (In the final itself, a chase, Krunal batted at No. 5 and Jitesh at No. 7.)
RCB 2026 final XI, usual order, env 190.1: mean 198.5, sd 36.2, P(>=190.3) 0.597, P(200+) 0.500
slot player exp_balls exp_runs
1 VR Iyer 21.2 34.7
2 V Kohli 26.4 41.6
3 D Padikkal 17.1 25.8
4 RM Patidar 16.9 29.7
5 JM Sharma 13.1 21.1
6 TH David 11.4 19.7
7 KH Pandya 6.5 9.7
Batting first, this XI would expect about 198, with a 59.7% chance of reaching 190.3, Chapter 19's IPL 2023–26 par. David's simulated 11.4 balls at No. 6 sits right on his real 2026 average of 10.8.
Check three, the hard one: can we forecast a lineup's quality at all? Fit the profiles on 2022–25 only. For each of the 71 complete IPL 2026 first innings, simulate 2,000 innings with the real XI in the real order. Then ask whether the innings the model expected to be strong actually scored more:
Out of time, 71 complete IPL 2026 first innings (profiles fitted on 2022-25):
slots_mean : MAE 30.39, bias +2.43, corr with actual -0.090
lineup_mean : MAE 30.62, bias +2.00, corr with actual 0.012
lineup effect (lineup forecast − slot-average forecast): sd 5.38, range -11.5 to +12.8
regression of (actual − slot forecast) on lineup effect: slope 0.44 (90% CI -0.94 to 1.82), intercept +2.2
80% range coverage (lineup sims): 84.5%

📊 Figure (described): Each dot is one IPL 2026 first innings. The horizontal axis is how many runs better than a slot-average XI the model expected this lineup to be. The vertical axis is how many runs above the slot-average forecast the team actually made. The cloud is wide and nearly flat. The fitted slope (0.44) sits below the dashed slope-1 line, and its 90% interval runs from −0.94 to 1.82.
This is the most important humility check in the chapter. Lineups really do differ, by a standard deviation of about 5.4 runs in the model, from about −11 to +13. But one innings has a spread of 36 runs. With only 71 innings, a 5-run signal can't be confirmed or ruled out: the interval on the slope includes both 0 (lineup quality means nothing) and 1 (the model is exactly right). The model isn't wrong. It is untestable at this scale, which is Theme 3 and Theme 6 in one table. The coverage check (84.5% of real totals inside the 80% range) says the simulator's spread is honest, if a touch wide.
Keep the scale in mind for everything that follows. If a whole lineup's quality is a ±5-run effect that one season can't verify, a batting order's effect will be smaller still.
🔄 Check your understanding 1. Why does the out-of-time test fit profiles on 2022–25 rather than on all of 2022–26? 2. The slope's 90% interval includes 1. Does that mean the model is confirmed?
Answer
- Because the test innings are from 2026. A profile that has already seen those innings would partly "predict" them from their own outcomes, which is leakage.
- No. It includes 0 too. An interval that wide means the data can't tell the model apart from "lineup quality doesn't matter" at this sample size. Confirmation would need an interval that excludes 0.
30.4 Searching for the best order
🧩 Productive struggle: Before reading on, write down RCB's best order from the final XI's top seven (Iyer, Kohli, Padikkal, Patidar, Jitesh Sharma, David, Krunal Pandya), using only the profile table in §30.2. Then answer two questions. How many runs a match do you think separates the best order from RCB's usual one? And how many separate the best from the worst? Keep your answers; the search below will check them.
How many orders? Eleven batters can be arranged in 11! = 39,916,800 ways. Almost all of them are silly, because nobody needs a search to keep Hazlewood out of the top six. The standard pruning is to fix the tail (Nos. 8–11 in their usual order) and permute the top seven: 7! = 5,040 orders. That's small enough to try them all, if each one is cheap to evaluate.
Common random numbers. Here is the trick that makes it cheap. To compare two orders, run them on the same random numbers: the same uniform draw decides delivery k of simulated innings i for every order. Luck then mostly cancels out of the comparison, because a "good batting day" is a good day for both orders. The simulator does this by drawing one vector of random numbers per delivery and using it for every order in the batch (rr = rng.random(n) above). Measured on the final answer:
Paired difference best − usual (another 20,000, seed 77): +4.90 ± 0.43 (95%); unpaired SE would be ±0.73
The same 20,000 innings give a margin of error of ±0.43 runs with common random numbers against ±0.73 without them. That's like getting almost three times as many simulations for nothing.
Win probability of a total. A batting order doesn't win matches with runs alone, so we also want win probability. We fit a logistic curve to 752 decided IPL matches since 2015: P(team batting first wins) as a function of how far its total sits above the scoring environment.
Defend curve, IPL 2015-26 (752 decided matches): P(win) = logistic(-0.340 + 0.349 × (total − env)/10); base rate 0.455
total 170 at env 190.1: P(defend) 0.261
total 190 at env 190.1: P(defend) 0.415
total 200 at env 190.1: P(defend) 0.501
total 210 at env 190.1: P(defend) 0.587
total 230 at env 190.1: P(defend) 0.741
Near par, ten runs are worth about eight or nine percentage points of win probability. (Chapter 20's full model, Chapter 20, would also price the opponent's strength. Plug it into fit_defend_curve's place if you have it.)
The search, in two stages. Stage 1 screens all 5,040 orders with 400 simulated innings each. Stage 2 re-runs the best 25, and the usual order, with 20,000 fresh innings each (a new seed):
res = bo.search_top_order(sim, list(range(11)), n_top=7, n_screen=400, n_check=20000, keep=25,
seed=30, par=190.3, curve=curve)
Exhaustive search: 5,040 orders screened x 400 simulations in 28 s
Screen (400 sims each, common random numbers): mean of expected totals 198.86; best 206.16; worst 191.59; sd across orders 2.63
Usual order rank in the screen: 1994 of 5,040
Re-check with 20,000 fresh simulations each (seed 31):
label top7 screen_mean mean sd p_par p_200 wp
USUAL Iyer / Kohli / Padikkal / Patidar / Sharma / David / Pandya NaN 198.847 36.046 0.605 0.504 0.496
screen #1 Kohli / Patidar / David / Sharma / Iyer / Padikkal / Pandya 206.165 203.525 38.591 0.643 0.551 0.526
screen #2 Kohli / Patidar / David / Iyer / Sharma / Padikkal / Pandya 205.850 203.533 38.627 0.642 0.552 0.526
screen #4 Kohli / David / Patidar / Iyer / Sharma / Padikkal / Pandya 205.392 203.798 38.271 0.648 0.558 0.528
screen #8 David / Kohli / Patidar / Iyer / Sharma / Padikkal / Pandya 205.185 203.764 38.195 0.650 0.556 0.528
Best re-checked order: Kohli / David / Patidar / Iyer / Sharma / Padikkal / Pandya: 203.80 v usual 198.85 (gain +4.95 runs; P(>= par) +0.042; WP +0.0320)
Optimiser's curse: the best 25 screened at 205.17 on average, re-checked at 203.20
(Rows selected; full output from code/04_order_search.py.) Compare that with your productive-struggle guesses:
- Best versus usual: about 5 runs. The best re-checked order (Kohli, David, Patidar, Iyer, Sharma, Padikkal, Pandya) expects 203.8 against the usual 198.8. In win probability that's +3.2 points (0.528 against 0.496). P(reaching par) rises by 4.2 points.
- Best versus worst: about 12 runs. The worst screened order (Padikkal, Pandya, Iyer, Sharma, Kohli, Patidar, David) re-checks at 191.9.
- The usual order is mid-table: rank 1,994 of 5,040 in the screen.
- The optimiser's curse is real. The 25 orders that looked best in the screen averaged 205.2 there and 203.2 on fresh simulations. Picking the maximum of 5,040 noisy estimates picks noise. Always re-check winners on new random numbers.

📊 Figure (described): A histogram of the screened expected total for all 5,040 orderings of RCB's top seven, at 400 simulated innings each. Most orders fall between about 196 and 202. RCB's usual order (orange line) sits in the middle of the pile, and the best screened order (green dashed line) is out on the right-hand tail. The whole range, worst to best, is about 15 runs on the screen and about 12 on re-check.
What the best orders have in common. Count where each batter sits across the 100 best-screened orders:
Top 100 screened orders: how often each batter occupies each slot
1 2 3 4 5 6 7
VR Iyer 5 8 14 29 23 16 5
V Kohli 43 19 30 7 1 0 0
D Padikkal 0 0 1 5 19 36 39
RM Patidar 17 35 24 19 5 0 0
JM Sharma 0 7 7 31 32 19 4
TH David 35 31 24 7 3 0 0
KH Pandya 0 0 0 2 17 29 52

📊 Figure (described): A 7 × 7 heat map of batters by slots, counting how often each batter sits in each slot among the 100 best-screened orders. Kohli, David and Patidar fill the bright cells in slots 1–3. Padikkal and Krunal Pandya fill slots 6–7. Iyer and Jitesh Sharma spread across slots 3–6.
The pattern is easy to state. The three batters who combine above-average scoring with below-average dismissal (Kohli, David, Patidar) should face the most balls. The two who score below average and get out more than average (Padikkal, Pandya) should face the fewest. It's an old instinct in new clothes: give your best batters the most balls. What the data adds is a definition of "best". It means runs per ball and balls per dismissal, judged against the same situations. By that definition David counts as one of RCB's three best batters. Nobody on the scorecard treats him as one.
Simple rules, tested the same way:
rule top7 mean p_par p_200 wp
usual (Iyer, Kohli, Padikkal, Patidar, Sharma, David, Pandya) Iyer / Kohli / Padikkal / Patidar / Sharma / David / Pandya 198.847 0.605 0.504 0.496
best re-checked Kohli / David / Patidar / Iyer / Sharma / Padikkal / Pandya 203.798 0.648 0.558 0.528
worst screened Padikkal / Pandya / Iyer / Sharma / Kohli / Patidar / David 191.923 0.531 0.414 0.448
highest run index first Patidar / Iyer / David / Sharma / Kohli / Padikkal / Pandya 202.540 0.628 0.540 0.519
hardest to dismiss first Kohli / David / Pandya / Patidar / Sharma / Iyer / Padikkal 200.754 0.626 0.528 0.509
easiest to dismiss first Padikkal / Iyer / Sharma / Patidar / Pandya / David / Kohli 195.334 0.562 0.461 0.472
reverse of usual top seven Pandya / David / Sharma / Patidar / Padikkal / Kohli / Iyer 197.463 0.590 0.491 0.487
"Highest run index first" gets you three-quarters of the way (202.5). "Hardest to dismiss first" gets you about two-fifths (200.8). Neither alone is the answer, because each throws away half of what makes a batter valuable. Notice too that reversing RCB's usual top seven costs only 1.4 runs. Batting orders are surprisingly forgiving.
Local search: the scalable way. Exhaustive search works for seven batters. For a model with matchups, or a full eleven, it doesn't. Local search (hill climbing) starts from the usual order and tries every swap of two batters in the top seven (21 swaps). It keeps the best swap if it helps, and repeats until no swap helps:
Local search (pairwise swaps of the top seven, 3,000 sims per candidate; 4 s):
round top7 mean evaluations
0 Iyer / Kohli / Padikkal / Patidar / Sharma / David / Pandya 199.10 1
1 Iyer / Kohli / David / Patidar / Sharma / Padikkal / Pandya 202.46 22
2 Patidar / Kohli / David / Iyer / Sharma / Padikkal / Pandya 204.08 43
3 Patidar / David / Kohli / Iyer / Sharma / Padikkal / Pandya 204.29 64
4 David / Patidar / Kohli / Iyer / Sharma / Padikkal / Pandya 204.65 85
Local-search end point re-checked: 204.07 (exhaustive best 203.80)
In 85 evaluations instead of 5,040 it reaches an order that re-checks at 204.1, statistically level with the exhaustive best. Its very first move is the most valuable one: swap Padikkal and David, worth about 3.4 runs on its own (on 3,000 simulations). Local search can get stuck on a local peak. Here the landscape is smooth enough that it doesn't, and you can make it safer by restarting from a few random orders.
⚠️ Common pitfall: Reporting "the optimal order" as if it were one thing. The top of the table is a plateau: several quite different orders sit within about half a run of each other on 20,000 simulations, while the noise in the profiles themselves (§30.3) is far larger than half a run. The honest output is a set: "any order with Kohli, David and Patidar in the top three and Padikkal and Pandya at six and seven". That leaves the captain room for things the model can't see.
📋 Try it — Optimize this strategy: Suppose Phil Salt is fit and replaces Venkatesh Iyer. Using the profile table in §30.2 (Salt: run index 116.8 middle, dismissal index 120.6; Iyer: 105.0 and 108.9), where would you expect Salt to bat in the best orders? Would the gap between best and usual grow or shrink, if RCB's usual order simply put Salt where Iyer batted?
Worked answer
Salt scores much faster than Iyer but gets out more often, so he sits between the two groups. His run index is the highest in the squad, which argues for many balls, but his dismissal index of 120.6 is almost as high as Padikkal's 121.7. The search will usually place him in the top three, because in the powerplay scoring is high and an early wicket's cost falls on the deep batting that follows. Opening, Salt replacing Iyer raises the usual order's expected total, since he is the better batter by this model. The gap to the best order depends mainly on where David and Padikkal sit, which hasn't changed, so expect it to stay near 5 runs. To check, edit
namesincode/04_order_search.py(swap in "PD Salt") and rerun. RCB's 2026 entries list Salt in six innings, all at No. 1.🔄 Check your understanding 1. Why re-check the best screened orders with a new seed rather than the screening seed? 2. The paired margin of error was ±0.43 runs, the unpaired ±0.73. Where does the improvement come from?
Answer
- Because the screen selected the orders that happened to have lucky simulations. Re-using the same random numbers would re-use that luck. Fresh numbers give an unbiased estimate of the chosen orders' true value: the optimiser's curse correction (205.2 → 203.2 here).
- From positive correlation between the two orders' simulated totals. A delivery that goes for six against one order goes for six against the other whenever the same batter-type is on strike. The variance of a difference is var(A) + var(B) − 2 cov(A, B), and common random numbers make that covariance large.
30.5 "Promote the power hitter": the test
The claim, in its usual analytics form: most T20 teams should promote their best power hitter higher in the order, because batting at No. 6 wastes 10–15 balls of his potential innings. We now have everything we need to test it.
Tim David through every slot. Keep everyone else in RCB's usual order and move David from No. 1 to No. 7 (full script: code/05_power_hitter.py):
pt = bo.promotion_table(sim, list(range(11)), who=5, slots=range(1, 8), n=20000, seed=31, par=190.3, curve=curve)
Tim David moved through slots 1-7 (others keep their order), RCB final XI, env 190.1, 20,000 sims each:
slot mean d_mean p_par wp d_wp his_balls his_runs
1 201.195 2.348 0.627 0.512 0.015 26.076 43.781
2 201.020 2.173 0.625 0.511 0.014 25.366 43.249
3 200.456 1.609 0.623 0.507 0.011 22.202 38.105
4 199.051 0.204 0.611 0.498 0.002 18.924 31.742
5 199.250 0.403 0.609 0.499 0.003 15.023 25.227
6 198.847 0.000 0.605 0.496 0.000 11.425 19.593
7 197.715 -1.132 0.590 0.488 -0.008 7.310 12.976
Slot 6 -> 3: +10.8 balls for David
The first half of the claim survives. Moving David from No. 6 to No. 3 gives him 10.8 more balls, right inside "10–15". He'd make about 18.5 more runs himself (38.1 against 19.6).
The second half doesn't. The team gains only 1.6 runs, about 1.1 points of win probability. The other 17 runs aren't new runs. They're runs the displaced batters would have scored with those balls. Padikkal drops from No. 3 to No. 4 and Patidar from No. 4 to No. 5, and each loses a few balls. A batting order shares out a fixed budget of about 120 balls. Promoting one batter is a transfer, and it only gains what the promoted batter does better with those balls than the man he displaced. Even opening with David gains just 2.3 runs.
So why did the full search find +5? Because the search didn't just promote David. It also demoted Padikkal. In the best orders, the balls David gains come out of the weakest batter's share, not out of Patidar's or Iyer's. The useful lesson isn't "promote the hitter". It's "move balls from your weakest top-order batter to your best one", whoever that turns out to be.
All ten sides. Is RCB typical? For each IPL 2026 side, take its most-used XI in its usual order. Call its "power hitter" the batter in slots 5–7 with the highest run index, and move him through every slot:
IPL 2026 — each side's most-used XI in its usual order; power hitter = best run index in slots 5-7:
team hitter usual_slot run_idx best_slot gain_runs gain_p_par gain_wp extra_balls
Royal Challengers Bengaluru TH David 5 104.934 1 1.890 0.015 0.013 11.034
Gujarat Titans M Shahrukh Khan 7 99.727 4 1.586 0.017 0.011 9.809
Mumbai Indians Tilak Varma 5 102.991 2 0.946 0.013 0.007 10.028
Chennai Super Kings D Brevis 5 105.614 1 0.865 0.003 0.005 8.217
Rajasthan Royals D Ferreira 6 103.080 3 0.604 0.006 0.003 9.553
Sunrisers Hyderabad Aniket Verma 6 106.425 5 0.164 0.001 0.001 3.091
Delhi Capitals AR Patel 5 99.001 6 0.164 0.002 0.001 -3.584
Kolkata Knight Riders SP Narine 7 113.128 5 0.149 0.004 0.001 5.946
Lucknow Super Giants Abdul Samad 6 98.316 5 0.071 0.001 0.001 3.226
Punjab Kings MP Stoinis 5 105.918 1 0.066 0.002 0.001 8.661
Median gain from the best slot: 0.38 runs, 0.0023 WP; best slot is 1-3 for 5 of 10 hitters

📊 Figure (described): One line per IPL 2026 side, showing the change in expected total as its power hitter moves from slot 1 to slot 7, relative to his usual slot. Most lines stay within half a run of zero across the top five slots and drop at slot 7. Tim David's (RCB) is the only line that reaches about +2 at the top. Gujarat's M Shahrukh Khan peaks at No. 4 (+1.6). Several hitters gain nothing anywhere.
The median side gains 0.38 runs from moving its power hitter to his best slot: about a quarter of a point of win probability. For half the sides the best slot is in the top three. For the other half it's where he already bats, or one place up. And two of the most-praised "promote him" cases gain nothing. Sunil Narine has the highest run index in the table (113.1), yet moving him buys 0.15 runs. The check-in below explains why. Axar Patel's best slot is lower than his usual one.
The assumption underneath. Every number above assumes a batter's scoring transfers to the slot you move him to. David has faced no IPL powerplay balls since 2022, so his powerplay profile is pure extrapolation. Can we check whether lower-order batters keep their rate when they bat in the powerplay? We fit the model on IPL 2015–26, giving each batter one tilt for all phases. Then we look at what is left over by phase, grouped by usual slot:
IPL 2015-26, batters by usual slot: observed − model-expected runs per 100 deliveries, by phase
usual_slot phase deliveries batters runs_diff_per100 lo90 hi90 outs_obs_v_exp
1-3 powerplay 48528 113 1.00 -0.42 2.29 1.00
4-5 middle 27394 75 0.97 -0.91 2.68 0.99
4-5 powerplay 7247 69 -8.02 -11.38 -4.63 1.04
6-7 death 12880 82 0.88 -2.21 3.55 1.00
6-7 middle 11568 79 -2.54 -4.89 0.10 1.09
6-7 powerplay 1124 46 0.34 -8.95 8.11 1.30
(Rows selected.) Middle-order batters (usual slots 4–5) who batted in the powerplay scored 8.0 runs per 100 deliveries less than their general level predicts (90% interval −11.4 to −4.6). That's about 6% of a typical delivery's value, on 7,247 deliveries. For the 6–7 group the sample is too small to say anything: 1,124 powerplay deliveries, an interval from −9 to +8. Those batters were dismissed 1.30 times as often as expected, but on a sample that small even that is shaky.
Two explanations fit and the data can't separate them. Powerplay bowling (the new ball, attacking fields) may be a skill some lower-order batters lack. Or a middle-order batter in the powerplay is always a new batter, and Chapter 12 measured the IPL's settling-in cost at about 2.47 runs per new batter (Chapter 12). Either way, the direction is against the promotion. Here's a back-of-envelope figure, clearly labelled as one. If David lost 8 runs per 100 deliveries on the dozen or so powerplay balls an opener faces, that would cost about one run, roughly half the +2.3 the simulator credits to opening him.
The verdict on the claim.
- "Batting the power hitter at No. 6 costs him 10–15 balls": true (10.8 balls from No. 6 to No. 3 for David; 8–11 extra balls for five of the other nine sides' hitters at their best slots).
- "So most teams should promote him": mostly false, or too small to matter. The team gain is 0–2 runs, median 0.4, and some of it depends on an untested extrapolation.
- What the simulation does support: take balls from the weakest top-order batter and give them to the best, judged on scoring and survival. For RCB in 2026 that meant David up and Padikkal down, worth about 5 runs, or 3 points of win probability. That's the biggest edge in this chapter, and it's still smaller than the noise of a single season.
🏏 Eye test: Wendell Baptiste, who coaches the Port of Spain Pelicans, has heard the "promote the big man" argument from every parent at the academy. "Your machine gives David twenty-six balls if he opens. I give you what happens in my nets: a man who hits a ball at the death that's arriving at the stumps on a length he can read, and the same man with two slips and a gully and the ball moving. Different job." He's pointing at exactly the gap in the table above: no data on David against the new ball. What the data can say is that middle-order batters as a group lose about 6% of their scoring in the powerplay. Wendell's question is whether this particular hitter is like the group. Only nets, footage and a few deliberate trials can answer that. The analyst's honest reply: "Then don't open him. Move Padikkal down and David to No. 4, where he's facing a ball that's 20 overs old. Most of the gain survives."
📋 Try it — Settle this debate: "RCB won the 2026 title with David at No. 6, so the batting order was right." Using this section's numbers, write the strongest case for and against.
Worked answer
For: the usual order's expected total (198.8) is within 5 runs of the best, and the best orders form a plateau. Five runs is about 3 points of win probability per first innings. Even if RCB batted first in every match of a 16-match season, that would add up to about half a win, far less than the luck in an IPL table (Chapter 24: about 92% of IPL win-loss spread is luck). David's role at No. 6 also kept a proven death hitter for the death, and his real 2026 strike rate was 188.3. Against: "we won" is an outcome, not evidence about one decision. The simulation says the same XI would have been about 5 runs a match better with Padikkal lower and David higher, and the champions' title doesn't make that cost zero. What can't be settled: whether David's scoring transfers to the powerplay (no data), and whether one season could ever show a 5-run edge (§30.3: it can't). The fair conclusion is that the order was reasonable, with a cheap, low-risk improvement available (David to No. 4, Padikkal down).
⚠️ Common pitfall: Measuring a promotion by the promoted batter's runs. David at No. 3 makes 18.5 more runs than at No. 6. The team makes 1.6 more. Every batting-order argument has to be about team totals, because the balls a promotion hands one batter are taken from someone else.
🔄 Check your understanding 1. Why does Narine, with the highest run index in the ten-team table, gain almost nothing from promotion? 2. State in one sentence the rule that the RCB search supports, without mentioning any player.
Answer
- Because the batters he would displace (KKR's top five) are themselves above or near average, so the balls he gains are taken from batters who use them nearly as well. Promotion gains only the difference in value per ball between the promoted and the displaced batter.
- Give the most balls to the batters who score fastest relative to the situation and get out least, and the fewest to those weakest on both. Measure both against the same situations, and shrink.
30.6 Floating roles versus fixed slots
The cricket question. Real captains rarely commit to a full order. "If we lose an early wicket, the left-hander goes in; after the 12th over, the big hitter goes." That's a floating role: the next batter depends on the state of the innings. Does it beat a fixed order?
What teams actually do. For IPL regulars (10+ innings for one team in a season, slots 1–7), how often were they at their most common slot?
IPL regulars (10+ innings in a team-season, slots 1-7): share of innings at their modal slot
player_seasons mean_modal_share mean_slots_used
era
2008-12 196 0.607 3.240
2013-17 204 0.661 2.917
2018-22 217 0.655 2.848
2023-26 203 0.669 2.685
By modal slot, 2023-26:
n modal_share
modal
1 32 0.806
2 34 0.838
3 35 0.698
4 35 0.603
5 29 0.525
6 27 0.523
7 11 0.593
Orders have become slightly more fixed over the IPL's history: the share of innings at a player's usual slot rose from 0.607 in 2008–12 to 0.669 in 2023–26. Within that, the middle is fluid. Openers bat at their usual slot more than 80% of the time, Nos. 5 and 6 only 52%. In practice, the floating happens at five and six.
Floating David, simulated. Give the simulator a rule: at each wicket, send David in if at least X overs have been bowled; otherwise continue the fixed order without him.
📐 Definition — floating batter (trigger over X): A batter who walks in at the first dismissal after X overs have been bowled. Before that, the fixed order continues with him held back. If everyone else is out, he comes in anyway.
res = sim.run(usual[None, :], 20000, seed=31, track=True, policy=bo.floating_policy(DAVID, after))
RCB final XI, env 190.1, 20,000 sims each (common random numbers):
plan mean p_par p_200 wp david_balls d_mean_v_fixed6
fixed at No. 3 200.456 0.623 0.524 0.507 22.202 1.609
fixed at No. 4 199.051 0.611 0.509 0.498 18.924 0.204
fixed at No. 6 198.847 0.605 0.504 0.496 11.425 0.000
floats: next in once 6+ overs bowled 199.261 0.609 0.509 0.499 17.520 0.414
floats: next in once 10+ overs bowled 198.654 0.603 0.502 0.495 13.126 -0.193
floats: next in once 12+ overs bowled 198.263 0.598 0.497 0.493 10.678 -0.584
floats: next in once 16+ overs bowled 197.130 0.584 0.487 0.485 5.222 -1.716

📊 Figure (described): The change in RCB's expected total, against fixed No. 6, when David floats in at the first wicket after over X. The line falls steadily from about +0.4 runs (trigger after over 6) to −1.7 (after over 16). Dashed reference lines show David fixed at No. 3 (+1.6) and No. 4 (+0.2). Every floating rule sits below simply batting David at No. 3.
The classic "finisher floats in after over 12" is worse than leaving him at No. 6 (−0.6 runs). It gives him fewer balls (10.7) and holds back a batter the model rates as one of RCB's best. Every trigger is beaten by simply batting him at No. 3. With this model, floating can only help if the floater's value really does change with the phase. Our out-of-time test (§30.2) found little evidence that individual batters have phase-specific skill beyond their general level.
A fully floating rule. Let the simulator choose the next batter at every wicket, on a phase-specific value per ball: expected runs minus P(dismissal) × Chapter 19's IPL 2023–26 price of a wicket (13.87 runs in the powerplay, 9.27 in the middle overs, 3.95 at the death). The openers stay fixed.
Fully floating rule (openers fixed: Iyer & Kohli):
plan mean p_par p_200 wp david_balls
usual fixed order 198.847 0.605 0.504 0.496 11.425
float by phase value 202.326 0.637 0.542 0.519 19.124
It gains 3.5 runs over the usual order, mostly by doing what the fixed search did: David faces 19.1 balls instead of 11.4, and Padikkal drops from 17.0 balls to 8.4. It still finishes below the best fixed order (203.8), because it keeps Iyer opening. For RCB, floating adds nothing that a well-chosen fixed order doesn't already deliver.
🏏 Eye test, with a caveat for the model: The case for floating rests on things this simulator doesn't know: a left-hander sent in against an off-spinner who's turning it away (Anchor D, Chapter 11), or a batter sent to see out a hostile spell. Those are matchup and conditions effects. Chapter 11 found them real but small once shrunk, about 10 strike-rate points for de Kock against off-spin, and Chapter 31 turns them into bowling plans. A floating rule driven by matchups is a natural extension (Exercise C5). Expect it to be worth a run or so, not five.
🔄 Check your understanding 1. Why can a "float the finisher after over 12" rule be worse than a fixed No. 6? 2. Under what kind of batter profile would floating beat every fixed order?
Answer
- Because when early wickets fall, the rule sends in other batters first and holds the finisher back, so he ends up facing fewer balls than at No. 6. If the model rates him as one of the best batters overall, every ball taken from him costs runs.
- One where batters' values really cross over by phase. Suppose A is clearly better than B in the powerplay and clearly worse at the death. Then "A if the wicket falls early, B if late" beats any fixed order. Our out-of-time test found such crossovers too weak to measure in the IPL, which is why floating doesn't help here.
30.7 Left and right: respecting a small effect
The cricket question. "Keep a left-right combination going." Commentators say it, and captains act on it. Bowlers must change line, fielders move, and a spinner who turns the ball into one batter turns it away from the other.
Chapter 12 measured the effect properly, within batters: the same batter's SR+ (strike rate relative to par, 100 = par) with an opposite-handed partner against a same-handed one. In men's T20 it came out at +0.42 SR+ points, with a 95% interval from −0.32 to +1.18: indistinguishable from zero. (In Tests it was +1.09, from −0.08 to +2.24, so no format shows a reliable left-right effect.)
We can still ask how much it would matter if it were real. The simulator has a switch: when the two batters at the crease bat with opposite hands, it tilts scoring up by a chosen number of SR points. Here it is at 0, at Chapter 12's estimate (+0.42), at the top of its 95% interval (+1.18), and at a deliberately absurd +5:
Expected total by left-right boost (SR points when the two batters' hands differ):
lr_boost_sr 0.00 0.42 1.18 5.00
order
alternate hands (Iyer, Kohli, Padikkal, Patidar, Pandya, Sharma, David) 197.03 197.54 198.32 203.13
best from §30.4 (Kohli, David, Patidar, Iyer, Sharma, Padikkal, Pandya) 203.80 204.15 204.63 207.49
lefties together (Iyer, Padikkal, Pandya at 1-3) 193.26 193.44 193.94 195.99
usual 198.85 199.31 200.11 204.45
At Chapter 12's estimate the left-right effect is worth 0.2–0.5 runs to an order (0.18 to 0.51), depending on how often the order pairs opposite hands. The difference it makes between two orders is smaller still: 0.28 runs between "lefties together" and the usual order. Even at the top of the interval, the most any order gains is 1.3 runs. And it doesn't change the answer. With the +0.42 boost switched on, the search's best order (David / Patidar / Iyer / Kohli / Sharma / Padikkal / Pandya, 204.06) is a different member of the same plateau as before. Even at the absurd +5, the hand-alternating order (203.1) still falls short of the best order without any boost (203.8).
RCB's usual top four already alternates (Iyer left, Kohli right, Padikkal left, Patidar right). The best orders break that pattern, and the search is right to: getting David and Patidar more balls is worth about 5 runs, while the pattern itself is worth less than half a run even if the effect is real. No format in this book's data shows a reliable left-right effect, and an effect whose interval includes zero should only ever break ties. It should never override something measurably bigger.
🔷 R corner (not run in this book's build): the entry-order rule in dplyr, given a Cricsheet deliveries table
dwithmatch_id,innings,delivery_seq,batter_id,non_striker_id:r library(dplyr); library(tidyr) pos <- d |> select(match_id, innings, delivery_seq, striker = batter_id, nonstriker = non_striker_id) |> pivot_longer(c(striker, nonstriker), names_to = "end", values_to = "player_id") |> mutate(end = factor(end, levels = c("striker", "nonstriker"))) |> arrange(match_id, innings, delivery_seq, end) |> distinct(match_id, innings, player_id, .keep_all = TRUE) |> group_by(match_id, innings) |> mutate(position = row_number()) |> ungroup()
30.8 The nightwatchman: what the data allows
The cricket question. It's the last twenty minutes of a Test day. A top-order wicket falls. Does the No. 5 walk out to face a fresh spell in fading light, or do you send a bowler, the nightwatchman, to soak up the remaining overs and protect him? The argument is older than limited-overs cricket. The analytics is harder than it looks, because the data is missing the two things the decision depends on.
What Cricsheet doesn't have: the time of day, and any label saying "nightwatchman". So we infer, and say exactly how.
📐 Definition — inferred nightwatchman: In a men's Test innings, a player whose usual Test position (median over all his innings in the data, at least five innings) is 8 or lower, arriving at No. 6 or higher with at most five wickets down, while at least one batter of usual position 7 or better in the same innings has not yet arrived. The next such specialist to arrive is the protected batter. (
batting_order.find_nightwatchmen.)
The rule will also catch a bowler promoted for some other reason: to slog, or because of an injury. It will miss a nightwatchman whose career is too short to establish a usual position. We need a check.
Check: do these arrivals bunch at the end of a day? Chapter 29 rebuilt a "nominal day" of 90 overs (Chapter 29). It drifts as a match goes on, but on day one, in the first innings, it is close to the real clock. If the rule finds real nightwatchmen, they should arrive late on nominal day 1:
Men's Tests in the data: 899 matches, 33,036 batter-innings
Likely nightwatchmen (rule above): 425 innings by 139 players
specialist arrivals, No. 3-6 : 3334 arrivals in nominal day 1; share in overs 80-90: 2.1% (even spread would give 11.1%)
nightwatchman arrivals : 48 arrivals in nominal day 1; share in overs 80-90: 52.1% (even spread would give 11.1%)

📊 Figure (described): Distributions of the over in which batters arrived during the first 90 overs of a Test (first innings only). Specialists arriving at Nos. 3–6 are spread across the day and thin out at the end. Inferred nightwatchmen pile up in overs 80–90, where 52.1% of them arrive, against 2.1% of specialists. The rule is finding the right events.
Half of the inferred nightwatchmen on day 1 arrive in the last ten nominal overs, against 2.1% of specialists, so the rule works. (Specialists are scarce at that hour precisely because nightwatchmen take their place.) One famous case is a data lesson in itself. Jason Gillespie's 201 not out as a nightwatchman, at Chittagong in April 2006, isn't in the Cricsheet Test data: the snapshot has the Fatullah Test from that series but not Chittagong. The rule does flag two other Gillespie arrivals, both protecting Michael Clarke. Always check that the famous example is actually in your data before you build a story on it.
How often, and who.
Nightwatchmen per 100 team innings, by period:
2001-06 9.47
2007-11 12.40
2012-16 11.87
2017-21 14.33
2022-26 14.13
By team (per 100 team innings): New Zealand 18.89, West Indies 17.02, Zimbabwe 16.16, India 13.99,
South Africa 13.39, England 11.89, Sri Lanka 11.75, Pakistan 11.11, Australia 8.53, Bangladesh 8.20
Most frequent: JO Holder 20 (482 runs, 1,024 balls), JM Anderson 18 (199, 546), DL Vettori 16 (511, 797),
NM Lyon 16 (222, 542), R Ashwin 16 (554, 1,160), MJ Santner 14 (390, 957)
(Condensed from code/07_nightwatchman.py's output.) Far from dying out, the inferred nightwatchman has become more common: from 9.5 per 100 team innings in 2001–06 to about 14 since 2017. New Zealand use one most often (18.9 per 100 innings) and Australia and Bangladesh least. England's story since 2022 is Case Study 2. The most frequent nightwatchmen are bowlers who can bat: Jason Holder, Ravichandran Ashwin and Daniel Vettori each averaged more than 24 runs per nightwatch innings. James Anderson, with 18, averaged 11.
What happens to the nightwatchman.
Nightwatchman innings: 425; mean balls 40.2, median 27; mean runs 16.04, median 8; out within 6 balls 13.9%;
out within 30 balls 53.6%; faced 60+ balls 22.4%; fifty+ 5.6%; median wait for the protected batter 35 legal balls
Specialists arriving at No. 3-6 (<=5 down; 12,316 innings): mean balls 70.4, median 46; mean runs 36.7;
out within 6 balls 9.7%; within 30 36.0%
The same nightwatchmen at their usual 8-11 (5,483 innings): mean balls 24.4, runs 11.8, out within 6 balls 18.8%
Nightwatchman runs per dismissal: 16.27; balls per dismissal 40.8; specialists at 3-6: 39.68, 76.2
KM nightwatchmen: P(survive 6 balls) 0.861, 30 balls 0.463, 60 balls 0.215; median 27.0
KM specialists arriving at No. 3-6: P(survive 6 balls) 0.903, 30 balls 0.637, 60 balls 0.430; median 49.0
KM same players at No. 8-11: P(survive 6 balls) 0.805, 30 balls 0.359, 60 balls 0.154; median 20.0

📊 Figure (described): Kaplan–Meier curves of the share of batters still in after a given number of balls. Specialists arriving at Nos. 3–6 last longest (median 49 balls). Nightwatchmen come next (median 27). The same players batting in their usual Nos. 8–11 do worst (median 20). All three curves fall fastest in the first 30 balls.
The Kaplan–Meier curve (Chapter 10's survival tool, Chapter 10) handles not-out innings properly. It shows that nightwatchmen do the job they're sent for, most of the time. 86.1% survive the first six balls, which is about what the last half-hour of a day requires, and the median nightwatchman lasts 27 balls. They last longer than the same players do at Nos. 8–11 (median 20 balls). That's partly selection, since captains choose the bowlers who can bat. It may also be partly that at Nos. 8–11 they often bat with the tail and have to slog, which the data can't separate. But they are not specialists. Nightwatchmen are dismissed once every 40.8 balls against 76.2 for specialists in the same slots, and score 16.27 runs per dismissal against 39.68.
The protected batter. Does protecting the specialist help him? Compare his innings after a nightwatchman with the same batter's other innings:
Protected batters (406 innings with 10+ other innings for the same batter):
runs per innings when protected 31.40 v same batters' other innings 35.40 (difference -4.00)
90% bootstrap interval for the difference: -6.64 to -1.42
balls per innings protected 63.1 v other 68.6; median wait for the protected batter 35 legal balls
Protected batters score 4.0 fewer runs than in their other innings (90% interval −6.6 to −1.4). That doesn't prove the nightwatchman hurts them. A protected batter always arrives with one more wicket down than he otherwise would, so he has less batting left to partner him. He often arrives the next morning against a fresh attack. And "other innings" mixes every situation. What we can say is that the data shows no sign of a benefit to the protected batter's own innings.
"The next morning." The real question is what happens at the start of the next day. We can only approximate it: first innings, a batter arriving at Nos. 3–7 in nominal overs 80–90 of day 1, then what happens in nominal overs 90–105, the start of nominal day 2:
First innings, a batter arriving at No. 3-7 in nominal overs 80-90 of day 1 (innings reached over 105):
n wkts_overs_90_105 runs_overs_90_105 arriver_out_by_105
nightwatch
False 117 1.137 50.222 0.504
True 36 1.167 45.611 0.833
With a nightwatchman, the team lost 1.17 wickets in those fifteen overs against 1.14 with a specialist: no detectable difference, on 36 and 117 innings. They scored 4.6 runs fewer. And the nightwatchman himself was gone by over 105 in 83.3% of cases, against 50.4% for a specialist. So the morning wicket still falls, but it is usually the cheap wicket, the bowler's rather than the No. 5's. That's precisely the nightwatchman's purpose. Whether it's worth the 4–5 runs is a judgement about wickets in hand, which the expected-runs logic of Chapter 19 prices and Test cricket's draw complicates.
What can't be determined from this data, and why:
- The real time of day. Nominal days drift with weather and over rates. Day 1 is reliable enough for a check; later days are not.
- The counterfactual. We never see what the protected batter would have done if he'd faced those last overs himself. The comparison with specialists who did go in late is confounded by who was chosen, the score and the conditions.
- Light, fatigue and the bowler's spell. A nightwatchman is sent when the light is going and a bowler is fresh. None of that is in ball-by-ball data.
- Intent. The rule can't tell a nightwatchman from a bowler promoted to slog (Case Study 2 meets this problem).
Imran Qureshi, who runs analytics for Headingley Road CC, read the output over a cup of tea.
Imran: So it's cheaper wickets in the morning, the protected man scores no more, and the nightwatchman lasts about half an hour.
Nusrat: And the next-morning wicket rate is the same either way: 1.17 against 1.14 per fifteen overs.
Imran: Which is the bit I'd circle. If the nightwatchman made the morning safer, you'd see fewer wickets. You don't. What changes is whose wicket. The data says the nightwatchman is a trade: you give up about four or five runs, and you spend a tail-end batter's wicket instead of a specialist's. In a match you're trying to save, that trade is good. In a match you're trying to win quickly, it's probably not.
Nusrat: Before I ran this, I'd have summed it up as "slightly negative in expected value, but psychologically valuable".
Imran: Half of that you've now measured, and it holds up: the runs go down a little. The "psychologically valuable" half isn't in any file I've got. I wouldn't print it as a finding. I'd print it as the reason captains keep doing it.
⚠️ Common pitfall: Treating an inferred label as an observed one. Every number in this section rests on the rule in the definition above. Change "usual position 8 or lower" to "7 or lower", or "≤ 5 down" to "≤ 4 down", and the counts change. Before you publish, rerun the key numbers under two or three versions of the rule (Exercise C6), and report the range.
🔄 Check your understanding 1. Why is "52.1% of day-1 nightwatchman arrivals in nominal overs 80–90" good evidence that the rule works, while the same check on day 3 would be weak? 2. The protected batter scores 4.0 fewer runs. Give two reasons this is not evidence that nightwatchmen harm the batters they protect.
Answer
- On day 1 of the first innings, the nominal clock starts at the real first ball, and 90 overs is close to a real day when there are no stoppages. By day 3 rain, slow over rates and innings changes have pushed the nominal clock away from the real one, so "overs 80–90" no longer means "late in the day".
- (a) He always arrives one wicket later than he would have, with less batting left to support him. (b) He often starts the next morning against fresh bowlers and a newer spell. The "other innings" comparison also mixes every match situation. A causal answer would need the counterfactual innings, which never happened.
30.9 What the batting order can't see
Every number in this chapter comes from a model that knows each batter's scoring and survival relative to the situation, and nothing else. Here is what it leaves out, roughly in order of how much it probably matters:
- The chase. We simulated first innings. In a chase the target changes everything. At 60 needed off 30 with seven wickets in hand you want your best hitter in now, whatever his slot. A chase-aware version would choose the next batter by win probability from Chapter 20's model rather than by expected runs, which is the floating policy of §30.6 with a better objective. That is Exercise E2, and it's where floating roles are most likely to earn their keep.
- Matchups and conditions. A left-hander against an off-spinner turning it away (Chapter 11's Anchor D), a slow pitch, a short boundary on one side. Each is real, and each is worth a run or so once shrunk.
- Roles and comfort. Batters train for a role. A finisher practises the death and an opener practises the new ball. Promoting a batter changes his preparation, and §30.5's powerplay check (−8.0 runs per 100 deliveries for promoted middle-order batters) may partly be measuring exactly that.
- The Impact Player. Since 2023 an IPL side can add a batter or a bowler mid-match. Our XI is the eleven who batted. A side that knows it can bring in a twelfth batter may take more risk at the top, which a fixed eleven-batter simulation can't express.
- Uncertainty in the profiles. §30.3 showed that even a whole lineup's quality can't be confirmed from one season. The best order's 5-run edge rests on profiles with real error bars. Treat the plateau of good orders as the answer, not its single highest point.
🪞 Learning check-in
This is a good moment to look back over Parts 4–6. Take five minutes and write short answers. Don't look anything up first.
- What changed in how you think? In Chapter 19 the innings was a walk through states. Here the states have names in them. Which idea from Chapters 19–30 changed your picture of a cricket match the most, and why?
- Where are you still guessing? Pick one result in this chapter you'd struggle to explain to Wendell, for example why David's promotion gains only 1.6 runs when he faces 10.8 more balls. Write the explanation in two sentences. If you can't, reread §30.5's paragraph on transfers.
- Calibrate yourself. Your productive-struggle guesses from §30.4: how far off were they? If you expected a 20-run difference between best and usual orders, ask what in your cricket intuition made it feel that big.
- Strategy check. Which of these do you do before believing a model's recommendation: re-check on fresh simulations; ask what the model extrapolates (zero powerplay balls); test it out of time; check that the famous example is in the data? Which did you skip in your own project work so far?
If question 2 was hard, that's normal. "Promotion is a transfer of balls" is one of those ideas that feels obvious once you see it and invisible before. Revisit it after Chapter 31, where the same logic applies to bowlers' overs.
Spaced Review
Try each question before opening the answer.
- (Chapter 19) Chapter 19's Markov chain indexed states by over and wickets lost. What does "wickets lost" stand in for in that chain, and why did this chapter have to split it in two?
- (Chapter 12) Chapter 12 estimated a new batter's settling cost in the IPL. Roughly how many runs, and how does it bear on promoting a middle-order batter into the powerplay?
- (Chapter 6) Chapter 6 found the number of balls at which a batter's strike rate is half signal and half noise. What was it, and what did this chapter's out-of-time test choose as the best shrinkage for run tilts?
Answers
- It stands in for both the situation (how batters bat with few wickets left) and the batter (who is usually in at that point: worse batters later). A league-average chain can't put a specific batter in a specific state. Section 30.2's two-way fit separates the two so that Kohli at six down keeps Kohli's profile.
- About 2.47 runs per new batter (25.8 strike-rate points over his first ten balls, within batter). Every promotion that sends a batter in early also sends him in new, often against the new ball. Section 30.5's −8.0 runs per 100 powerplay deliveries for middle-order batters is consistent with that cost (and possibly with a genuine new-ball weakness).
- About 98 balls (Chapter 6). The out-of-time test here chose k = 100 balls for run tilts: the same answer from a different route. Dismissal shrinkage was flat between 554 (Chapter 6's dismissal half-signal) and 2,216.
Project Checkpoint: crease.batting_order
Nusrat wanted to try the module on home ground. The BPL 2025/26 title went to Rajshahi Warriors, who beat Chattogram Royals in the final on 23 January 2026, and she ran the whole pipeline on their final XI.
What the module adds to Crease (project/crease/batting_order.py):
| Function / class | What it does |
|---|---|
entry_order(balls) |
positions from order of arrival, with balls, runs, outs and the state at arrival |
position_table(entry), usual_positions(entry) |
what each slot gets; each player's usual slot and prior group |
BatterModel(chain).fit(states, usual) |
situation cells + per-batter run tilt and dismissal multiplier, shrunk (k_run 100, k_out 554) |
.indices(env), .predict_deliveries(states), .rates(ids, env, over, wkts) |
readable profiles, per-delivery forecasts, per-state rates |
OrderSimulator(model, lineup, env_par, tau_future, lr_boost_sr) .run(orders, n, policy=…) |
ball-by-ball innings with strike rotation and common random numbers |
evaluate_orders, search_top_order, local_search, promotion_table, floating_policy |
the searches and tests of §30.4–30.6 |
fit_defend_curve, defend_prob |
P(win) of a first-innings total in its environment |
test_positions, find_nightwatchmen, nightwatch_outcomes |
the Test tools of §30.8 |
The core of code/project_checkpoint.py:
s1, games = live.load_first_innings(["bpl"])
chain = live.LiveChain().fit(s1)
balls, _ = st.load_innings(["bpl"], innings=None)
sall = st.innings_states(balls, innings=None)
sall["env_par"] = sall["match_id"].map(games.set_index("match_id")["env_par"])
model = bo.BatterModel(chain).fit(sall[(sall["year"] >= 2022) & sall["env_par"].notna()], bo.usual_positions(entry))
lu = bo.team_lineup(model, xi[["player_id", "player"]])
sim = bo.OrderSimulator(model, lu, env_par=env, tau_future=0.07)
path = bo.local_search(sim, list(range(11)), n=3000, seed=30)
BPL: chain on 466 first innings (par 157.1); 304 batter profiles from 2022-26
Final XI in usual order (indices at the final's scoring environment, 153.4):
player group balls run_idx out_idx
0 Sahibzada Farhan 1-3 162 100.7 106.0
1 Tanzid Hasan 1-3 939 109.7 90.9
2 KS Williamson 1-3 54 102.7 96.9
3 Nazmul Hossain Shanto 1-3 1157 97.1 100.1
4 Mushfiqur Rahim 4-5 1173 97.4 77.2
5 JDS Neesham 4-5 248 117.0 85.1
6 SM Meherob 6-7 127 84.7 122.3
Usual order: expected total 156.0, P(>= 153) 0.520
End point re-checked with fresh simulations: 160.34 (+4.36 v usual)
Promotion table for JDS Neesham (usual slot 6): slot 1 +3.16, slot 3 +2.76, slot 4 +1.62, slot 7 -1.87
(The last line condenses the script's promotion table.) "So the model wants Neesham opening," Nusrat said. "On 248 balls."
That's the right reaction. Look at the balls column. Kane Williamson has 54 BPL balls in the window, so his profile is mostly his slot group's prior, not Williamson. Jimmy Neesham's run index of 117.0 rests on 248 balls. The BPL-only profiles know very little about the overseas players, who have thousands of balls in other leagues. The fix is to feed the model other leagues' deliveries, translated with Chapter 26's league factors. That is Exercise E1, and it's the natural next step for the module. Meanwhile Mushfiqur Rahim (dismissal index 77.2, from 1,173 balls) is the profile to trust most, and the model's advice for him is the same as for Kohli: keep the hard-to-dismiss batter in the top half of the order.
How it plugs in later: Chapter 31 uses the same "allocate a fixed budget" logic for bowlers' overs. Chapter 36's fantasy projections can take promotion_table's expected balls by slot. Chapter 39's dashboard gets a "batting order" tab that wraps search_top_order and reports the plateau, not a single answer.
Chapter Summary
Measures and methods introduced
| Item | Definition | Key real numbers |
|---|---|---|
| Inferred batting position | order of arrival as striker or non-striker | IPL: 100% of Nos. 1–2 arrive on ball one; 0.72% of arrivals at No. 3+ out of step |
| Slot budget | balls faced per team innings by position | IPL 2023–26: No. 3 18.15, No. 6 9.93 (gap 8.22); top three take 51.8% (women's T20Is 55.5%) |
| Run tilt / run index | batter's scoring relative to an average batter in the same situations, shrunk (k = 100 balls) | Patidar 112.6, David 104.9, Kohli 98.0, Padikkal 96.7 (middle overs, IPL 2022–26) |
| Dismissal multiplier / index | outs relative to an average batter in the same situations, shrunk (k = 554) | Sai Sudharsan 75.6, Kohli 76.6, David 82.5, Padikkal 121.7 |
| Order simulator | ball-by-ball, strike rotation, environment tilt 0.04 (IPL) | average lineup sd 37.3 v real 36.7; 80% ranges cover 84.5% out of time |
| Common random numbers | same random draws for every order compared | margin ±0.43 v ±0.73 runs on 20,000 innings |
| Inferred nightwatchman | usual No. 8+ arriving at No. ≤ 6 with ≤ 5 down, specialist still to come | 425 innings; 52.1% of day-1 arrivals in nominal overs 80–90 |
What the data says
- Order matters, but in single runs. RCB's 5,040 top-seven orders span about 12 runs from worst to best. Best versus usual is +4.95 runs, +3.2 points of win probability.
- "Promote the power hitter" is half true. No. 6 → No. 3 gives David 10.8 more balls but the team only 1.6 more runs. Across the ten IPL 2026 sides the median gain is 0.38 runs.
- The real rule: give balls to your best batters by scoring and survival, and take them from your weakest.
- Phase-specific batter skill didn't survive an out-of-time test. Promoted middle-order batters lose about 8 runs per 100 deliveries in the powerplay (as a group).
- Floating roles add nothing here that a good fixed order doesn't. Left-right pairing shows no reliable effect in any format (Chapter 12), and even taken at face value it is worth under half a run.
- Nightwatchmen last a median 27 balls and cost the team about 4–5 runs over the next fifteen overs. The next-morning wicket still falls, now usually theirs.
Decision framework: setting a T20 batting order
- Build profiles relative to situations, and shrink them. Never use raw strike rates by position.
- Fix the tail and screen every top-seven order (or run local search with restarts). Use common random numbers.
- Re-check the leaders on fresh simulations, and report the plateau of orders within about a run of the best.
- Look for extrapolations: anyone the plan moves into a phase where he has little or no data. Discount the gain, or keep him where the data is.
- Translate runs into win probability before arguing. Five runs is about three points.
- Let small effects (left-right, minor matchups) break ties inside the plateau, never override it.
- In a chase, re-decide at each wicket using win probability, not a fixed list.
What's Next
A batting order shares out about 120 balls among eleven batters. A bowling plan shares out 20 overs among five or six bowlers, under the four-over cap. In Chapter 31 the same logic of a fixed budget, transfers rather than free gains, and a plateau of good plans turns into an assignment problem. And the question that hung over Tim David's powerplay balls returns in a new form: is a death bowler's skill really his own, or the phase's?