The Wayback Machine - https://web.archive.org/web/20250101010826/https://www.geeksforgeeks.org/mathematics-law-of-total-probability/
Open In App

Mathematics – Law of Total Probability

Last Updated : 28 Nov, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Probability theory is the branch of mathematics concerned with the analysis of random events. It provides a framework for quantifying uncertainty, predicting outcomes, and understanding random phenomena. In probability theory, an event is any outcome or set of outcomes from a random experiment, and the probability of an event is a number that represents the likelihood of that event occurring.

The Law of Total Probability is a fundamental theorem in probability theory that relates the probability of an event to the probabilities of a set of mutually exclusive and exhaustive events. The idea is that if an event can occur in several ways, the total probability of the event is the sum of the probabilities of the different ways in which it can occur.

Understanding the Law of Total Probability

The Law of Total Probability states that if B1, B2, …, Bn are mutually exclusive and exhaustive events ( meaning they cover all possible outcomes and do not overlap ), and A is an event of interest, then the probability of A can be calculated as:

P(A) = (i=1∑n ​P(A∣Bi​)P(Bi​))

The law of total probability is important to find the probability of an event happening. If the probability of an event is going to happen is known to be 1, then for an impossible event it is likely to be 0. A fundamental rule in the theory of probability that is interconnected to marginal probability and conditional probability is called the law of total probability, or the total probability theorem.

After several events, it is known that the probability of all the possibilities should be known. The theorem of total probability is the core foundation of Baye’s theorem. In this article, we have discussed important concepts related to total probability, including the law of total probability, statements, proofs, and some examples.

Law of Total Probability

Given n mutually exclusive events A1, A2, …Ak such that their probabilities sum is unity and their union is the event space E, then Ai ∩ Aj= NULL, for all I not equal to j, and

A1 U A2 U … U Ak = E

Then the Total Probability Theorem, or Law of Total Probability, is:Law of Total Probability where B is an arbitrary event, and P(B/Ai) is the conditional probability of B assuming A already occurred.

Total Probability Theorem Proof

Let A1, A2, …, Ak be disjoint events that form a partition of the sample space and assume that P(Ai) > 0, for i = 1, 2, 3….k, such that:

A1 U A2 U A3 U ….U AK = E(Total)

Then, for any event B, we have,

B = B ∩ E B = B ∩ (A1 U A2 U A3 U ….U AK)

As intersection and Union are Distributive. Therefore,

B = (B ∩ A1) U (B ∩ A2)U … U(B ∩ AK)

Since all these partitions are disjoint. So, we have,

P(B ∩ A1) = P(B ∩ A1) U P(B ∩ A2)U … U P(B ∩ AK)

That is the addition theorem of probabilities for a union of disjoint events. Using Conditional Probability

P(B / A) = P(B ∩ A) / P(A)

Or by the multiplication rule,

P(B ∩ A) = P(B / A) x P(A)

Here events A and B are said to be independent events if P(B|A) = P(B), where P(A) not equal to Zero(0),

P(A ∩ B) = P(A) * P(B)

where P(B|A) is the conditional probability which gives the probability of occurrence of event B when event A has already occurred. Hence,

P(B ∩ Ai) = P(B | Ai).P(Ai) ; i = 1, 2, 3….k

Applying this rule above we get,

This is the law of total probability. The law of total probability is also referred to as the total probability theorem or law of alternatives.

Note:

The law of total probability is used when you don’t know the probability of an event, but you know its occurrence under several disjoint scenarios and the probability of each scenario.

Application of Theorem of Total Probability

It is used for the evaluation of the denominator in Bayes’ theorem. Bayes’ Theorem for n set of events is defined as,

Let E1, E2,…, En be a set of events associated with the sample space S, in which all the events E1, E2,…, En have a non-zero probability of occurrence. All the events E1, E2,…, E form a partition of S. Let A be an event from space S for which we have to find probability, then according to Bayes’ theorem,

P(Ei|A) = P(Ei)P(A|Ei) / ∑ P(Ek)P(A|Ek)

for k = 1, 2, 3, …., n

Applications of the Law of Total Probability:

