“Unboxing Bayes Theorem”

Kumarmuthyala K
4 min readJun 22, 2023

--

Bayes’ theorem is a fundamental concept in probability theory and statistics, it provides a way to update or amend probabilities based on additional evidence or information.

It is particularly useful when we have prior knowledge or beliefs about the likelihood of events, and we want to update those beliefs based on new evidence or observations. It enables us to incorporate new information into our existing knowledge and make more informed probabilistic judgments.

Bayes’ theorem calculates the conditional probability of an event A given that event B has occurred. It is expressed mathematically as:

P(A|B) = (P(B|A) * P(A)) / P(B)

Where:

P(A|B) represents the conditional probability of event A given event B.

P(B|A) represents the conditional probability of event B given event A.

P(A) and P(B) are the individual probabilities of events A and B, respectively.

Example

What is the probability of RCB winning the match given Virat Kohli scoring runs greater than or equal to 45 Runs in an innings, imagine we have a prior knowledge that Virat Kohli has scored runs, we need to figure out the posterior probability of RCB winning the match

IPL Data From 2008 till 2020

Total Number of Matched Played by RCB (2008–2020) = 184

Total Number of times RCB won (2008–2020) = 84

Total Number of Time Virat Kohli Scored ≥ 45 Runs = 54

Step 1: Calculating the probability of RCB winning the match.

P (RCB W) = 84/184 = 0.46 = 46 % (similarly we can also calculate P (RCB L) = 1- 0.46 = 0.54)

Step 2: Calculating the probability of Virat Kohli scoring greater than or equal to 45 runs in an innings. Out of 184 matches till 2020, Virat Kohli has score greater that or equal to 45 is equal 54 times.

P (VK > 45) = 54/184 = 0.29

Step 3: Calculating the probability of VK scoring >=45 runs given RCB W, we divided the probability of VK scoring >= 45, by the probability of RCB winning.

P(VK>45/ Given RCB W) = 0.29/0.46 = 0.63

Step 4: Substituting the values in the Bayes Theorem.

P (RCB W/ VK >= 45) = P(VK>= 45 / RCB W) / P(VK>=45)

We have the below values.

P(VK>=45/ RCB W) = 0.63

P (RCB W) = 0.46

P (VK >= 45) =? Is missing.

Step 5: Exploring the generalized form.

RCB Winning: Given RCB has winning, there are two possibilities scenarios, VK scoring greater than equal to 45 or not.

1. VK >= 45 = P (RCB W) * P (VK >= 45 / RCB W) = 0.46 * 0.63 =0.2898

2. VK < 45 = P (RCB W) * P (VK < 45 / RCB W) = 0.46 * 1.53 = 0.7065

Similarly

RCB W’ Given RCB has Lost, there are two possibilities scenarios, VK scoring greater than equal to 45 or not.

3. VK >=45 = P(RCB L) * P(VK >= 45 / RCB L) = 0.54 * 0.54=0.2916

4. VK < 45= P(RCB L) * P(VK < 45 / RCB L)= 0.54 * 2.4074 =1.3

Step 5.1: Adding the probabilities of VK scoring >= 45 runs in an innings in both cases when RCB won and with RCB lost. Adding values fro 1 & 3.

P(VK>45) = 0.2898 + 0.2916 = 0.5814

Step 6 : Substituting the values in Bayes theorem

Bayes Theorem: P (RCB W/ VK>=45) = P(VK>=45/RCB W) * P(RCB W)/ P(VK>=45)

P(RCB W/VK>45) = 0.63 *0.46 /0.5814 = 0.2898/0.5814

P(RCB W/ VK >= 45) = 0.4985 = 49 %

Given the data from 2008 to 2020 , we can say that if Virat Kohli scores greater than or equal to 45 runs in an innings, the team is likely to win 49 % of times.

Hypothical Scenario 1

If Virat Kohli maintains the same consistency level, however imaging other team members contribute and their overall probability of winning increase by say 10% i.e. P(RCB W) = 0.56

P (RCB W/VK>45) = 0.51 *0.56 /0.51 = 0.56

We can say apart from Virat Kohli if other in the team contribute towards winning by additional 10 % , the overall the team winning percentage will grow from 49 % to 56 % .

--

--