Download Conditional Probability and Bayes Theorem: A Comprehensive Guide with Examples and more Lecture notes Probability and Statistics in PDF only on Docsity!
Piech, CS106A, Stanford University
Conditional Probability
Recall: S = all possible outcomes. E = the event.
Axioms of Probability
- Axiom 1: 0 £ P ( E ) £ 1
- Axiom 2: P ( S ) = 1
- Axiom 3: P ( E c ) = 1 – P(E) Aside: axiom 3 is often stated as the probability of mutually exclusive events. We’ll come back to that later in the lecture…
Mutually Exclusive Events
P (E [ F ) = P (E) + P (F )
If events are mutually exclusive, probability of OR is simple:
P (E [ F ) = P (E) + P (F )
If events are mutually exclusive, probability of OR is simple:
P (E [ F ) =
Mutually Exclusive Events
If events are mutually exclusive probability of OR is easy!
P ( E
c
) = 1 – P ( E )?
P ( E ∪ E
c
) = P ( E ) + P ( E
c
Since E and E c are mutually exclusive
P (S) = P ( E ) + P ( E
c
Since everything must either be in E or E c
1 = P ( E ) + P ( E
c
P ( E
c
) = 1 – P ( E )
Axiom 2 Rearrange
Piech, CS106A, Stanford University
• Roll two 6-sided dice, yielding values D
1
and D
2
• Let E be event: D
1
+ D
2
• What is P(E)?
§ |S| = 36, E = {(1, 3), (2, 2), (3, 1)}
§ P(E) = 3/36 = 1/
• Let F be event: D
1
• P(E, given F already observed)?
§ S = {(2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6)}
§ E = {(2, 2)}
§ P(E, given F already observed) = 1/
Dice – Our Misunderstood Friends
Piech, CS106A, Stanford University
Dice – Our Misunderstood Friends
- Two people each roll a die, yielding D 1
and D
2
You win if D
1
+ D
2
- Q: What do you think is the best outcome for D 1
- Your Choices: § A. 1 and 3 tie for best § B. 1, 2 and 3 tie for best § C. 2 is the best § D. Other/none/more than one
Piech, CS106A, Stanford University
With equally likely outcomes:
P(E | F) =
of outcomes in E consistent with F
of outcomes in S consistent with F
F
EF
SF
EF
Conditional Probability
P (E|F ) =
P (E) =
Piech, CS106A, Stanford University
With equally likely outcomes:
P(E | F) =
of outcomes in E consistent with F
of outcomes in S consistent with F
F
EF
SF
EF
Conditional Probability
P (E|F ) =
P (E) =
Shorthand notation for set intersection (aka set “and”)
Piech, CS106A, Stanford University
• General definition of Chain Rule:
1 2 3 n
P E E E E
1 2 1 3 1 2 1 2 - 1
n n
P E P E E P E E E P E E E E
Generalized Chain Rule
Piech, CS106A, Stanford University
Conditional Paradigm
Piech, CS106A, Stanford University
Netflix and Learn
P ( E )
S = {Watch, Not Watch} E = {Watch} P(E) = ½? What is the probability that a user will watch Life is Beautiful?
Piech, CS106A, Stanford University What is the probability that a user will watch Life is Beautiful? P ( E )
Netflix and Learn