The independent voice of cricket

Indian Premier League 2021

RCB (finally) win the IPL: Reddit user writes Python script to simulate remainder of 2021 season

by Wisden Staff 3 minute read

Reddit user Adish Jain (u/VisibleAct) wasn’t too happy with the IPL 2021 season coming to an abrupt halt and decided to program the rest of the tournament to identify the winner.

The 2021 edition of the IPL was indefinitely postponed after a few players from different franchises tested positive for the COVID-19 virus. 29 league matches were completed before the season was halted and instead of waiting for the season to resume, Jain decided to run a simulation to find the winners.

His simulation is based on recent data and predictive analysis to simulate the group stages and find the top four teams that will qualify to the play-offs. Randomization techniques means there is still an element of chance to who comes out on top; run the simulation twice, and you’re unlikely to get the same results.

It uses data from the past five years of each player to predict outcomes of each ball based on a number of factors. After running the code for the entire season, he decided to test it by running it for the rest of IPL 2021 season, resuming from the match that was called off on May 3rd.

Note: The model factors in different types of pitches, match-ups and recent form and record of teams and players to simulate matches on a ball-by-ball basis.

Speaking to Wisden.com, Jain shared what went into the simulation: “I extracted each player’s past five years’ data for batsmen and bowlers. What kind of runs a batsman scored – singles, doubles, fours or sixes – what kind of runs the bowlers leaked, against what bowling did a batsman thrive, when they scored their runs – powerplay, middle overs or death – what mode of dismissal bowlers dismissed batsmen the most with and vice-versa how batsmen got out. This includes detailed data such as frequency of wides or no balls or the average catches taken by a player in a game.”

How the group stage ended

The biggest surprise was that Mumbai Indians just missed out on qualification, losing out to Punjab Kings on net run rate. Royal Challengers Bangalore finished top of the table, losing just one more game (to the two they had already lost before season was called off) in their remaining seven matches. Delhi Capitals finished right behind while Chennai Super Kings and Punjab Kings played out a thrilling eliminator.

Kolkata Knight Riders finished at the bottom of the points table while Sunrisers Hyderabad, under Kane Williamson, turned it around a bit in the simulated second half of the tournament to finish sixth.

Points table

The points table when the IPL was suspended can be found here.

Updated points table after simulation:

The Playoffs

Qualifier 1 – DC v RCB (RCB won)

Eliminator – CSK v PBKS (PBKS won)

In the qualifier, Devdutt Padikkal and Virat Kohli made 63 (42) and 66 (33) to help RCB post 188-6 batting first. Despite a Prithvi Shaw blitz – 41 (24) – and a late cameo from Marcus Stoinis – 45 (30) – RCB won by seven runs to make it through to the final.

The eliminator turned out to be a thriller. Batting first, CSK posted 198 courtesy of a 66-ball 113 from Faf du Plessis. Rayudu made a 34-ball 46 and Dhoni faced just one ball, smashing a six off it to remain unbeaten at the end. In the run-chase, Chris Gayle’s 28-ball 51 and Mayank Agarwal’s 43 off 40 drove PBKS before a 16-ball 27 from Nicholas Pooran helped them over the line with five wickets to spare.

Qualifier 2 – PBKS v DC (DC won)

A blistering 55-ball 104 from Rishabh Pant helped Delhi post 182 in the second qualifier against Punjab Kings. Pooran made a half-century – a swift turnaround from his sequence of ducks in the first half of the tournament – to hold together the Punjab innings, but they ended up losing by a fairly large margin of 41 runs.

Final – DC v RCB (RCB won)

In the final, DC won the toss and chose to field, a decision that cost them in the end. Once again Padikkal and Kohli put a strong stand at the top and Maxwell made a 20-ball 32 to cover up for a golden duck by AB de Villiers. RCB set Delhi Capitals exactly 200 to win. Dhawan played the anchor at the top with a 41-ball 42 in the run-chase, but RCB’s spinners made useful contributions to stifle the chase. Off-spinner Maxwell sent back Dhawan and Pant, the two left-handed match-ups, to give RCB a whopping 50-run win and their maiden IPL title.

Subscribe to the Wisden Cricket YouTube channel for post-match awards, player interviews, analysis and much more.

Have Your Say

Become a Wisden member

  • Exclusive offers and competitions
  • Money-can’t-buy experiences
  • Join the Wisden community
  • Sign up for free
Latest magazine

Get the magazine

12 Issues for just £39.99