To understand this article, you should first read our first article, introducing the basics of probability.
When working with probability, we have initial beliefs about events. If we are given new “partial” information, then we must update our initial beliefs. Conditional probability deals with these kinds of problems. For example, our experiment consists of two coin tosses. Our initial beliefs about the experiment are:
We can get 2 heads (HH), two tails (TT), 1 head and 1 tail (HT), 1 tail and 1 head (TH).
Note that, in probability, getting head (H) and then tail (T) is different from getting tail (T) and then head (H).
So our sample space (S) consists of {HH, TT, TH, HT}, a total of four elements. Our initial beliefs about two tosses are, we can get any outcome from this sample space with the same chance or probability.
So, P(HH) = ¼, P(TT)= ¼, P(TH)=1/4, and P(HT)= ¼
We are dividing by 4 because there are a total 4 elements in the sample space. Moreover, every outcome has a equal probability, we call it uniform probability. Furthermore, total probability of sample space (S) is given by:
P(S)= P(HH) + P(TT) + P(TH) + P(HT)
P(S)= ¼ + ¼ + ¼ + ¼ = 1
So, our initial belief is every outcome has same probability, i.e. ¼
Now, someone tells us that the result of first toss is head (H). We must revise our initial beliefs and our probability model. So this is called conditioning. Now, we have a condition that, the first toss result is head (H). Therefore, we cannot have both tails (TT). Therefore, we must revise our beliefs, and calculate new probabilities.
More formally, if we have two events A and B, we are given some information about B, then conditional probability is written as follows:
P(A|B) and we read it as follows: The probability of event A given that the event B has already happened.
In case of above example,
Let event A= 2 tails (TT), and event B= the result of the toss is head (H).
Then P(A|B) = ?
Think, about it. What is the probability of getting 2 tails (TT) i.e. P(A), when we already know that first toss result is head (someone told us the event B has happened)? Yes, you are right, it is 0 (zero). Mathematically,
P(A|B) = 0.
So, conditional probability deals with these kind of scenarios.
In above example, we founded P(A|B) with just commonsense. Is there any formula for conditional probability? The answer is yes. For any two events A and B, conditional probability is given as follows:
P(A|B) = P(A ∩ B)/P(B)
Where, ∩ is the symbol of intersection.
Intuitively, we can read it, if the event B has happened, what fraction or percentage of event A has also happened? Let’s see it with a visual example.
In this example (shown in figure above), initial probability of event A, shown in yellow: P(A)= 3/6
The initial probability of event B, shown in blue: P(B) = 2/6 + 1/6= 3/6
There is an overlapping area of A and B. This overlapping area can be mathematically given as A ∩ B, and its probability can be given as P(A ∩ B) which we see visually that it is equal to 2/6. Note that probability of occurring A and B together is P(A ∩ B) = 2/6.
So our initial beliefs are:
P(A) = 3/6
P(B)= 2/6
P(A ∩ B) = 2/6
Now, someone tells us that event B has occurred. Then, we have to update our belief, and calculate new probability of event A, i.e. P(A).
Using the formula, P(A|B) = P(A ∩ B)/P(B)
P(A|B) =( 2/6) / (3/6)= 2/6 x 6/3 = 2/3
So, by using conditional probability, the chance (probability) of happing event A when event B has happened is given by P(A|B)= 2/3.
We can also rearrange the above formula. , i.e.
P(A|B) = P(A ∩ B)/P(B)
P(A ∩ B) = P(B) P(A|B)
We can read above equation intuitively as: The fraction of times both event A and event B occurred together can be given by, we look at the experiments when event B occurred, i.e. P(B), and then the fraction of times event A has also occurred along with event B.
The last equation is also known as product rule of probability.
You might be wondering,
if P(A ∩ B) = P(B) P(A|B), and why not P(A ∩ B) = P(A) P(B|A) ?
Your question is valid, and actually, both equations are correct. Therefore, the probability of occurring event A and event B together can be calculated in two ways:
We can derive the Bayes rule by combining the above two equations. But we leave it for the next article.
In this article, we introduced the concept of conditional probability, which deals with updating our probabilities, if we are given new partial information. Conditional probability is the basis of many interesting concepts in probability theory. I hope, I explained it with simple examples.
Powered by Froala Editor