# Conditional Probability

Let’s take an example to understand the concept of conditional probabilities. Suppose there is an ODI match between India and Australia and if we assume the fair conditions as in a neutral venue where both teams are equally good, they have their best players in the team and now if at the start of the match we are interested in knowing the chance of India winning, then given that both the teams are equally strong, the venue is neutral and other conditions are also fair, we can say that there is a 50% of India winning the game. So, this answer is based on the assumption that both teams are equally good, and therefore both the teams have equally likely chances of winning the game(excluding the outcome that the match ties).

Now if we say that India scored 395 runs and ask the probability of India winning, the answer would definitely be going to be greater than 0.5 because we know that these are a lot of runs while chasing

Let’s see what exactly happened here and define two events ‘A’ and ‘B’ as specified in the below image:

Before the start of the match, we know that both the teams are equally likely and at this point, the probability of event ‘A’(the event that India will win) would be 0.5

Now given that the event ‘B’ has occurred i.e India scored 395 runs, our belief about the probability of event ‘A’ has changed and mathematically we can write it as:

The probability of event ‘A’ given that event ‘B’ has occurred(is represented as P(A | B)) is not the same as the original value of the probability of event ‘A’(i.e Indian team will win the game)

Let’s look at another example

Say 10% of the population is infected with COVID-19 and we are interested in knowing the probability that a randomly selected person is healthy.

Let’s say we define the event ‘A’ that a randomly selected person is healthy and since it is given that 10% population is infected, we might say that the probability of event ‘A’ is 0.9

Now if we are given additional information that the selected person has COVID-19 symptoms(say this is represented as event ‘B’), given the information that event ‘B’ has occurred, our belief about the event ‘A’ would change

Let’s take another example: suppose we are throwing a pair of dice and we are interested in knowing the probability that the sum of numbers on two dice is 8

The below table reflects the possible 36 outcomes in this case:

And the highlighted cases in the below image are the ones where the sum of the numbers on two dice is 8

So, there are 5 possible outcomes when the sum is 8 and if we denote the event that the sum of outcomes is 8 by event ‘A’ then the probability of ‘A’ is given as below:

Now if we change the question a bit and ask the probability that the sum of the numbers on two dice is 8 given that the first dice shows up a 4

We can define two events:

Since the first dice shows up 4, we have a total of 6 possibilities in this case:

Now the sample space does not contain 36 outcomes, we know for sure that the outcomes are one of the 6 highlighted points in the above image, and out of these 6 possible outcomes, only one outcome is of interest to us for which the sum is 8

Let’s derive the formula to compute the conditional probability:

Here are the same 36 outcomes arranged in a different manner

And the possible outcomes for event A, B are highlighted in the below image:

Since the event ‘B’ has a possible of 6 outcomes, its share in a total of 36 outcomes would be 6/36 or in other words, the probability of event ‘B’ would be 1/6.

And the share/probability of the event A intersection B would be 1/36

Now the share of event A intersection B relative to the share of event ‘B’ would be given as the ratio of two values and this ratio is essentially the same as the P(A | B)

Let’s take some examples on conditional probability:

We can select any of the 2 digit numbers from a total of 90 two-digit numbers and all of them are equally likely

Let’s define two events as per the task:

We are interested in knowing the probability of event ‘A’ given that the event ‘B’ has already occurred

Let just see the probability of event ‘A’:

we have two slots and we can not have the digit 0 at the first slot and the first slot can have any of the digits from {2, 4, 6, 8} and for the second slot we have 5 choices{0, 2, 4, 6, 8} so there are a total of 4*5 i.e 20 two-digit numbers such that both digits are even

Let’s first compute the P(B): since we have the constraint that at least one digit must be even, we use the subtraction principle

First, we compute the number of elements in B complement i.e number for which both the digits are odd, so we have a total of 5 choices for the first slot and the same 5 choices for the second slot.

In total, we have a total of 5 * 5 = 25 elements in the B complement which means we have a total of 90–25 = 65 elements in set B

Now that we know the number of elements corresponding to B and the total number of elements, the probability of ‘B’ would be given as 65/90

In this case, event A is a subset of event B: event A is the case that both the digits are even whereas event B is the case that at least one digit is even since A is a subset of B, that means A intersection B would just be equal to A and using the same, we can compute the P(A | B)

Let’s take one more example:

It is given that 60% of the students opted for ML, so we know the probability of ‘B’ as 0.6 and 20% of students enrolled for both ML and DL so we know that the probability of A intersection B would be 0.2

Let’s see how the conditional probability satisfies the axioms of probability:

The first axiom says that the probability value must be greater than equal to 0, as per the formula of conditional probability, it is just a ratio of two probability values(two positive numbers) we can say that the conditional probability value would always be greater than equal to 0.

The second axiom says that the probability of the universal set given that event B(from the same universal set) has occurred must be 1. As is clear from the calculation part in the below image, we can say that this axiom is also satisfied.

Let’s say there are two disjoint events ‘A₁’ and ‘A₂

Conditional probability also follows the axioms of probability.