Prob - Lecture 3 - Conditional Probability (1)
Prob - Lecture 3 - Conditional Probability (1)
Lecture 3 -
Conditional Probability
Slides by John Wiley & Sons, Inc. Applied Statistics and Probability for Engineers, by
Montgomery and Runger.
Fall 2024
October, 11-18
Content
3 Conditional
Probability
v Conditional Probability
v Multiplication & Total Probability Rules
v Chain Rule
v Bayes’ Theorem
v Independence
1
Learning Objectives for Lecture 3
After careful study of this lecture, you should be
able to do the following:
1. Interpret and calculate conditional probabilities of
events.
2. Use Counting Techniques with Conditional
Probability.
3. Determine the independence of events and use
independence to calculate probabilities.
4. Use Bayes’ theorem to calculate conditional
probabilities.
5. Extend conditional probability case to multiple
events.
6. Realize the importance of computer simulations
for probability.
2
Random Experiment
Event combinations
v The union of two events consists of all outcomes that are
contained in either of the two events, denoted as 𝐸1 ∪ 𝐸2.
v The intersection of two events is the event that consists of
all outcomes that are contained in both of the two events,
denoted as 𝐸1 ∩ 𝐸2.
v The complement of an event in a sample space is the set
of outcomes in the sample space that are not in the event.
We denote the complement of the event 𝐸 as 𝐸! 𝑜𝑟𝐸" .
7
Example 2.6 | Events
9
Venn Diagrams
Venn Diagrams: We can use Venn Diagrams to
represent a sample space of the random experiment
and events in a sample space.
11
Mutually Exclusive Events - Laws
v The definition of the complement of an event
implies that 𝐸 ! ! = 𝐸
14
Example 2.9 | Web Site Design
n!= n×(n−1)×(n−2)×...×2×1
Linear Permutation
16
Counting Techniques: Permutations
Permutations of Subsets
The number of permutations of subsets of r elements
selected from a set of n different elements is
!!
# = !"! ! #$"! ! %$&&&"! ! " + #$ =
"
!
"! ! " $!
4 4 4!
𝐶3 = 3 =3! 463 !
28
Example 2.19 | Semiconductor Wafers
Joint Events: A wafer is randomly selected from
a batch of 940 wafers in a semiconductor
manufacturing process.
vLet H denote the event that the wafer contains
high levels of contamination
• Then P(H) = 358/940.
vLet C denote the event of the wafer is in center of
a sputtering tool
• Then P(C) = 626/940.
)*;T$3*#<*=<6**8
!*#$T>3#T$3*# 6*$T8
!"#$"% C'E"
)*H ,-. L0 ,01
23E4 --1 1.L 5,0
6*$T8 L1L 5-. 9.:
29
Example 2.19 | Semiconductor Wafers
Probability of a Union
𝑃 𝐴∪𝐵 = 𝑃 𝐴 + 𝑃 𝐵 −𝑃 𝐴∩𝐵
31
Addition Rule – Multiple Events
Probability of a Union
𝑃 𝐴∪𝐵∪𝐶 = 𝑃 𝐴 + 𝑃 𝐵 + 𝑃 𝐶 −𝑃 𝐴∩𝐵
− 𝑃 𝐴 ∩ 𝐶 −𝑃 𝐵 ∩ 𝐶 + 𝑃 𝐴 ∩ 𝐵 ∩ 𝐶
!(#∩%)
𝑃 A|B = for 𝑃 𝐵 >0
!(%)
10
𝑃(𝐷 ∩ 𝐹) 400 10
𝑃 D|𝐹 = = =
𝑃(𝐹) 40 40
400
𝑃(𝐷) = 28/400 𝑃(𝐹) = 40/400
𝑃 D|𝐹 = 10/40 𝑃 F|𝐷 = 10/28
𝑃 D’|𝐹 = 30/40 P F’|𝐷 = 18/28
𝑃 D|𝐹′ = 18/360 𝑃 F|𝐷′ = 30/372
𝑃 D’|𝐹′ = 342/360 𝑃 F’|𝐷′ = 342/372 36
Example 2.23 | Surface Flaws &
Defectives –Tree Diagram
Sampling without Replacement: The tree diagram
illustrates sampling two parts without replacement:
v At the 1st stage (surface flaw), every original part of
the 400 is equally likely.
v At the 2nd stage (defective), the probability is
conditional upon the part drawn in the prior (1st)
stage. /0?1"*5@6**A0<%)*B10))F#F"C
:;<#0$"*=10>)
!"#"$%F'" (")*+! , -.*+!" , /.%01
(")*+# , 23 24 54
-.*+#" , 63 675 685
/.%01 73 693 733
You Should
SWITCH !!!!
Try for the case where there are 100 doors, where Monty
Hall opens 98 doors and leaves you with only two choices. 45
Multiplication Rule
Multiplication Rule (Two Events)
v Definition of conditional probability:
)(+#∩+$)
𝑃(𝑋1 | 𝑋2) = )(+$)
v The conditional probability definition can be
rewritten to generalize it as the multiplication rule
which gives an alternative, more intuitive
formulation:
𝑃 𝑋1 ∩ 𝑋2 = 𝑃 𝑋1 𝑋2 . 𝑃 𝑋2 = 𝑃 𝑋2 𝑋1 . 𝑃(𝑋1)
Since we desire to
From the total probability rule: find the probability
of failing parts, we
𝑃 𝐹 = 𝑃 𝐹 𝐻 .𝑃 𝐻 + 𝑃 𝐹 𝑀 .𝑃 𝑀 + 𝑃 𝐹 𝐿 .𝑃 𝐿 only consider
= 𝑃(𝐹 ∩ H) + 𝑃(𝐹 ∩ M) + 𝑃(𝐹 ∩ L) 𝑃(𝐹 ∩ H), 𝑃(𝐹 ∩ M)
and 𝑃(𝐹 ∩ L).
= 0.02 + 0.003 + 0.0005 =0.0235
What is the probability that a chip does not fail? 54
Independence - Two Events
v Two events are statistically
independent if any one of the
following equivalent statements B
are true:
1. P(B|A) = P(B)
A
2. P(A|B) = P(A)
3. P(A∩ B) = P(A). P(B)
A B
vThis means that occurrence of one
event has no impact on the occurrence
of the other event.
• If P B A = P B , then the outcome of the
experiment is in event A does not affect the
probability that the outcome is in event B.
• Can A and B happen at the same time? Can
you give some examples? 55
Example 2-29| Sampling with
Replacement
Sampling with Replacement: A production lot of 50
parts contains 3 defectives. Two parts are selected at
random, but the first is replaced before selecting the 2nd.
v A: The event that the 1st part selected is defective.
𝑃(𝐴) = 3/50
+, +.
P(D|F)= 0.25 ≠ 𝑃(𝐷) = -.. = 0.07 P(D|F)=0.05= 𝑃(𝐷) = -.. = 0.05
𝑃 𝐸% ∩ 𝐸$ = 𝑃 𝐸% ∗ 𝑃[𝐸$ ]
𝑃 𝐸% ∩ 𝐸0 = 𝑃 𝐸% ∗ 𝑃 𝐸0
⋮
𝑃 𝐸$ ∩ 𝐸0 = 𝑃 𝐸$ ∗ 𝑃[𝐸0 ]
𝑃 𝐸$ ∩ 𝐸1 = 𝑃 𝐸$ ∗ 𝑃[𝐸1 ]
⋮ 60
Example 2-33| Semiconductor Wafers
𝐴 𝐵
𝐵
𝑃 𝐴 𝑎𝑛𝑑 𝐵 = 𝑃 𝐴 ∩ 𝐵 Let T & B denote the events that
= 𝑃 𝐴 . 𝑃 𝐵 = 0.8 . 0.9 the top and bottom devices operate.
There is a path if at least one of
A & 𝐵 𝑎𝑟𝑒 𝑖𝑛𝑑𝑒𝑝𝑒𝑛𝑑𝑒𝑛𝑡 them operates 𝑃(𝑇 𝑜𝑟 𝐵) = 𝑃(𝑇 ∪
Since there is a path if 𝐵) = 1 − 𝑃 𝑇 ∪ 𝐵 ! = 1 − 𝑃(𝑇 ! ∩ 𝐵! ) =
both operate, P(Circuit 1 − (𝑃 𝑇 ! . 𝑃(𝐵! ) = 1 − 0.05+ = 0.9975.
operates)= 0.72.
T & 𝐵 𝑎𝑟𝑒 𝑖𝑛𝑑𝑒𝑝𝑒𝑛𝑑𝑒𝑛𝑡 62
Example 2-35|Advanced Circuit
Independence Test (Multiple Events): A series of parallel
circuits: This circuit operates only if there is a path of
functional devices from left to right. The probability that
each device functions is shown. Each device fails
independently. What is the probability that the circuit
operates?
𝑅
Events L, M
𝑀 and R are
𝐿 independent.
Partition the graph into 3 columns with L, M and R.
P(L) = 1- 0.13, P(M) =1- 0.52, and P(R)= 0.99.
P(The circuit operates) = 𝑃 𝐿 ∩ 𝑀 ∩ 𝑅 =P(L).P(M).P(R)
= (1 – 0.13).(1-0.052).(0.99) = 0.9875 63
Independent Events via Venn Diagram
P(S) = 1
P(A and B) = P(A∩B) = P(A).P(B) = 0.2
P(A and B’ ) = P(A∩B’ ) = 0.2
P(A’ and B) = P(A’∩B) = 0.3
P(A or B)’ = P(A∪B)’ = 1- (0.2+0.2+0.3) = 0.3
) 2∩3 4.$
P(A conditioned on B) = P(A|B) = )(3)
= 4.6 64
Conditional Independence
v A and B are conditionally independent given that C occurs:
𝑃 𝐴∩𝐵 𝐶 =𝑃 𝐴 𝐶 ⋅𝑃 𝐵 𝐶
§ Example: A is the height of a child, and B is the number of words
that the child knows. It seems that when A is high, B is high, too.
The height and the number of words known by the kid are NOT
independent, but they are conditionally independent if you
provide the kid’s age (C).
§ However, independent events can become dependent after
conditioning as well.
v Which of the following is conditionally independent? à (a)
In Figure (b), when B happens, A and C cannot happen at the same
time which means if C occurs, then A cannot occur.
𝐴 𝐶
𝐴 𝐵
S
𝐶 𝐵
65
(a) (b)
Bayes’ Theorem
𝑃 𝐹 = 𝑃 𝐹 𝐻 . 𝑃 𝐻 + 𝑃 𝐹 𝐻! . 𝑃(H’)
= 0.10 . (0.2) + (0.0050. (0.8) = 0.024 68
Example 2-37| Medical Diagnostic
D and D’ are
D: The event that you have the disease mutually
S: The event that the test signals positive exclusive events.
Figure 2-13 Conditional probability of rejection for parts with surface flaws
and for parts without surface flaws. The probability of a defective part is
not evenly distributed. Flawed parts are five times more likely to be
defective than non-flawed parts, i.e., P(D|F) / P(D|F’).
77
The “Monty Hall Problem”: Solution
v We want to calculate:
P(1|MH opens 2) = probability the prize is behind
door 1 and MH opens door 2.
P(3|MH opens 2) = probability the prize is behind
door 3 and MH opens door 2
v P(A|MH opens 2) = probability the prize is behind
door 1 and MH opens door 2
P(1|MH opens 2) = P(MH opens 2|1)*P(1)/P(MH
opens 2)
P(3|MH opens 2) = probability the prize is behind
door 3 and MH opens door 3
P(3|MH opens 2) = P(MH opens 2|3)*P(3)/P(MH
opens 2)
78
The “Monty Hall Problem”: Solution
v Apriori, the prize can be behind doors 1, 2, 3 with equal
probability: P(1)=P(2)=P(3)=1/3
We need to calculate the probability that MH opens door 2:
P(MH opens 2)=P(MH opens 2|1)*P(1)+P(MH opens 2|2)*P(2) + P(MH
opens 2|3)*P(3)
v We can calculate the likelihoods assuming you’ve chosen door 1:
The probability that MH opens door 2 if the prize is behind door 2:
P(MH opens 2|2) = 0 (game would be over, no fun!)
The probability that MH opens door 2 if the prize is behind door 1:
P(MH opens 2|1) = 1/2 (could have opened 2 or 1)
The probability that MH opens door 2 if the prize is behind door 1:
P(MH opens 2|3) = 1 (no other choice door 1 is already picked, 3
gives game away)
P(MH opens 2)=1/3*1/2 +1/3*0+1/3*1=1/6+1/3=1/2
You Should
P(A|MH opens B) = (1/3*1/2)/(1/2)=1/3
SWITCH !!!!
P(C|MH opens B) = (1/3*1)/(1/2)=2/3
79