0% found this document useful (0 votes)
17 views69 pages

Lec3 - Conditional Probability

1) The probability that the first ball is red given the second ball is green is 3/7. 2) We calculate the conditional probability P(A|B) as P(A intersection B) / P(B). 3) Here, P(first ball red intersection second ball green) is 15/56 and P(second ball green) is 35/56.

Uploaded by

ahmed kaed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views69 pages

Lec3 - Conditional Probability

1) The probability that the first ball is red given the second ball is green is 3/7. 2) We calculate the conditional probability P(A|B) as P(A intersection B) / P(B). 3) Here, P(first ball red intersection second ball green) is 15/56 and P(second ball green) is 35/56.

Uploaded by

ahmed kaed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 69

1

Previous lecture
2

Sample space
This is denoted with an S and is a set Each element
whose elements are all the possibilities of S is called
that can occur an outcome.

A probability of an outcome is a number and


has two properties:

1. The probability assigned to each outcome is nonnegative.

2. The sum of all the probabilities equals 1.


ADDITION RULE 3

For any two events E and F,

P (E F ) = P (E ) + P (F ) – P (E F )
Let's look at a Venn Diagram to see
why this is true:
If we count E

EE FF

and then count F,

we've counted the things in both twice so we


subtract off the intersection (things in both).
4

ADDITION RULE for Mutually


Exclusive Events
If E and F are mutually exclusive events,

P (E F ) = P (E ) + P (F )
Mutually exclusive means the events are disjoint.

This means E  F = 

Let's look at a Venn Diagram to see why this is true:

You can see that since there are


E F not outcomes in common, we
won't be counting anything twice.
5
This is read "E complement" and is the set of
E all elements in the sample space that are not
in E

Remembering our second property of probability, "The sum of all the


probabilities equals 1" we can determine that:

PE  PE 1
This is more often used in the form

P  E   1 P  E 
If we know the probability of rain is 20% or 0.2 then the
probability of the complement (no rain) is 1 - 0.2 = 0.8 or 80%
6

Summary

P (A )  1  P (A )

P ( A  B )  P (A  B )  P (A )  P (A  B )

A
B

P( A)  P(B)  P( A B)

P( A B)  P( A)  P(B) A, B Mutually exclusive


7

Conditional probability
Today lecture
8

introduction
Box contains 3 Red balls and 5 Green balls ,
2 balls are selected (without replacement-
one after another )
Find the probability that the second ball is
3 2 3
Red? P ( RR )    .
8 7 28

3 5 15
P ( RG )    .
8 7 56

5 3 15
P (GR )    .
8 7 56

5 4 10
P (GG )    .
8 7 28
9

introduction
the probability that the second ball is Red
3 15 21
P (2 nd _ Re d )    .
28 56 56

3 2 3
P ( RR )    .
8 7 28

3 5 15
P ( RG )    .
8 7 56

5 3 15
P (GR )    .
8 7 56

5 4 10
P (GG )    .
8 7 28
10

Conditional Probability
What is the probability of the second ball is
Red given that the first ball is Green?

3 2 3
P ( RR )    .
8 7 28

3 5 15
P ( RG )    .
8 7 56

5 3 15
P (GR )    .
8 7 56

5 4 10
P (GG )    .
8 7 28
11

Conditional Probability
What is the probability of the second ball is
Red given that the first ball is Green?
3
P (2nd Re d given 1stGreen )  .
7
3 2 3
P ( RR )    .
8 7 28

3 5 15
P ( RG )    .
8 7 56

5 3 15
P (GR )    .
8 7 56

5 4 10
P (GG )    .
8 7 28
12

Conditional Probability
The probability that the second ball is Red
given that the first ball is Green is called
conditional probability. A key words to
look for is “given.”

We will use the notation:


3
P(second Red| first Green) = 7
.
13

General Conditional
Probability

The probability that the event A occurs,


given that B occurs is denoted:

P ( A | B ).
This is read the probability of A given B.
14

Conditional Probability
How would we draw the event A given B?

A B
A
and
B
15