The Law of Total Probability is useful in various fields such as:

  • Finance: Calculating the likelihood of different financial outcomes based on market conditions.
  • Risk Analysis: Evaluating the risk of system failures by considering different failure modes.
  • Medical Diagnosis: Determining the probability of having a disease given various test outcomes.
  • Reliability Engineering: Estimating the probability of equipment functioning or failing.
  • Machine Learning: Computing probabilities in classification problems where multiple scenarios are considered.

Visualization of the Law of Total Probability

Visualization can help understand how the Law of Total Probability distributes the overall probability across different events:

  • Venn Diagrams: Display the event A intersecting with each event Bi, highlighting the contributions of different Bi to the probability of A.
  • Tree Diagrams: Show sequences of conditional events, illustrating how probabilities branch out from each event.

Examples on Law of Total Probability

1. We draw two cards from a deck of shuffled cards with replacements. Find the probability of getting the second card a king.

Solution:

Let, A – represent the event of getting the first card a king. B – represent the event that the first card is not a king. E – represents the event that the second card is a king. Then the probability that the second card will be a king or not will be represented by the law of total probability as:

P(E)= P(A)P(E|A) + P(B)P(E|B)

Where, P(E) is the probability that the second card is a king, P(A) is the probability that the first card is a king, P(E|A) is the probability that the second card is a king given that first card is a king, P(B) is the probability that the first card is not a king, P(E|B) is the probability that the second card is a king but the first card drawn is not a king. According to the question:

P(A) = 4 / 52 P(E|A) = 4 / 52 P(B) = 48 / 52 P(E|B) = 4 / 52

Therefore,

P(E) = P(A)P(E|A) + P(B)P(E|B) =(4 / 52) * (4 / 52) + (48 / 52) * (4 / 52) = 0.0769230

2. A factory produces three types of products: P1, P2, and P3. The production of P1, P2, and P3 is 30%, 20%, and 50% of the total production, respectively. The probability that a product is defective is 1% for P1, 2% for P2, and 3% for P3. If a product is selected at random, what is the probability that it is defective?

Solution:

Let A1, A2, and A3 represent the events of producing P1, P2, and P3, respectively. Let D represent the event that the product is defective.

P(A1) = 0.30 P(A2) = 0.20 P(A3) = 0.50 P(D∣A1) = 0.01 P(D∣A2) = 0.02 P(D∣A3) = 0.03

Using the Law of Total Probability:

P(D) = P(D∣A1)P(A1) + P(D∣A2)P(A2) + P(D∣A3)P(A3) P(D) = (0.01×0.30) + (0.02×0.20) + (0.03×0.50) P(D) = 0.003 + 0.004 + 0.015 = 0.022

3. A driver passes through two traffic lights on his way to work. The probability that the first light is green is 0.3, and the probability that the second light is green given that the first light is green is 0.6. The probability that the second light is green given that the first light is not green is 0.2. What is the probability that the driver sees a green light at the second intersection?

Solution:

Let G1 represent the event that the first light is green and G2 represent the event that the second light is green.

P(G1) = 0.3 P(G1′) = 0.7 P(G2∣G1) = 0.6 P(G2∣G1′) = 0.2

Using the Law of Total Probability:

P(G2) = P(G2∣G1)P(G1) + P(G2∣G1′)P(G1′) P(G2) = (0.6×0.3) + (0.2×0.7) P(G2) = 0.18+0.14 = 0.32

4. In a town, 60% of the population supports Candidate X, while 40% supports Candidate Y. A survey is conducted where 70% of Candidate X’s supporters and 20% of Candidate Y’s supporters favor a particular policy. What is the probability that a randomly selected person from the town favors this policy?

Solution:

Let X represent the event that a person supports Candidate X and Y represent the event that a person supports Candidate Y. Let P represent the event that a person favors the policy.

P(X) = 0.6 P(Y) = 0.4 P(P∣X) = 0.7 P(P∣Y) = 0.2

Using the Law of Total Probability:

P(P) = P(P∣X)P(X) + P(P∣Y)P(Y) P(P) = (0.7×0.6) + (0.2×0.4) P(P) = 0.42 + 0.08 = 0.50

5. A meteorologist predicts that there is a 30% chance of rain tomorrow. If it rains, there is a 60% chance that it will be a storm. If it doesn’t rain, there is a 5% chance of a storm due to other factors. What is the probability that there will be a storm tomorrow?

