Total probability law
1. Total probability law
Often you can find problems where your sample space, or in other words your possible outcomes, can be broken into non overlapping parts. The total probability law allows you to calculate probabilities under such conditions.2. Deck of cards example
Let's consider a deck of cards, which is naturally partitioned, and the partitions do not overlap.3. Deck of cards example (Cont.)
A face card is a card that does not have a number. To get the probability of getting a face card...4. Deck of cards example (Cont.)
we just add the probability of getting such a card in each suit. That is, we add the joint probability of getting a club and a face card...5. Deck of cards example (Cont.)
with the joint probability of getting a spade and a face card...6. Deck of cards example (Cont.)
plus the joint probability of getting a heart and a face card...7. Deck of cards example (Cont.)
plus the joint probability of getting a diamond and a face card. We've just added each non overlapping part. Now let's do it in Python.8. Face card example in Python
In Python, we create the variables that represent the probability of a face card in each suit (clubs, spades, hearts, diamonds), which in each case is 3 over 52. Then, the probability of getting a face card is the sum of all the probabilities, or 23%. Now let's see this problem in general.9. Total probability
Going back to our vendors and parts example, let's consider all the parts we've bought from different vendors (V1, V2, and V3)...10. Total probability (Cont.)
and also consider the damaged parts we got.11. Total probability (Cont.)
We can partition the parts according to the vendor that provided them, and we want to calculate the probability of getting a damaged part.12. Total probability (Cont.)
To calculate such a probability, we add the probability of getting a part from V1 that is damaged...13. Total probability (Cont.)
with the probability of getting a part from V2 that is damaged...14. Total probability (Cont.)
and the probability of getting a part from V3 that is damaged. The total probability law states that the probability of an event in a non overlapping partitioned space is the sum of the probabilities of such an event in each partition.15. Total probability (Cont.)
Using the formula for conditional probability, we can get the probability of a part being damaged by calculating the sum of the products of the probability of a part being from V1, V2, or V3 and the probability of a part being damaged given that the part is from V1, V2, or V3. This last formula is very important, so give it some thought. Now let's apply the total probability law with an example.16. Damaged parts example in Python
A certain electronic part is manufactured by three different vendors, V1, V2, and V3. Half of the parts are produced by V1, and V2 and V3 each produce 25%. The probability of a part being damaged given that it was produced by V1 is 1%, while it's 2% for V2 and 3% for V3. What is the probability of a part being damaged?17. Damaged parts example in Python (Cont.)
First we create variables to specify the individual probabilities of a part being from vendors V1, V2, and V3, which are 50%, 25%, and 25%, respectively. Then we create variables to specify the conditional probabilities of receiving a part that is damaged from V1, V2, and V3, which are 1%, 2%, and 3%, respectively.18. Damaged parts example in Python (Cont.)
Finally, we apply the total probability formula to determine that the probability of getting a part that is damaged is 0.0175.19. Let's start using the total probability law
Now you know that if you have non overlapping partitions in your sample space, you can apply the total probability law to calculate probabilities. Let's start using the total probability law.Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.