STAT 112 Session 1B - M
STAT 112 Session 1B - M
STAT 112 Session 1B - M
STAT 112 1 / 33
Session Outline
STAT 112 2 / 33
Session Overview
STAT 112 3 / 33
Learning Outcomes
STAT 112 4 / 33
Conditional Probability
STAT 112 5 / 33
Conditional Probability Cont’d.
P (A ∩ B )
P (B |A ) = , where P (A ) > 0.
P (A )
P (A1 ∩ A2 ∩ A3 ∩ · · · ∩ An )
= P (A1 )P (A2 |A1 )P (A3 |A1 , A2 )P (A4 |A1 , A2 , A3 ) . . . P (An |A1 , A2 , . . . , An−1 )
The above formula is known as Multiplication Rule.
STAT 112 6 / 33
Example 1
A survey of attitudes about one’s job yields the data in the following table
A person from this group is selected at random. Given that the selected
person is a bus driver, find the probability that he or she is happy.
STAT 112 7 / 33
Example Cont’d: Solution
Let H denote the event that a person is happy and B, the event that a bus
driver is selected. The required probability is P (H |B )
STAT 112 8 / 33
Example 2
STAT 112 9 / 33
Solution
=⇒ P (R ) = P (R ∩ A ) + P (R ∩ B )
Using the multiplication formula, we have:
P (R ∩ A ) = P (R |A )P (A )
Given that 3 of the 8 boxes are of type A, P (A ) = 38 .
Next, type A box contains 7 marbles, of which 4 are red.
STAT 112 10 / 33
Solution Cont’d.
i Continued:
Therefore, the conditional probability is; P (R |A ) = 47 .
By the multiplicative rule,
4 3 3
P (R ∩ A ) = P (R |A )P (A ) = × = .
7 8 14
5 4 2
However, P (B ) = 8 and P (R |B ) = 6 = 3 and multiplicative rule yield
the result;
2 5 5
P (R ∩ B ) = P (R |B )P (B ) = × = .
3 8 12
3 5
∴ P (R ) = P (R ∩ A ) + P (R ∩ B ) = + = 0.63
14 12
STAT 112 11 / 33
Solution
P (A ∩ R ) 0.21
P (A |R ) = = = 0.33
P (R ) 0.63
From (i) above.
STAT 112 12 / 33
Independents Events
Two events, A and B that are related in such a way that the
occurrence of either one has no bearing on the occurrence of the
other are said to be independent.
For instance, if a coin is tossed repeatedly, the result of one toss does
not affect the result of any other toss.
P (A ∩ B ) = P (A ) × P (B ).
STAT 112 13 / 33
Independent Events Cont’d.
P (A |B ) = P (A ) and P (B |A ) = P (B ).
STAT 112 14 / 33
Example 3
Solution:
For events A, B, C to be independent then, the conditions stated above
must hold
A ∩ B = {1} =⇒ P (A ∩ B ) = 14
A ∩ C = {1} =⇒ P (A ∩ C ) = 41
B ∩ C = {1} =⇒ P (B ∩ C ) = 14
2 2 1
1 P (A ∩ B ) = P (A ) × P (B ) = 4 × 4 = 4
2 2 1
2 P (A ∩ C ) = P (A ) × P (C ) = 4 × 4 = 4
2 2 1
3 P (B ∩ C ) = P (B ) × P (C ) = 4 × 4 = 4
STAT 112 15 / 33
Solution Cont’d.
1
Also; A ∩ B ∩ C = {1} =⇒ P (A ∩ B ∩ C ) = 4
2 2 2 1
But P (A ) × P (B ) × P (C ) = 4 · 4 · 4 = 8 , P (A ∩ B ∩ C ).
STAT 112 16 / 33
Theorem 3:
STAT 112 17 / 33
Total Probability Rule
Figure: 1
STAT 112 18 / 33
Total Probability Rule Cont’d
Then
n
X
P (B ) = P (B |Ai )P (Ai ), where P (Ai ) > 0.
i =1
B = (B ∩ A1 ) ∪ (B ∩ A2 ) ∪ (B ∩ A3 ) ∪ · · · ∪ (B ∩ An )
P (B ) = P (B ∩ A1 ) + P (B ∩ A2 ) + P (B ∩ A3 ) + · · · + (B ∩ An )
n
X
⇒ P (B ) = P (B ∩ Ai )
i =1
STAT 112 19 / 33
Total Probability Rule (Cont..)
And the;
P (B ∩ Ai )
P ( B |A i ) = , where P (Ai ) > 0
P (Ai )
Therefore
n
X
P (B ) = P (B |Ai )P (Ai ) (1)
i =1
STAT 112 20 / 33
Bayes’ Theorem
P (Ai )P (B |Ai )
P (Ai |B ) =
P (A1 )P (B |A1 ) + P (A2 )P (B |A2 ) + · · · + P (An )P (B |An )
Sketch Proof:
Now,
P (Ai ∩ B )
P (Ai |B ) = , where P (B ) > 0
P (B )
P (B ∩ Ai )
Also, P (B |Ai ) = , where P (Ai ) > 0
P (Ai )
⇒ P (B ∩ Ai ) = P (B |Ai )P (Ai ).
STAT 112 21 / 33
Bayes’ Theorem Cont’d.
Hence,
P (B |Ai )P (Ai )
P (Ai |B ) = Pn (2)
i =1 P (B |Ai )P (Ai )
Equations (1) and (2) are known as Total Probability Rule and Bayes’
Theorem, respectively.
STAT 112 22 / 33
Example 1:
STAT 112 23 / 33
Solution
(a) Let B be the event that the relay is defective, and let Ai be the
event that the relay is manufactured by plant i , where(i = 1, 2, 3). The
desired probability is P (B ).
Therefore, we have
P3
P (B ) = i =1 P (B |Ai )P (Ai )
STAT 112 24 / 33
Example 2:
It is estimated that 50% of emails are spam emails. Some software has
been applied to filter these spam emails before they reach your inbox.
A certain brand of software claims that it can detect 99% of spam emails,
and the probability for a false positive (a non-spam email detected as
spam) is 5%.
Now if an email is detected as spam, then what is the probability that it is
in fact a non-spam email?
STAT 112 25 / 33
Example 2:
It is estimated that 50% of emails are spam emails. Some software has
been applied to filter these spam emails before they reach your inbox.
A certain brand of software claims that it can detect 99% of spam emails,
and the probability for a false positive (a non-spam email detected as
spam) is 5%.
Now if an email is detected as spam, then what is the probability that it is
in fact a non-spam email?
Solution:
Let define the following events:
A = event that an email is detected as spam,
B =event that an email is spam,
B̄ = event that an email is not spam.
STAT 112 25 / 33
Solution Cont’d.
P (A |B̄ )P (B̄ )
P (B̄ |A ) =
P (A |B )P (B ) + P (A |B̄ )P (B̄ )
0.05 × 0.5
= = 0.048
0.99 × 0.5 + 0.05 × 0.5
STAT 112 26 / 33
Example 3:
Suppose we have 3 cards identical in form except that both sides of the
first card are coloured red, both sides of the second card are coloured
black, and one side of the third card is coloured red and the other side is
coloured black.The 3 cards are mixed up in a hat, and 1 card is randomly
selected and put down on the ground.
If the upper side of the chosen card is coloured red, what is the probability
that the other side is coloured black?
STAT 112 27 / 33
Example 3:
Suppose we have 3 cards identical in form except that both sides of the
first card are coloured red, both sides of the second card are coloured
black, and one side of the third card is coloured red and the other side is
coloured black.The 3 cards are mixed up in a hat, and 1 card is randomly
selected and put down on the ground.
If the upper side of the chosen card is coloured red, what is the probability
that the other side is coloured black?
Solution:
Let RR, BB, and RB denote, respectively, the events that the chosen card
is the red-red, the black-black, or the red-black card. Letting R be the
event that the upturned side of the chosen card is red, we have that the
desired probability is obtained by
P (RB ∩ R )
P (RB |R ) =
P (R )
STAT 112 27 / 33
Solution Cont’d.
P (R |RB )P (RB )
P (RB |R ) =
P (R |RB )P (RB ) + P (R |RR )P (RR ) + P (R |BB )P (BB )
1 1
2 · 3 1
= 1 1 1 1
= .
2 · 3 +1· 3 +0· 3
3
Note that there were 3 black sides and 3 red sides, yielding the
P (RB ) = 13 = P (RR ) = P (BB )
STAT 112 28 / 33
Example 4:
STAT 112 29 / 33
Example 4:
Solution:
Let M1 , M2 , M3 denote the sets of products produced by three machines of
the company, respectively. Let D denote the event that an item is
′
defective. The required probability is P [(M1 |D ) ].
STAT 112 29 / 33
Solution Cont’d.
P (D |M1 )P (M1 )
P (M1 |D ) =
P (D |M1 )P (M1 ) + P (D |M2 )P (M2 ) + P (D |M3 )P (M3 )
(0.02)(0.30)
=
(0.02)(0.30) + (0.03)(0.25) + (0.04)(0.45)
= 0.19
′
∴ P [(M1 |D ) ] = 1 − P (M1 |D ) = 0.81
STAT 112 30 / 33
Trial Questions:
STAT 112 31 / 33
Trial Questions:
STAT 112 32 / 33
End of Session
THANK YOU!!!
STAT 112 33 / 33