Solution:

Let R represent the event of rain, and S represent the event of a storm.

P(R) = 0.3 P(R’) = 0.7 P(S∣R) = 0.6 P(S∣R’) = 0.05

Using the Law of Total Probability:

P(S) = P(S∣R)P(R) + P(S∣R’)P(R’) P(S) = (0.6 × 0.3) + (0.05 × 0.7) P(S) = 0.18 + 0.035 = 0.215

Also Read:

Conclusion

The Law of Total Probability is a fundamental principle in probability theory used for determining the probability of an event by considering all possible scenarios in which it might occur. This theorem is related to marginal and conditional probabilities, and provides foundation for Bayes’ Theorem. It is useful when the direct probability of an event is unknown, but its probability under various conditions is known. The theorem is essential for various applications.

Practice Problems on Law of Total Probability

1. A certain disease affects 0.1% of the population. A medical test for this disease is 99% accurate. What is the probability that a randomly selected person who tests positive actually has the disease?

2. A shipment contains three different components: A, B, and C. The probabilities of selecting a A, B, and C component are 0.4, 0.35, and 0.25, respectively. The probabilities that a selected component is defective are 0.02 for A, 0.03 for B, and 0.05 for C. What is the probability that a randomly selected component from the shipment is defective?

3. In a certain population, 1% of people have Disease A. A test for Disease A is 95% accurate. What is the probability that a person has Disease A given that they tested positive?

4. In a certain town, it is known that 40% of the population prefer tea, 30% prefer coffee, and the 30% prefer juice. If a person is chosen at random, the probability that they are satisfied with their choice of beverage is 0.7 for tea drinkers, 0.8 for coffee drinkers, and 0.6 for juice drinkers. What is the probability that a randomly chosen person is satisfied with their choice of beverage?

5. In a school, 70% of the students are in the science stream, and 30% are in the arts stream. The pass rate is 85% for science students and 75% for arts students. If a randomly selected student passes, what is the probability that they are in the science stream?

6. You are given three boxes. The first box contains 2 red and 1 white ball, the second contains 1 red and 2 white balls, and the third contains 3 red and 1 white ball. A box is chosen at random and a ball is drawn. If the ball is red, what is the probability that it was drawn from the third box?

7. A traffic light is green 50% of the time, yellow 10% of the time, and red 40% of the time. If you approach the light and it is not red, what is the probability that it is green?

8. There are three factories producing the same product. Factory A produces 40% of the products, Factory B produces 35%, and Factory C produces 25%. The probability of a defective product from these factories is 2%, 3%, and 5% respectively. If a product is found to be defective, what is the probability it was produced by Factory B?

9. A disease test has a false positive rate of 5% and a false negative rate of 2%. In a population where 2% of people have the disease, what is the probability that a person who tests positive actually has the disease?

10. A factory has two suppliers A and B. A supplies 60% of the components and B supplies 40%. The defect rates for these suppliers are 1% and 2% respectively. If a component is found to be defective, what is the probability that it was supplied by B?

FAQs on the Law of Total Probability

What is the Law of Total Probability?

It is a rule that provides a way to calculate the probability of an event by considering several different scenarios.

When do we use the Law of Total Probability?

It is used when an event can occur under multiple mutually exclusive and exhaustive conditions.

How does it differ from the Law of Conditional Probability?

The Law of Conditional Probability gives the probability of an event given another event has occurred, while the Law of Total Probability uses these conditional probabilities to compute the total probability.

Can it be applied to continuous distributions?

Yes, the concept can extend to continuous probability distributions using integrals instead of summations.

What is the relationship between the Law of Total Probability and Bayes’ Theorem?

The Law of Total Probability is often used as a step in deriving Bayes’ Theorem, which calculates the probability of an event based on prior knowledge.

What is the use of total probability?

Law of total probability is used to calculate the probability of an event given any number of related events. Using Baye’s Theorem to update the probability of a hypothesis given new evidence.

Is total probability always 1?

The sum of the probabilities of all the events is always 1.

Can the total probability be greater than 1 ?

No, the total probability can not be greater than 1.



Next Article

Similar Reads

three90RightbarBannerImg