Transcript C3_CIS2033

CIS 2033 based on
Dekking et al. A Modern Introduction to Probability and Statistics. 2007
Instructor Longin Jan Latecki
C3: Conditional Probability And Independence
3.1 – Conditional Probability

Conditional Probability: the probability that an event
will occur, given that another event has occurred that
changes the likelihood of the event
P( A  C ) P( A, C )
P( A | C ) 

P (C )
P(C )
Provided P(C) > 0
3.2 – Multiplication Rule
For any events A and C:
P( A  C )  P( A, C )  P( A | C ) P(C )

Example: If event L is “person was born in a long month”, and
event R is “person was born in a month with the letter ‘R’ in
it”, then P(R) is affected by whether or not L has occurred.
The probability that R will happen, given that L has already
happened is written as: P(R|L)
  {Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec}.
L  {Jan, Mar, May, Jul, Aug, Oct, Dec}.
R  {Jan, Feb, Mar, Apr, Sep, Oct, Nov, Dec}.
R  L  {Jan, Mar, Oct, Dec}.
4
P ( R  L) 12 4
8
P( R | L) 

  P( R ) 
7 7
P ( L)
12
12
What is P(Rc| L)?
Show that P(A | C) + P(Ac | C) = 1.
Hence the rule
P(Ac) = 1 – P(A)
also holds for conditional probabilities.
3.3 – Total Probability & Bayes Rule
The Law of Total Probability
Suppose C1, C2, … ,CM are disjoint events such that
C1 U C2 U … U CM = Ω. The probability of an arbitrary
event A can be expressed as:
P( A)  P( A  C1)  P( A  C 2)  ...  P( A  CM )
Or equivalently expressed as:
P( A)  P( A | C1) P(C1)  P( A | C 2) P(C 2)  ...  P( A | CM ) P(CM )
3.1 Your lecturer wants to walk from A to B (see the map). To do so, he
first randomly selects one of the paths to C, D, or E. Next he selects
randomly one of the possible paths at that moment (so if he first selected
the path to E, he can either select the path to A or the path to F), etc. What
is the probability that he will reach B after two selections?
3.1 Your lecturer wants to walk from A to B (see the map). To do so, he
first randomly selects one of the paths to C, D, or E. Next he selects
randomly one of the possible paths at that moment (so if he first selected
the path to E, he can either select the path to A or the path to F), etc. What
is the probability that he will reach B after two selections?
Define: B = event “point B is reached on the second step,”
C = event “the path to C is chosen on the first step,” and similarly D and E.
P(B) = P(B ∩ C) + P(B ∩ D) + P(B ∩ E)
= P(B | C) P(C) + P(B | D) P(D) + P(B | E) P(E)
3.3 – Total Probability & Bayes Rule
Bayes Rule:
Suppose the events C1, C2, … CM are disjoint
and C1 U C2 U … U CM = Ω. The conditional probability of Ci,
given an arbitrary event A, can be expressed as:
P( A | Ci ) P(Ci )
P(Ci | A) 
P( A)
or
P( A | Ci ) P(Ci )
P(Ci | A) 
P( A | C1) P(C1)  P( A | C 2) P(C 2)  ...  P( A | Cm) P(Cm)
3.4 – Independence
Definition:
An event A is called independent of B if:
P( A | B)  P( A)
That is to say that A is independent of B if the probability of A occurring is not
changed by whether or not B occurs.
3.4 – Independence
Tests for Independence
To show that A and B are independent we have to prove just one of the following:
P( A | B)  P( A)
P( B | A)  P( B)
P( A  B)  P( A) P( B)
A and/or B can both be replaced by their complement.
3.4 – Independence
Independence of Two or More Events
Events A1, A2, …, Am are called independent if:
P( A1  A2  ...  Am)  P( A1) P( A2)...P( Am)
This statement holds true if any event or events is/are replaced by their
complement throughout the equation.
3.2 A fair die is thrown twice.
A is the event “sum of the throws equals 4,”
B is “at least one of the throws is a 3.”
a. Calculate P(A|B).
b. Are A and B independent events?
3.2 A fair die is thrown twice.
A is the event “sum of the throws equals 4,”
B is “at least one of the throws is a 3.”
a. Calculate P(A|B).
b. Are A and B independent events?
a. Event A has three outcomes, event B has 11 outcomes,
and A ∩ B = {(1, 3), (3, 1)}.
Hence we find P(B) = 11/36 and P(A ∩ B) = 2/36 so that
b. Because P(A) = 3/36 = 1/12 and this is not equal to P(A|B) = 2/11
the events A and B are dependent.
A computer program is tested by 3 independent tests. When there is
an error, these tests will discover it with probabilities 0.2, 0.3, and 0.5,
respectively. Suppose that the program contains an error. What is the
probability that it will be found by at least one test? (Baron 2.5)
A computer program is tested by 3 independent tests. When there is
an error, these tests will discover it with probabilities 0.2, 0.3, and 0.5,
respectively. Suppose that the program contains an error. What is the
probability that it will be found by at least one test? (Baron 2.5)
Example 2.18 from Baron
(Reliability of backups). There is a 1% probability for a hard drive to
crash. Therefore, it has two backups, each having a 2% probability to
crash, and all three components are independent of each other. The
stored information is lost only in an unfortunate situation when all three
devices crash. What is the probability that the information is saved?
Example 2.18 from Baron
(Reliability of backups). There is a 1% probability for a hard drive to
crash. Therefore, it has two backups, each having a 2% probability to
crash, and all three components are independent of each other. The
stored information is lost only in an unfortunate situation when all three
devices crash. What is the probability that the information is saved?
Example 2.19. from Baron
Suppose that a shuttle's launch depends on three key devices that
operate independently of each other and malfunction with probabilities
0.01, 0.02, and 0.02, respectively. If any of the key devices
malfunctions, the launch will be postponed. Compute the probability
for the shuttle to be launched on time, according to its schedule.
Example 2.19. from Baron
Suppose that a shuttle's launch depends on three key devices that
operate independently of each other and malfunction with probabilities
0.01, 0.02, and 0.02, respectively. If any of the key devices
malfunctions, the launch will be postponed. Compute the probability
for the shuttle to be launched on time, according to its schedule.