Conditional Probability
How would we draw the event A given B?
Since we know B has occurred, we ignore
everything else B.(B the new sample space)

A B
A
and
B
16

Conditional Probability
How would we draw the event A given B?
Since we know B has occurred, we ignore
everything else B.(B the new sample space)

A B
A
and
B
17

Conditional Probability
How would we draw the event A given B?
Since we know B has occurred, we ignore
everything else B.(B the new sample space)

A B
A
and
The rule: B

P( A  B)
P( A | B) 
P( B)
18

Rule of conditional probability


P( A  B)
P( A | B) 
P( B)
Similarly

P (A  B )
P (B | A ) 
P (A )
19

Example
Box contains 3 Red balls and 5 Green balls , 2
balls are selected (without replacement-one after
another ). Find the probability that the first ball is
Red given that the second ball is Green ?
3 2 3
P ( RR )    .
8 7 28

3 5 15
P ( RG )    .
8 7 56

5 3 15
P (GR )    .
8 7 56

5 4 10
P (GG )    .
8 7 28
Example 20

Find the probability that the first ball is Red given


that the second ball is Green ?
15 10 35 15
P (2G )    P (2G  1R ) 
56 28 56 56
15
P (2G  1R ) 56 3
P (1R | 2G )  
P (2G ) 35 7
56
3 2 3
P ( RR )    .
8 7 28

3 5 15
P ( RG )    .
8 7 56

5 3 15
P (GR )    .
8 7 56

5 4 10
P (GG )    .
8 7 28
21

Note
P( A  B)
P( A | B) 
P( B)

P (A  B )  P (A | B )P (B )

Similarly

P ( A  B )  P ( B | A) P ( A)
Therfore
P ( A | B) P( B)  P( B | A) P( A)
22

Example
If P ( A)  0.2 , P ( B )  0.3 , and P ( A | B)  0.4
Find
P( B | A)

P ( A | B) P( B)  P( B | A) P( A)
0.4  0.3  P( B | A)  0.2
0.4  0.3
P ( B | A)   0.6
0.2
23

Example
600 people were asked what is your opinion of “ something” . There
responses are indicated in the table

Yes(Y) No(N) Don’t know(D) total


Men(M) 162 95 23 280
Women(W) 256 45 19 320
total 418 140 42 600

Find the following

140 280
P( N )  P(M ) 
600 600
28

Example
Yes(Y) No(N) Don’t know(D) total
Men(M) 162 95 23 280
Women(W) 256 45 19 320
total 418 140 42 600
Find the following

320 45
P (W )  P( N | W ) 
600 320
280 162
P(M )  P (Y | M ) 
600 280
45 162
P( N  W )  P(M | Y ) 
600 418
25
Example: Rolling a two balanced dice.
If the sum is 6”. Find the probability
that the two numbers are different
26

E = the event that “the sum is 6”


={ (5, 1), (4, 2), (3, 3), (2, 4), (1, 5)}
27

If the sum is 6”. Find the probability that the two


numbers are different
E = the event that “the sum is 6”
={ (5, 1), (4, 2), (3, 3), (2, 4), (1, 5)}
F= the event that the two numbers are different
5
P( E )  P( F ) 
30 4
36 P( E  F ) 
36 36
P( E  F ) 4
P( F | E )  
p( E ) 5

Direct method
4
P ( diffrent | sum  6) 
5
Example 28

Given two boxes contain balls as follows


Box I Box II
Black(B) 4 3
White(W) 7 1
yellow 0 4

Select a box then select a ball .


Find the probability that a black ball is selected.

?
7
P( B) 
19
Example 29

Given two boxes contain balls as follows


Box I Box II
Black(B) 4 3
White(W) 7 1
yellow 0 4
Select a box then select a ball .
a)Find the probability that a black ball is selected.

1 4 1 3
P( B)    
2 11 2 8

2 3
P (B )    0.1988
11 16
Example 30

Given two boxes contain balls as follows


Box I Box II
Black(B) 4 3
White(W) 7 1
yellow 0 4
b)Find the probability that
the ball is yellow given that
it form box II .
.

