Lecture 1. Conditional probability

View

Ссылка на yuotube

 

Conditional probability. The formula of total probability, Bayes ' formula.

Let's start with an example: there is a certain urn containing 11 red, 10 blue, and 9 green balls.

We need to find the probability that first we will get a red ball, then a blue one, and then a green one. We can take out three balls in turn.

 Let's introduce events: let event A be the first, and the red ball will appear, event B be the second, and the blue ball will appear, and event C be the third, and the green ball will appear. Then we need to find the probability of the product of these events.

It is easy to make sure that this probability is not equal to the product of the probabilities of events A, B, and C.

To do this, let us consider the conditional probability as another example of the probability function.

Let's look at another example: let's say that the dice is tossed once, and we don't see the result that we have, but our friend sees and says that we have more than 3 points.

 You need to find out what the probability of having an odd number of points on the dice is. Let us consider the situation: let the event A be the case when we have an odd number of points. It is the event whose probability we are interested in. It is a priori probability, i.e. the probability before we toss the dice. It is equal to 1/2, as 3 basic outcomes of the 6 can satisfy us. However, we have additional information that more than three points is on the dice that is 4, 5 or 6. 

We already know that the points 1 or 3 cannot be on the dice. Thus, just one outcome of the three elementary ones, which could have been, can take place.

Thus, we move from one space of elementary outcomes to another space and the probability of our event changes.  

In this case, the probability of the event is no longer 1/2, but 1/3. This probability is called conditional and it is denoted by a dash.

Thus, we find the probability of event A, provided that event B has occurred.

You can see the definition of the conditional probability on the next slide. Note that any probability can be considered conditional, that is, if you take the omega event instead of the B event, then the probability of event A is the probability of event A, provided that the omega event has occurred.

 To calculate the conditional probability, you can use the formula shown on the slide.

 Let's look at an example, you can use the formula shown on the slide. Let's use this formula in the previous example.

The event A: we have an odd number of points on the dice. The event B:  we have more than three points on the dice.

The probability of the event B is 1/2, as 3 out of 6 basic outcomes can satisfy us.

The probability of their product is just the basic outcome 5; it is one of the six. The probability is 1/6. The probability of the event A provided that B has occurred, is equal to the ratio of the probability of the product to the probability of the event B, i.e. 1/3. 

The rule of multiplication. The conditional probability can be used when calculating the probability of the product of two events. That is, we can express the probability of the product of events from the previous ratio, or the probability of the event A by the conditional probability of B, provided A, or vice versa.

If the events are independent, i.e. the product probability of the event is equal to the product of their probabilities, then the probability of the event B, provided A, is equal to the conditional probability, i.e. the product probability of the event by the probability of the event A. Since the events are independent, then we can write it down as the product of the probabilities, and the probability of the event A can be cancelled.

Thus, the probability of the event B, provided that A has occurred, is equal to A a priori, that is, the unconditional probability of the event B.

We can also prove that the probability of the event B, provided that A has not occurred, is equal to the probability of the event B.

Thus, we can give the second definition of the independence of two events. Events are independent if and only if the probability of the event B does not change regardless of the fact whether the event A has occurred or not.

Let's consider the first example: let's write down the probability of the product in terms of the conditional probability. on the slide, you can see how we do it. Eventually, we present the product probability as the product of three probabilities: of the event A (the red ball is the first that we take out); the event B provided A has occurred (we take out the blue ball after the red one); and the event C (we take out the green ball provided that the red and blue ones have already been taken out).

The probability of the event A is 11/30, and then after the red ball is taken out, there are 29 balls left, of which 10 balls are blue. The probability of the event B provided that A has occurred is 10/29 and the probability of the event C provided that the events A and B have occurred is 9/28. Thus, the product of these probabilities is the probability required in the problem.

Let's take another example: there are two urns. There are 3 white and 2 black balls in the first urn, and 7 white and 3 black balls in the second one. The task is to find out the probability of taking out a white ball. The first option: the ball is taken out of urn 1. Since there are 3 white balls there, the probability is 3/5, or 0.6. If the ball is taken out of urn 2, the probability to get a white ball is 7/10, as there are 7 white balls and 3 black ones.

