Often in life, we are faced with the fact that we need to assess the chances of an event occurring. Whether it is worth buying a lottery ticket or not, what will be the gender of the third child in the family, will the weather be clear tomorrow or will it rain again - countless examples can be cited. In the simplest case, the number of favorable outcomes should be divided by the total number of events. If there are 10 winning tickets in the lottery, and there are 50 in total, then the chances of getting a prize are 10/50 = 0.2, that is 20 versus 100. But what if there are several events and they are closely related? In this case, we will no longer be interested in a simple, but a conditional probability. What is this value and how it can be calculated - this will be discussed in our article.
The concept
Conditional probability is the chances of a particular event occurring, provided that another event associated with it has already occurred. Consider a simple coin throwing example. If there was no drawing of lots, then the chances of losing an eagle or tails will be the same. But if five times in a row the coin was placed with the emblem up, then agree to expect the 6th, 7th, and even more so 10th repetition of such an outcome would be illogical. With each repeated loss of the eagle, the chances of the appearance of the tails are growing and sooner or later it will fall out.
Conditional probability formula
Let's now figure out how this value is calculated. We denote the first event by B, and the second by A. If the chances of the onset of B are non-zero, then the following equality will be true:
P (A | B) = P (AB) / P (B), where:
- P (A | B) - conditional probability of total A;
- P (AB) is the probability of the joint occurrence of events A and B;
- P (B) is the probability of event B.
Slightly transforming this ratio, we obtain P (AB) = P (A | B) * P (B). And if you apply the induction method, then you can derive the product formula and use it for an arbitrary number of events:
P (A 1 , A 2 , A 3 , ... A p ) = P (A 1 | A 2 ... A p ) * P (A 2 | A 3 ... A p ) * P (A 3 | A 4 ... A p ) ... P (A p-1 | A p ) * P (A p ).
Practice
To make it easier to understand how the conditional probability of an event is calculated , consider a couple of examples. Suppose there is a vase in which there are 8 chocolates and 7 mints. They are the same in size and two of them are randomly pulled out at random. What are the chances that both of them will turn out to be chocolate? We introduce the notation. Let total A mean that the first chocolate candy, total B - the second chocolate candy. Then we get the following:
P (A) = P (B) = 8/15,
P (A | B) = P (B | A) = 7/14 = 1/2,
P (AB) = 8/15 x 1/2 = 4/15 ≈ 0.27
Consider another case. Suppose there is a two-child family and we know that at least one child is a girl.
What is the conditional probability that these parents do not have boys yet? As in the previous case, we start with the notation. Let P (B) be the probability that there is at least one girl in the family, P (A | B) be the probability that the second child is also a girl, and P (AB) be the chances that there are two girls in the family. Now let's make the calculations. In total there can be 4 different combinations of the sex of the children, and in this case only in one case (when the family has two boys), there will be no girl among the children. Therefore, the probability P (B) = 3/4, and P (AB) = 1/4. Then, following our formula, we get:
P (A | B) = 1/4: 3/4 = 1/3.
The result can be interpreted as follows: if we were not aware of the gender of one of the children, then the chances of two girls would be 25 versus 100. But since we know that one child is a girl, the probability that there are no boys in the family increases to one third.