The Programming Behind The Cricket Score Predictor

2 min read

Hello there! One of the most loved and played games in our country is cricket. It’s almost as if this game is the soul of the nation! Right from our childhood, we would have played cricket in one form or the other. Maybe running in the streets playing gully cricket, or forming random teams during your PE hours in the school, or even perhaps an android game! But did you know that they use one of the crucial programming concepts, Dynamic Programming, also in cricket? Well, if you didn’t, then let me enlighten you now!

What is Dynamic Programming?

Before we cover how Dynamic Programming is used in cricket, let me briefly introduce what DP is all about. Richard Bellman developed Dynamic Programming or commonly known as DP in the 1950s, and from there on, has found its applications in various fields. Dynamic Programming is a powerful technique used to solve a class of problems where the need to solve the previous computations arises. In short, by using DP, you can make your algorithm efficient by storing the intermediate results for further use. DP is a powerful technique for optimizing and solving recursive problems, where we store the results of the subproblems. This method of storing the intermediate values for speeding up the calculations is known as memoization. One of the most famous and basic examples of this is the Fibonacci series. If you want to know read and understand more about DP, then head over here

How is Dynamic Programming used in Cricket?

Right from the late 1990s, the OR techniques have found its way to the sports world. Various methods have been implemented to predict the outcomes of ODI matches, shorten the matches, and even more. 

What is WASP?

Winning And Score Predicting (WASP) is one of the score calculation tools used in cricket to predict the scores of limited-overs matches. It is one of the statistical approaches that is used to predict the outcomes of matches such as T20 as well as ODI matches. Developed by Dr. Scott Brooker and Dr. Seamus Hogan, WASP made its first public appearance in New Zealand in November 2012 and is now owned by NV Play, a cricket technology platform. 

How is Dynamic Programming implemented in WASP?

The model is based on the database, containing all the non-shortened ODI and T20 matches since 2006. Other factors such as climate, pitch, and boundary dimensions are also taken into consideration. Two predictions are made using this model. The first one is the batting first prediction, where the additional runs are predicted by considering the previous matches and then working backward to analyze the possible score. The main formula behind this is 


Dr. Seamus Hogan described the model as such:

” Let V(b,w) be the expected additional runs for the rest of the innings when b (legitimate) balls have been bowled, and w wickets have been lost, and let r(b,w) and p(b,w) be, respectively, the estimated expected runs and the probability of a wicket on the next ball in that situation.

Since V(b*,w)=0 where b* equals the maximum number of legitimate deliveries allowed in the innings (300 in a 50 over game), we can solve the model backward.

This means that the estimates for V(b,w) in rare situations depend only slightly on the estimated runs and probability of a wicket on that ball, and mostly on the values of V(b + 1,w) and V(b + 1,w + 1), which will be mostly determined by thick data points.

The batting second model is a bit more complicated but uses essentially the same logic.” 

The second batting model predicts the probability of winning based on balls and wickets remaining, target, and scores to date. Both these prediction models depend heavily on Dynamic Programming, where it looks into data from all the previous matches (Yes, it’s memoization) and then estimates the score or the winning probability. 

In the game of cricket, things might not always go according to plan, but predicting scores is always fun, and tense, right? As you can see that programming is now present in every nook and corner of our lives, and even in places where you don’t expect them to be. So you there, keep practicing, pick up new skills, and make the world a better place.

Until next time then!

The Colleges That Stole The Spotlight In The November…

As the month draws to a close, we’re taking a look back to see how well our college coders this time. While top Universities...
1 min read

Hashing Algorithms: A Simple Data Structure To Protect All…

Before I introduce you to what this blog will be about, lemme ask you a question? How many times have you done the reset...
3 min read

November Starters 18 | xsalty_ Claims First Win!

Starters 18 has freshly concluded, and boy, what a contest it was! From a stunning platter of problems to stellar competition Starters 18 had...
1 min read

Leave a Reply