4
P (Y | BoxII ) 
8
Example 31

Given two boxes contain balls as follows


Box I Box II
Black(B) 4 3
White(W) 7 1
yellow 0 4
C)Find the probability that
the ball form box II given that
The ball is Black.
.
P ( BoxII  B )
P ( BoxII | B ) 
P( B)
P (B | BoxII )P (BoxII )
P (BoxII | B ) 
P (B )
3 1

8 2 33
P ( BoxII | B )  
1 4 1 3 65
  
2 11 2 8
32

Example
Three machines A, B and C produce 60%, 30% and 10% of
the total number of items respectively. The percentages of
the defective outputs are 2%, 3% and 4%.
If an item is selected at random, find the probability that
a. The item is defective.
b. The item was produced from B, if it is defective.

Note
0.3 B
P (Def)  P (Def | A) P (A)
 P (Def | B) P (B)
 P (Def | C) P (C)

P (Def)  0.6  0.02  0.3 0.03  0.1 0.04  0.025


33

Example
b. The probability that the item was
produced from B, if it is defective.
P (Def)  0.025
P (B Def )
P (B | Def) 
P (Def) 0.3 B

P (Def | B) P (B)
P (B | Def) 
P (Def)
0.03  0.3 9
P (B | Def)  
0.025 25
BAYE’S theorem
If E1 , E2 , E3 are mutually exclusive E1 E2 E3
events and B is any event

P (B)  P (B E 1 )  P (B E 2 )  P (B E 3 ) B


P (B)  P (B | E1 )P (E1 )  P (B | E 2 )P (E 2 )
P (B | E3 )P (E3 )
3
P (B)   P (B | Ei )P (Ei )
i 1

n
In general P (B)   P (B | Ei )P (Ei )
i 1

P ( B | E1 ) P (E1 ) P (B | E1 )P (E1 )
P (E1 | B)   n
P (B )
 P (B | E
i 1
i ) P (E i )
35

Conditional Probability
:
Show that
. P ( A | A)  1
P ( A  A)
L.H .S  P ( A | A) 
P ( A)
P (A  A) P ( A )
L .H .S   1
P (A ) P (A )
36

Conditional Probability
If : A, B are mutually exclusive Show that
. P( A | B)  0
P (A  B)
L .H .S  P (A | B ) 
P (B )
P ( A  B)  0

P (A  B) 0
L .H .S  P (A | B )    zero
P (B ) P (B )
37

Conditional Probability
If A  B Show that P ( A | B )  P ( A)
: P( B)
.
If A  B
B
P ( A  B)  P ( A )
A

P (A  B) P (A )
P (A | B )  
P (B ) P (B )
38

Conditional Probability
If A  B Show that P ( B | A)  1
:
.
If A  B
B
P ( A  B)  P ( A ) A

P (A  B) P ( A )
P (B | A )   1
P (A ) P (A )
39

Conditional Probability
If : S is the sample space and A is any
event in sample space Show that
. P ( S | A)  1
A S
( A  S)  ( A )
P (A  S) P (A )
L .H .S  P (S | A )   1
P (A ) P (A )
40

Conditional Probability
:
Show that P ( A)  P ( A  B )
P( A | B) 
. 1  P( B)

P( A  B )
P( A | B ) 
P( B)

P ( A)  P ( A  B )
P( A | B) 
1  P( B)
41

Conditional Probability
:
Show that P( A | B)  1  P( A | B)
.
P( A  B) P( B)  P( A  B )
P( A | B)  
P( B) P( B)

P( B) P( A  B)
P( A | B)  
P( B) P( B)

P( A | B)  1  P( A | B)
42

Examples
43
Example
Suppose that five percent of men and 2.5 percent of women are
color-blind. A color-blind person is chosen at random. What is the
probability of this person being male?
Assume that there are an equal number of males and females.
P (M  CB )
P (M | CB) 
P (CB)
P (M  CB )  0.5  0.05  0.025

0.025 2
P (M | CB)  
0.0375 3