Now the task is more difficult: you need to find the probability of getting a white ball from an arbitrary urn. When we say that the urn is chosen at random, we assume that both urn 1 and urn 2 can be chosen with equal probability. In this case, the experiment consists in taking out balls from an arbitrary urn, and the elementary outcome is both the urn number and the ball number in the urn.

 The event – h1: a ball is taken out of the first urn; exactly half of the elementary outcomes are favorable for the event h1.

The probability of this event is 1/2. Similarly, the probability of the event h2 (the ball is taken out of the second urn) is also equal to ½. Let us draw the diagrams of Euler-Venn. Note that the sum of the two events h1 and h2 is equal to a certain event, i.e. the set of elementary outcomes in the combination of these events is the set of all elementary outcomes, and the events h1 and h2 are incompatible, i.e. their sets of elementary outcomes do not intersect.

 Now let's introduce another event: a white ball is taken out, and we add it to the Euler-Venn diagram. Then the event C can be represented as C multiplied by the sum of h1 and h2, since nothing changes when multiplied by a reliable event. Let us remove the parentheses and note that the events h1 and h2 are incompatible. Since the events h1 and h2 are incompatible, then the probability of the event C can be represented as the probability of the sum. Since the events are incompatible, it can be represented as the sum of the probabilities of these events. Let us present the probability of products via the conditional probability, i.e. we can present the probability of event we C as the probability of h1, multiplied by the probability of the event B provided that h1 has occurred plus the probability of the event h2 multiplied by the probability of the event C provided that h2 has occurred.

We already know the first probabilities of the events h1 and h2. Now we have to find out the probability of the event C if h1 has occurred and the probability of the event C provided that h2 has occurred. Note that this is nothing but taking a white ball  out of urn 1 and a white ball out of urn 2 , that is, these probabilities are 0.6 and 0.7, correspondingly. Thus, the probability of the desired event is 0.65. This example demonstrates the application of the full probability formula, which is shown on the next slide.

 In order to summarize this example, we introduce another definition: let h1, h2, and so on hkt be a certain set of events that satisfy 2 terms. The first term is that the sum of these events is a valid event.

 The second term is that any two events are incompatible; in other words, events are mutually incompatible.

This set is called the complete group of incompatible events.

 The formula of total probability: suppose we have the set of all elementary outcomes divided into mutually incompatible events, i.e. we have a complete group of incompatible events.

We are interested in the probability of some event A, which we cannot calculate directly. Then we can calculate the probability of the event A, using the conditional probability.

If we know the probabilities of the events h1 and A if h1 has occurred, h2 and A if h2 has occurred and so on, we can calculate the probability of the event A on the basis of the formula shown in the slide. Proving on the basis of this formula is similar to the one we derived in the example. It is discussed in the reference book on independent work.

Let's take an example: there are three factories that produce the same products. Factory 1 produces 25 percent of all products, Factory 2 – 35 percent, and Factory 3 – 40 percent of all products.

 There can be spoilage at each factory: the probability of spoilage at Factory 1 is 0.05, the probability of spoilage at Factory 2 is 3 percent of all products; and the probability of spoilage at Factory 3 is 4 percent. You need to find out the probability that a randomly selected product from a mixture of all products from all three factories is defective.

 In this case, the entire set of elementary outcomes can be divided into three hypotheses: the purchased product belongs to factory 1, the purchased product belongs to factory 2, and the purchased product belongs to factory 3. 

The probabilities of these hypotheses correspond to the percentage of the output.

Let us introduce the event A: we have purchased defective products. We can calculate the probability of the event A using the full probability formula. Then we substitute the values known to us and get that the probability of this event. It is 0.39.

The full probability formula is often used when calculating conditional probabilities.

If we have a complete group of incompatible events, and we are not interested in the probability of any event, and we already know that some event has occurred, and we are interested in the probability of some hypothesis, provided that this event has occurred, then we can use the Bayes formula. Using the conditional probability, we can represent in the numerator that the event A has occurred. The denominator represents the probability of the event A, calculated using the full probability formula.

 Let's look at an example. We know from the previous task that we have bought a defective product and we want to find out the probability of it being produced at factory 1.

We have the same events. We need to find out the probability of the event h1, provided that A has occurred, that is, the probability that the product is produced by factory 1, provided that this product is defective.

You can calculate it using the conditional probability formula. We already calculated the denominator in the previous example.

We find out that this probability is 0.32 approximately.


Last modified: Среда, 4 декабря 2024, 2:42