This is a beta course, so its structure, chapters, and examples may continue to change.
Conditional Probability, the Law of Total Probability, and Bayes' Formula
Conditional Probability
Definition of Conditional Probability
Definition
A definition is a precise description of what a concept, a term, or an object means. Understanding definitions is the foundation of learning any field, and every concept has its own exact meaning.
Conditional Probability
Let A and B be two events with P(B)>0. The probability that event A occurs given that event B has occurred is called the conditional probability, denoted by P(A∣B), and is defined as:
P(A∣B)=P(B)P(A∩B)
Intuitive Understanding of Conditional Probability
Understanding: the conditional probability P(A∣B) gives the probability that event A occurs given that event B has occurred. It reflects the influence of the occurrence of event B on the probability of occurrence of event A.
Properties of Conditional Probability
Property 1: 0≤P(A∣B)≤1
Property 2: P(Ω∣B)=1, P(∅∣B)=0
Property 3: if A1,A2,…,An are pairwise mutually exclusive, then:
P(A1∪A2∪⋯∪An∣B)=P(A1∣B)+P(A2∣B)+⋯+P(An∣B)
Property 4: P(A∣B)=1−P(A∣B)
Multiplication Formula for Conditional Probability
Mathematical formula
A formula is a symbolic expression of quantitative relations and structural patterns, and an essential tool for solving mathematical problems. Key formulas should be mastered and applied flexibly.
Multiplication Formula
For any two events A and B:
P(A∩B)=P(B)P(A∣B)=P(A)P(B∣A)
Generalization: for any n events A1,A2,…,An:
P(A1∩A2∩⋯∩An)=P(A1)P(A2∣A1)P(A3∣A1∩A2)…P(An∣A1∩A2∩⋯∩An−1)
Examples of Conditional Probability
Example 1: drawing one card at random from a deck
Let A={a heart is drawn}
Let B={a red card is drawn}
P(A)=5213=41
P(A∣B)=P(B)P(A∩B)=52265213=21
Example 2: rolling two dice
Let A={the first die shows 6}
Let B={the sum of the two dice is 8}
P(A)=61
P(B)=365 (there are 5 cases: (2,6), (3,5), (4,4), (5,3), (6,2))
P(A∩B)=361 (only the case (6,2))
P(A∣B)=365361=51
The Law of Total Probability
Definition of the Law of Total Probability
Definition
A definition is a precise description of what a concept, a term, or an object means. Understanding definitions is the foundation of learning any field, and every concept has its own exact meaning.
Law of Total Probability
Let A1,A2,…,An be a partition of the sample space Ω (that is, Ai∩Aj=∅ for i=j, and A1∪A2∪⋯∪An=Ω), and let P(Ai)>0 for i=1,2,…,n. Then for any event B:
P(B)=∑i=1nP(Ai)P(B∣Ai)
Intuitive Understanding of the Law of Total Probability
Understanding: the law of total probability decomposes the probability of a complex event B into a weighted sum of the probabilities of occurrence under different conditions. It embodies the idea of “divide and conquer”.
Proof of the Law of Total Probability
Proof:
B=B∩Ω=B∩(A1∪A2∪⋯∪An)
=(B∩A1)∪(B∩A2)∪⋯∪(B∩An)
Since A1,A2,…,An are pairwise mutually exclusive, (B∩A1),(B∩A2),…,(B∩An) are also pairwise mutually exclusive
Therefore P(B)=∑i=1nP(B∩Ai)
By the multiplication formula, P(B∩Ai)=P(Ai)P(B∣Ai)
Hence P(B)=∑i=1nP(Ai)P(B∣Ai)
Example of the Law of Total Probability
Example 3: there are three boxes containing 2, 3, and 5 balls respectively; one box is chosen at random and one ball is drawn from it
Let Ai={box i is chosen}, i=1,2,3
Let B={a white ball is drawn}
P(A1)=P(A2)=P(A3)=31
Suppose box 1 contains only white balls, box 2 contains only white balls, and box 3 contains 3 white and 2 black balls
P(B∣A1)=1, P(B∣A2)=1, P(B∣A3)=53
P(B)=31×1+31×1+31×53=31+31+51=1511
Bayes’ Formula
Definition of Bayes’ Formula
Definition
A definition is a precise description of what a concept, a term, or an object means. Understanding definitions is the foundation of learning any field, and every concept has its own exact meaning.
Bayes' Formula
Under the conditions of the law of total probability, for any event B with P(B)>0:
P(Ai∣B)=∑j=1nP(Aj)P(B∣Aj)P(Ai)P(B∣Ai)
Intuitive Understanding of Bayes’ Formula
Understanding: Bayes’ formula is used to compute the probability that event Ai occurs given that event B has occurred. It embodies the idea of “inverse probability”, that is, inferring the cause from the result.
Proof of Bayes’ Formula
Proof:
By the definition of conditional probability, P(Ai∣B)=P(B)P(Ai∩B)
By the multiplication formula, P(Ai∩B)=P(Ai)P(B∣Ai)
By the law of total probability, P(B)=∑j=1nP(Aj)P(B∣Aj)
Example 4: continuing the problem of Example 3, find the probability that the ball comes from box 3 given that a white ball is drawn
P(A3∣B)=P(B)P(A3)P(B∣A3)
=151131×53=151151=113
Example 5: the products of a factory are produced by three workshops. The first workshop produces 40%, the second 35%, and the third 25%. The defective rate is 2% in the first workshop, 1% in the second, and 3% in the third. One product is drawn at random and is found to be defective. Find the probability that it comes from the first workshop.
Solution:
Let Ai={the product comes from the i-th workshop}, i=1,2,3
A definition is a precise description of what a concept, a term, or an object means. Understanding definitions is the foundation of learning any field, and every concept has its own exact meaning.
Independence of Events
If events A and B satisfy:
P(A∩B)=P(A)P(B)
then events A and B are said to be independent.
Equivalent Condition for Independence of Events
Equivalent condition: events A and B are independent if and only if:
P(A∣B)=P(A)orP(B∣A)=P(B)
Properties of Independence of Events
Property 1: if A and B are independent, then A and B are independent, A and B are independent, and A and B are independent.
Property 2: if A and B are independent and P(B)>0, then P(A∣B)=P(A).
Property 3: the impossible event is independent of any event.
Independence of Several Events
Definition
A definition is a precise description of what a concept, a term, or an object means. Understanding definitions is the foundation of learning any field, and every concept has its own exact meaning.
Mutual Independence
Events A1,A2,…,An are said to be mutually independent if for any k events Ai1,Ai2,…,Aik:
P(Ai1∩Ai2∩⋯∩Aik)=P(Ai1)P(Ai2)…P(Aik)
Example of Independence
Example 6: rolling two dice
Let A={the first die shows 6}
Let B={the second die shows 6}
P(A)=61, P(B)=61
P(A∩B)=361=61×61=P(A)P(B)
Therefore A and B are independent
Exercises
Exercise 1
Given P(A)=0.3,P(B∣A)=0.5, find P(A∩B).
conditional probabilitymultiplication formulaintersection probability
Approach:
Compute with the multiplication formula.
Steps:
P(A∩B)=P(A)P(B∣A)
=0.3×0.5=0.15
Here we multiply by the probability P(A)=0.3 that A has already occurred, while P(B∣A) is meaningful only under the condition that A occurs.
Answer: P(A∩B)=0.15, that is, the probability that events A and B occur together is 0.15.
Exercise 2
There are three boxes containing 2, 3, and 5 balls respectively; one box is chosen at random and one ball is drawn from it. Find the probability that the ball comes from box 3 given that a white ball is drawn (box 3 contains 3 white and 2 black balls, and the others contain only white balls).
Bayes' formulalaw of total probabilityconditional probability
Approach:
Compute with Bayes’ formula.
Steps:
Let Ai={box i is chosen}, i=1,2,3
Let B={a white ball is drawn}
P(A1)=P(A2)=P(A3)=31
P(B∣A1)=1, P(B∣A2)=1, P(B∣A3)=53
P(B)=31×1+31×1+31×53=1511
P(A3∣B)=P(B)P(A3)P(B∣A3)=151131×53=113
Answer: 113
Exercise 3
Given P(A)=0.6,P(B)=0.5,P(A∩B)=0.3, determine whether A and B are independent.
independence of eventsindependence criterionconditional probability
Approach:
Check whether the condition for independence is satisfied.
Steps:
P(A)P(B)=0.6×0.5=0.3
P(A∩B)=0.3
Therefore P(A∩B)=P(A)P(B)
Hence A and B are independent
Answer: A and B are independent
Exercise 4
The products of a factory are produced by two workshops. The first workshop produces 60% and the second 40%. The defective rate is 1% in the first workshop and 2% in the second. One product is drawn at random and is found to be defective. Find the probability that it comes from the first workshop.
Bayes' formulalaw of total probabilityconditional probability
Approach:
Compute with Bayes’ formula.
Steps:
Let A1={the product comes from the first workshop}, A2={the product comes from the second workshop}
Let B={the product is defective}
P(A1)=0.6, P(A2)=0.4
P(B∣A1)=0.01, P(B∣A2)=0.02
P(B)=0.6×0.01+0.4×0.02=0.006+0.008=0.014
P(A1∣B)=0.0140.6×0.01=0.0140.006=73
Answer: 73
Exercise 5
Roll two dice. Let A={the first die shows an even number} and B={the sum of the two dice is 7}. Determine whether A and B are independent.
independence of eventsprobability calculationdetermination
Approach:
Compute the relevant probabilities and check independence.