P (CB )  0.5  0.05  0.5  0.025  0.0375


44

Example
A local union has 8 members, 2 of whom are
women. Two are chosen (one after another)
to represent the union.
45

Example
A local union has 8 members, 2 of whom are
women. Two are chosen (one after another)
to represent the union.

a) What is the probability they are both male?

6 5
  0.536
8 7
b) What is the probability that the second choice
is male?
6 5 2 6
  
8 7 8 7
46

Example
A local union has 8 members, 2 of whom are
women. Two are chosen (one after another)
to represent the union.
c) Given that the second choice is male ,What is
the probability that the first choice is female?

P (1F  2 M )
P (1F | 2 M ) 
P (2 M )
2 6

P (1F | 2 M )  8 7
6 5 2 6
  
8 7 8 7
47
Example
A printer manufacturer obtained the following probabilities from a database
of test results. Printer failures are associated with three types of problems:
hardware, software, and other(such as connectors), with probabilities 0.2,
0.55, and 0.25, respectively. If there is a hardware problem, the printer will
fail definitely. On the other hand, the probability of a printer failure given a
software problem is 0.2 while the probability of a printer failure is 0.5 given
any other type of problem.
(a) What is the probability of a printer failure?
(b) What is the probability of a printer failure if the printer does not have a
software problem?
(c) For a failed printer,
what is the probability that
it has a software problem?
0.55 Soft
48
Example
(a) What is the probability of a printer failure?

P (F)  0.2  0.55  0.2  0.25  0.5  0.435

0.55 Soft
49
Example
(b) What is the probability of a printer failure if
the printer does not have a software problem?

P (F soft)
P (F | soft) 
P (soft)

0.2  1  0.25  0.5


P (F | soft) 
1  0.55
0.55 Soft
50
Example
(c)For a failed printer, what is the probability
that it has a software problem?
P (F)  0.435

P (F soft ) 0.2  0.55


P (soft | F)  
P (F) 0.435

0.55 Soft
51

Conditional Probability
:
Show that P( A  B | C )  P( A | C )  P( B | C )  P( A  B | C )
P (( A  B )  C )
. P( A  B | C ) 
P (C )
P (( A  C )  ( B  C ))
P( A  B | C ) 
P (C )
P( A  C )  P( B  C )  P( A  B  C )
P( A  B | C ) 
P(C )

P( A  C ) P( B  C ) P( A  B  C )
P( A  B | C )   
P(C ) P (C ) P (C )

P( A  B | C )  P( A | C )  P( B | C )  P( A  B | C )
52
Conditional Probability
If the events B and C are disjoint, prove that
for any other event A
. : P( A | B) P( B)  P( A | C ) P(C )
P( A | B  C ) 
P( B)  P(C )
P( A  ( B  C )) A C
P( A | B  C )  B
P( B  C )
P(( A  B)  ( A  C ))
P( A | B  C ) 
P( B  C )
P( A  B)  P( A  C )
P( A | B  C ) 
P( B  C )
P( A | B) P( B)  P( A | C ) P(C )
P( A | B  C ) 
P( B)  P(C )
53
Conditional Probability
If the events A,B and C are disjoint, D any
event and P (A )  0.15 , P (C)  0.45 , P (C | D)  0.2
P (D | A)  0.1 and P (D B )  0.3
C B
Find
a) P (D | B)
D

b) P (A | D)

A
54
Conditional Probability
If the events A,B and C are disjoint, D any
event and P (A )  0.15 , P (C)  0.45 , P (C | D)  0.2
P (D | A)  0.1 and P (D B )  0.3
C B
Find
a) P (D | B)
D
P (D B )
P (D | B ) 
P (B )
P (D B )
P (D | B )  A
1  p (A )  p(C)

0.3 0.3
P (D | B )    0.75
1  0.15  0.45 0.4
55
Conditional Probability
If the events A,B and C are disjoint, D any
event and P (A )  0.15 , P (C)  0.45 , P (C | D)  0.2
P (D | A)  0.1 and P (D B )  0.3
C B
Find b) P (A | D)
P (A D ) P (D | A)P (A)
P (A | D)   D
P (D) P (D)
P (D)  P (A  D )  P (B D )  P (C D )
P (D)  p (D | A)P (A )  P (B D )
 p (C | D) p(D) A
