Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
STAT 111
Chapter three
Conditional Probability and
Independence
1
Conditional Probability
The probability of an event A occurring when it is known that some
event A has occurred is called a conditional probability and is
denoted by P(A\B). The symbol P(A\B) is usually read The
probability that A occurs given that B occurs or simply The
probability of A given B.
Definition The conditional probability of A, given B, denoted by P(A\B),
is defined
P( A B)
P( A \ B)
P( B)
if P( B) 0
Example 1
A coin is flipped twice. What is the conditional probability that both flips
result in heads, given that the first flip does?
S = {HH, HT, TH, TT} , n(S) = 4
Let A: the event both flips result in heads A= {HH} , n(A) = 1
B: the event the first flip results in head B ={ HH ,HT}, n(B) = 2
A ∩ B = { HH}, n(A ∩ B ) = 1
P (A ∩ B ) = 1 / 4
P(B)=2/4
P (A \ B ) =P (A ∩ B ) /P ( B ) = 1/2
Example 2
A
AC
total
B
1/4
1/12
1/3
BC
1/4
5/12
2/3
total
1/2
1/2
1
Let A and B be events with P(A)=1/2,and P(B)=1/3,
and P(A ∩ BC)=1/4. Find
1. P(A\B)
P(A ∩ B)=P(A)- P(A ∩ BC)=1/2-1/4=1/4 (or from table)
P(A\B)= P(A ∩ B)/P(B)=(1/4)/(1/3)=3/4
2. P(B\A)
P(B\A)= P(A ∩ B)/P(A)=(1/4)/(1/2)=2/4
3. P(BC|AC)=P(AC ∩ BC)/ P(AC)=(5/12)/(1/2)=5/6
Example 3
In a certain college, 25% of the students failed Mathematics, 15% of the
students failed chemistry and 10% of the students failed both mathematics
and chemistry. A student is selected at random, find
1. If he failed chemistry, what is the probability that he failed Mathematics?
P(M)=0.25, P(C)=0.15, P(M∩C)=0.1
PM C
2.
PM C 0.1
0.67
PC
0.15
If the failed mathematics, what is the probability he failed chemistry?
PC M
PC M 0.1
0.4
PM
0.25
5
Example 4
If A and B are disjoint events and P(B)>0,
What is the value of P(A\B)?
A and B are disjoint
P(A ∩ B)=0
P(A \ B) = P(A ∩ B)/P(B)=0/P(B)=0
6
P(.\B) is a Probability
Conditional probabilities satisfy all of the properties of ordinary
probabilities. This is proved by the following proposition, which
shows that P(A\B) satisfies the definition of probability.
Proposition
(a) 0 ≤ P(A \ B) ≤ 1
(b)P(S\B)=1
(c) If A1, A2 ,… are mutually disjoint sets in S , then
7
Notes
Note that for any event A and B where P(B)>0
P(Φ \B)= 0
P(AC\B)=1-P(A\B)
P(A\B)=P(A∩C\B)+P(A∩Cc\B)
P(AUC\B)=P(A\B)+P(C\B)-P(A∩C\B)
If A C then P(A|B)≤ P(C\B).
8
Independence
As stated in chapter 2, two events A and B are independent if the
occurrence or nonoccurrence of either of them has no relation to the
occurrence or nonoccurrence of the other, that is the probability that
both A and B will occur is equal to the product of their individual
probabilities which implies P(A ∩ B) = P(A)P(B)
Theorem
If A and B are independent, then,
P(A \ B) =P(A)
if P(B)>0
and
P(B \ A)=P(B)
if P(A)\>0
9
Example
Given P(A)=0.5, and P(A U B)=0.6, find P(B \ A) if
1.
A and B are independent
PB A
P A B P APB
PB
P A
P A
P(AUB ) = P(A) + P(B)- P(A∩ B) = P(A) + P(B)- P(A)P(B)
P(AUB ) = P(A) + P(B)(1- P(A))
0.6=0.5+0.5P(B)
P(B)=0.2
P(B \ A)= P(B)=0.2
2. A and B are disjoint
A and B are disjoint
P (A ∩ B)=0
P(B \ A)= 0
10
Multiplicative Rules
As previously defined, the conditional probability of A given B is
P(A \ B) = P (A ∩ B)/P ( B ) if P (B) > 0
From which
P(A∩B)=P(B)P(A\B)
This is called the multiplicative rule which helps to calculate the probability that
two events will both occur. This rule is often used when the two events A
and B are not independent. A generalization of the multiplicative rule
which provides an expression for the probability of the intersection of an
arbitrary number of events, is the following
P(A1∩ A2…An)=P(A1)P(A2\ A1)P(A3 \ A1 ∩ A2 )…P(An \ A1 ∩… An-1)
11
Example 1
Suppose that a fuse ()صمامه كهربائيةbox containing 20 fuses, of which 5
are defective. If 2 fuses are selected at random and removed from
the box in succession ( ) متتابعةwithout replacing the first, what is the
probability that both fuses are defective?
first fuse is defective
A2 second fuse is defective
P(A1∩ A2)=P(A1)P(A2\ A1)=5/20 x 4/19 =1/19
A1
Or using counting
C25
1
20
C2
19
12
Example 2
One bag contains 4 white balls and 3 black balls, and a
second bag contains 3 white balls and 5 black balls. One
ball is drawn form the first bag and placed unseen in the
second bag. What is the probability that a ball now
drawn from the second bag is black?
B1 drawing a black ball from bag 1
B2 drawing a black ball from bag 2
W1 drawing a white ball from bag 1
P ( B 2) = P ( B2 ∩ B1) + P ( B2 ∩ W1)
= P (B1)P(B2\ B1 ) + P (W1) P (B2 \ W1)
=3/7 x 6/9 + 4/7 x 5/9 =0.6
13
Bayes' Theorem
Let S denote the sample spacek of some experiment, and consider k events
A1, A2,..., Ak are disjoint and A i S . It is said that these events form a
i 1
partition of S.
If the k events A1, A2,..., Ak form a partition of S and if B is any other event in S,
then the events A1 ∩ B,A2 ∩ B,..,,Ak ∩ B will form a partition of B,
Hence, we can write B = (A1∩B)U(A2∩B)U… U (Ak∩B)
Furthermore, since the k events on the right side of this equation are disjoint,
k
PB P Ai B
i 1
Finally, if P(Ai)>0 for i=1 ,2,...,k then P(Ai∩B)=P(Ai)P(B\Ai ) and it follows that
PB P Ai PB Ai
k
i 1
14
Bayes' Theorem
Bayes' Theorem Let the events A1, A2,..., Ak
form a partition of the space S such
that P(Aj)>0, for j=1,..,k,
and let B be any event such that P(B)>0.
Then, for j=1,..., k,
Example 1
Three machines A, B and C produce respectively 60%, 30%, and 10% of the total number of items of a factory. The
percentages of defective output of these machines are respectively 2%, 3%, and 4%.
Solution:
Let D denote the output is defective, A denote item from machine A, B denote item from machine B
and C denote item from machine C.
P (A) =0.6
P (B) = 0.3
P (C ) = 0.1
P ( D \ A) =0.02
P ( D \ B) = 0.03
P (D \ C ) = 0.04
1. An item is selected at random and is found defective, what is the probability that the item was
produced by machine C.
PD P A D PB D PC D
PD AP A PD B PB PD C PC
0.6 x 0.02 .3 x 0.03 0.1 x 0.04 0.025
PC \ D
PC D 0.004
0.16
P D
0.025
2. An item is selected at random and is found defective, what is the probability that the item was
produced by machine C or B.
PC B \ D PC \ D PB \ D
P B D
P D
0.09
0.16
0.52
0.025
0.16
3.
An item is selected at random and is found defective, what is the probability that the item was not
produced by machine C.
P C c \ D 1 PC \ D 1 0.16 0.84
Example 2
Three cooks, A, B and C bake a special kind of cake, and with
respective probabilities 0.02, 0.03, and 0.05 it fails to rise. In the
restaurant where they work, A bake 50 percent of these cakes, B 30
percent and C 20 percent. What proportion of failures is caused by A
{P(A|F)}?
Solution
Let F: that cake fail to rise
P(A)=0.5
P(B)= 0.3
P(C)=0.2
P(F|A)=0.02
P(F|B)=0.03
P(F|C)=0.05
P(F) P(A F) P(B F) P(C F)
P(A)P F A P(B)P F B P(C)P F C
0.5 x 0.02 0.3 x 0.03 0.2x0.05 0.029
PA F 0.01
PA F
0.3448
PF
0.029
Note
Note that if P(A1),....,P(Ak) are not given
then we assume that these events are
equally likely each P(Ai) = 1/k