P (D)  0.1 0.15  0.3  0.2 p(D) P (D)  0.39375
0.1 0.15
P (A | D)   0.038
0.39375
56
57

Example
A study of 24 mice has classified the mice by two
categories
Fur Colour
Black White Grey
Eye Red Eyes 3 5 2
Colour
Black Eyes 1 7 6
58
A study of 24 mice has classified the mice by two
categories
Fur Colour
Black White Grey
Eye Red Eyes 3 5 2
Colour
Black Eyes 1 7 6

a) What is the probability that a randomly selected


mouse has white fur?
b) What is the probability it has black eyes given
that it has black fur?
59
A study of 24 mice has classified the mice by two
categories
Fur Colour
Black White Grey
Eye Red Eyes 3 5 2
Colour
Black Eyes 1 7 6

a) What is the probability that a randomly selected


mouse has white fur? 12/24=0.5
b) What is the probability it has black eyes given
that it has black fur?
60
A study of 24 mice has classified the mice by two
categories
Fur Colour
Black White Grey
Eye Red Eyes 3 5 2
Colour
Black Eyes 1 7 6

a) What is the probability that a randomly selected


mouse has white fur? 12/24=0.5
b) What is the probability it has black eyes given
that it has black fur? 1/4=0.25
61
A study of 24 mice has classified the mice by two
categories
Fur Colour
Black White Grey
Eye Red Eyes 3 5 2
Colour
Black Eyes 1 7 6

c) What is the probability it has a Gray fur given


2
that it has Red Eyes? 
10
b) What is the probability it has black eyes given
that it has Red Eyes? zero
62
Example
A medical test of a population is proposed to detect an illness. The
probability that the test correctly identifies someone with the
illness as positive is 0.99, and the probability that the test correctly
identifies someone without the illness as negative is 0.95. The
incidence of the illness in the general population is 0.0001.
(a) What is the probability that test identifies
some as having the illness?
(b) You take the test, and the result is positive.
What is the probability that you have
the illness?
(c) You take the test,
and the result is negative.
What is the probability that you do not
have the illness?
63
Example
(a)What is the probability that test identifies
someone as having the illness?
P ( ve)  0.0001 0.99  0.9999  0.05  0.05
64
Example
(b) You take the test, and the result is positive.
What is the probability that you have
the illness?

P ( ve)  0.05
P (ILL ve )
P (ILL |  ve) 
P ( ve)

0.0001 0.99
P (ILL |  ve) 
0.05
65
Example
(c) You take the test, and the result is negative.
What is the probability that you do not
have the illness?

P ( ve)  1  0.05  0.95


P (non  ve )
P (non |  ve) 
P ( ve)

0.9999  0.95
P (non |  ve)   0.9999
0.95
66

Example
The probability that three men  A, B, C hit a target are 1/6,
1/4 and 1/3,respectively. Each shoots once. Find the
probability that:
a. Exactly one hits the target.
b. If only one hits the target, what is the probability that the
one hits the target is the first man?

H H H
A B C
F F F
67
Example

¼ H HHH
HHF
HFH
HFF

¼ H FHH
FHF
FFH
FFF
68

Example
Find the probability that:Exactly one hits the target.
¼ H HHH
HHF
HFH
P(HFF)=1/12

¼ H FHH
Let event E P(FHF)=5/36
exactly one hits P(FFH)=5/24
FFF
P(E)=1/12+5/36+5/24=0.43
69

Example
If only one hits the target, what is the probability that the one hits the
target is the first man?
¼ H HHH
HHF
HFH
P(HFF)=1/12

Let event F ¼ H FHH


Ist hits the target
P(FHF)=5/36
P(F)=1/6
1
P( F  E )  P(FFH)=5/24
12

P ( F  E ) 1 / 12 FFF
P( F | E )  
P( E ) 0.43

You might also like