SLIDE 1
CS70: Jean Walrand: Lecture 24.
Changing your mind?
SLIDE 2 CS70: Jean Walrand: Lecture 24.
Changing your mind?
- 1. Bayes Rule.
- 2. Examples.
SLIDE 3
Recall definition: Conditional Probability.
Consider Ω = {1,2,...,N} with Pr[n] = pn.
SLIDE 4
Recall definition: Conditional Probability.
Consider Ω = {1,2,...,N} with Pr[n] = pn.
SLIDE 5
Recall definition: Conditional Probability.
Consider Ω = {1,2,...,N} with Pr[n] = pn. Pr[A|B] =
SLIDE 6
Recall definition: Conditional Probability.
Consider Ω = {1,2,...,N} with Pr[n] = pn. Pr[A|B] = p2 +p3 p1 +p2 +p3 = Pr[A∩B] Pr[B] .
SLIDE 7
Recall definition: Conditional Probability.
Consider Ω = {1,2,...,N} with Pr[n] = pn. Pr[A|B] = p2 +p3 p1 +p2 +p3 = Pr[A∩B] Pr[B] . Note that Pr[A∩B] = Pr[B]×
SLIDE 8
Recall definition: Conditional Probability.
Consider Ω = {1,2,...,N} with Pr[n] = pn. Pr[A|B] = p2 +p3 p1 +p2 +p3 = Pr[A∩B] Pr[B] . Note that Pr[A∩B] = Pr[B]×Pr[A|B]
SLIDE 9
Recall definition: Conditional Probability.
Consider Ω = {1,2,...,N} with Pr[n] = pn. Pr[A|B] = p2 +p3 p1 +p2 +p3 = Pr[A∩B] Pr[B] . Note that Pr[A∩B] = Pr[B]×Pr[A|B] = Pr[A]×
SLIDE 10
Recall definition: Conditional Probability.
Consider Ω = {1,2,...,N} with Pr[n] = pn. Pr[A|B] = p2 +p3 p1 +p2 +p3 = Pr[A∩B] Pr[B] . Note that Pr[A∩B] = Pr[B]×Pr[A|B] = Pr[A]×Pr[B|A].
SLIDE 11
More fun with conditional probability.
Toss a red and a blue die, sum is 4,
SLIDE 12
More fun with conditional probability.
Toss a red and a blue die, sum is 4, What is probability that red is 1?
SLIDE 13
More fun with conditional probability.
Toss a red and a blue die, sum is 4, What is probability that red is 1?
SLIDE 14
More fun with conditional probability.
Toss a red and a blue die, sum is 4, What is probability that red is 1? Pr[B|A] = |B∩A|
|A|
= 1
3;
SLIDE 15
More fun with conditional probability.
Toss a red and a blue die, sum is 4, What is probability that red is 1? Pr[B|A] = |B∩A|
|A|
= 1
3; versus Pr[B] = 1/6.
SLIDE 16
More fun with conditional probability.
Toss a red and a blue die, sum is 4, What is probability that red is 1? Pr[B|A] = |B∩A|
|A|
= 1
3; versus Pr[B] = 1/6.
B is more likely given A.
SLIDE 17
Yet more fun with conditional probability.
Toss a red and a blue die, sum is 7, what is probability that red is 1?
SLIDE 18
Yet more fun with conditional probability.
Toss a red and a blue die, sum is 7, what is probability that red is 1?
SLIDE 19
Yet more fun with conditional probability.
Toss a red and a blue die, sum is 7, what is probability that red is 1? Pr[B|A] = |B∩A|
|A|
= 1
6;
SLIDE 20
Yet more fun with conditional probability.
Toss a red and a blue die, sum is 7, what is probability that red is 1? Pr[B|A] = |B∩A|
|A|
= 1
6; versus Pr[B] = 1 6.
SLIDE 21
Yet more fun with conditional probability.
Toss a red and a blue die, sum is 7, what is probability that red is 1? Pr[B|A] = |B∩A|
|A|
= 1
6; versus Pr[B] = 1 6.
Observing A does not change your mind about the likelihood of B.
SLIDE 22
Emptiness..
Suppose I toss 3 balls into 3 bins.
SLIDE 23
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”;
SLIDE 24
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.”
SLIDE 25
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.” What is Pr[A|B]?
SLIDE 26
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.” What is Pr[A|B]?
SLIDE 27
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.” What is Pr[A|B]? Pr[B]
SLIDE 28
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.” What is Pr[A|B]? Pr[B] = Pr[{(a,b,c) | a,b,c ∈ {1,3}] =
SLIDE 29
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.” What is Pr[A|B]? Pr[B] = Pr[{(a,b,c) | a,b,c ∈ {1,3}] = Pr[{1,3}3] =
SLIDE 30
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.” What is Pr[A|B]? Pr[B] = Pr[{(a,b,c) | a,b,c ∈ {1,3}] = Pr[{1,3}3] = 8
27
SLIDE 31
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.” What is Pr[A|B]? Pr[B] = Pr[{(a,b,c) | a,b,c ∈ {1,3}] = Pr[{1,3}3] = 8
27
Pr[A∩B]
SLIDE 32
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.” What is Pr[A|B]? Pr[B] = Pr[{(a,b,c) | a,b,c ∈ {1,3}] = Pr[{1,3}3] = 8
27
Pr[A∩B] = Pr[(3,3,3)] =
SLIDE 33
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.” What is Pr[A|B]? Pr[B] = Pr[{(a,b,c) | a,b,c ∈ {1,3}] = Pr[{1,3}3] = 8
27
Pr[A∩B] = Pr[(3,3,3)] = 1
27
SLIDE 34
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.” What is Pr[A|B]? Pr[B] = Pr[{(a,b,c) | a,b,c ∈ {1,3}] = Pr[{1,3}3] = 8
27
Pr[A∩B] = Pr[(3,3,3)] = 1
27
Pr[A|B]
SLIDE 35
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.” What is Pr[A|B]? Pr[B] = Pr[{(a,b,c) | a,b,c ∈ {1,3}] = Pr[{1,3}3] = 8
27
Pr[A∩B] = Pr[(3,3,3)] = 1
27
Pr[A|B] = Pr[A∩B]
Pr[B]
SLIDE 36
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.” What is Pr[A|B]? Pr[B] = Pr[{(a,b,c) | a,b,c ∈ {1,3}] = Pr[{1,3}3] = 8
27
Pr[A∩B] = Pr[(3,3,3)] = 1
27
Pr[A|B] = Pr[A∩B]
Pr[B]
= (1/27)
(8/27) = 1/8;
SLIDE 37
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.” What is Pr[A|B]? Pr[B] = Pr[{(a,b,c) | a,b,c ∈ {1,3}] = Pr[{1,3}3] = 8
27
Pr[A∩B] = Pr[(3,3,3)] = 1
27
Pr[A|B] = Pr[A∩B]
Pr[B]
= (1/27)
(8/27) = 1/8; vs. Pr[A] = 8 27.
SLIDE 38
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.” What is Pr[A|B]? Pr[B] = Pr[{(a,b,c) | a,b,c ∈ {1,3}] = Pr[{1,3}3] = 8
27
Pr[A∩B] = Pr[(3,3,3)] = 1
27
Pr[A|B] = Pr[A∩B]
Pr[B]
= (1/27)
(8/27) = 1/8; vs. Pr[A] = 8 27.
A is less likely given B:
SLIDE 39
Emptiness..
Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.” What is Pr[A|B]? Pr[B] = Pr[{(a,b,c) | a,b,c ∈ {1,3}] = Pr[{1,3}3] = 8
27
Pr[A∩B] = Pr[(3,3,3)] = 1
27
Pr[A|B] = Pr[A∩B]
Pr[B]
= (1/27)
(8/27) = 1/8; vs. Pr[A] = 8 27.
A is less likely given B: If second bin is empty the first is more likely to have balls in it.
SLIDE 40
Gambler’s fallacy.
Flip a fair coin 51 times.
SLIDE 41
Gambler’s fallacy.
Flip a fair coin 51 times. A = “first 50 flips are heads”
SLIDE 42
Gambler’s fallacy.
Flip a fair coin 51 times. A = “first 50 flips are heads” B = “the 51st is heads”
SLIDE 43
Gambler’s fallacy.
Flip a fair coin 51 times. A = “first 50 flips are heads” B = “the 51st is heads” Pr[B|A] ?
SLIDE 44
Gambler’s fallacy.
Flip a fair coin 51 times. A = “first 50 flips are heads” B = “the 51st is heads” Pr[B|A] ? A = {HH ···HT,HH ···HH}
SLIDE 45
Gambler’s fallacy.
Flip a fair coin 51 times. A = “first 50 flips are heads” B = “the 51st is heads” Pr[B|A] ? A = {HH ···HT,HH ···HH} B ∩A = {HH ···HH}
SLIDE 46
Gambler’s fallacy.
Flip a fair coin 51 times. A = “first 50 flips are heads” B = “the 51st is heads” Pr[B|A] ? A = {HH ···HT,HH ···HH} B ∩A = {HH ···HH} Uniform probability space.
SLIDE 47
Gambler’s fallacy.
Flip a fair coin 51 times. A = “first 50 flips are heads” B = “the 51st is heads” Pr[B|A] ? A = {HH ···HT,HH ···HH} B ∩A = {HH ···HH} Uniform probability space. Pr[B|A] = |B∩A|
|A|
= 1
2.
SLIDE 48
Gambler’s fallacy.
Flip a fair coin 51 times. A = “first 50 flips are heads” B = “the 51st is heads” Pr[B|A] ? A = {HH ···HT,HH ···HH} B ∩A = {HH ···HH} Uniform probability space. Pr[B|A] = |B∩A|
|A|
= 1
2.
Same as Pr[B].
SLIDE 49
Gambler’s fallacy.
Flip a fair coin 51 times. A = “first 50 flips are heads” B = “the 51st is heads” Pr[B|A] ? A = {HH ···HT,HH ···HH} B ∩A = {HH ···HH} Uniform probability space. Pr[B|A] = |B∩A|
|A|
= 1
2.
Same as Pr[B].
The likelihood of 51st heads does not depend on the previous flips.
SLIDE 50
Monty Hall Game.
SLIDE 51
Monty Hall Game.
Monty Hall is the host of a game show. His assistant is Carol.
SLIDE 52
Monty Hall Game.
Monty Hall is the host of a game show. His assistant is Carol.
◮ Three doors;
SLIDE 53
Monty Hall Game.
Monty Hall is the host of a game show. His assistant is Carol.
◮ Three doors; one prize
SLIDE 54
Monty Hall Game.
Monty Hall is the host of a game show. His assistant is Carol.
◮ Three doors; one prize two goats. ◮ Choose one door, say door 1.
SLIDE 55
Monty Hall Game.
Monty Hall is the host of a game show. His assistant is Carol.
◮ Three doors; one prize two goats. ◮ Choose one door, say door 1. ◮ Carol opens another door with a goat, say door 3.
SLIDE 56
Monty Hall Game.
Monty Hall is the host of a game show. His assistant is Carol.
◮ Three doors; one prize two goats. ◮ Choose one door, say door 1. ◮ Carol opens another door with a goat, say door 3. ◮ Monty offers you a chance to switch doors, i.e., choose
door 2.
SLIDE 57
Monty Hall Game.
Monty Hall is the host of a game show. His assistant is Carol.
◮ Three doors; one prize two goats. ◮ Choose one door, say door 1. ◮ Carol opens another door with a goat, say door 3. ◮ Monty offers you a chance to switch doors, i.e., choose
door 2.
◮ What do you do?
SLIDE 58
Monty Hall Game
SLIDE 59
Monty Hall Game
Recall: You picked door 1 and Carol opened door 3. Should you switch to door 2?
SLIDE 60
Monty Hall Game
Recall: You picked door 1 and Carol opened door 3. Should you switch to door 2? First intuition: Doors 1 and 2 are equally likely to hide the prize: no need to switch.
SLIDE 61
Monty Hall Game
Recall: You picked door 1 and Carol opened door 3. Should you switch to door 2? First intuition: Doors 1 and 2 are equally likely to hide the prize: no need to switch. Opening door 3 did not tell us anything about doors 1 and 2.
SLIDE 62
Monty Hall Game
Recall: You picked door 1 and Carol opened door 3. Should you switch to door 2? First intuition: Doors 1 and 2 are equally likely to hide the prize: no need to switch. Opening door 3 did not tell us anything about doors 1 and 2. Wrong!
SLIDE 63
Monty Hall Game
Recall: You picked door 1 and Carol opened door 3. Should you switch to door 2? First intuition: Doors 1 and 2 are equally likely to hide the prize: no need to switch. Opening door 3 did not tell us anything about doors 1 and 2. Wrong! Better observation: If you switch, you get the prize, except it it is behind door 1.
SLIDE 64
Monty Hall Game
Recall: You picked door 1 and Carol opened door 3. Should you switch to door 2? First intuition: Doors 1 and 2 are equally likely to hide the prize: no need to switch. Opening door 3 did not tell us anything about doors 1 and 2. Wrong! Better observation: If you switch, you get the prize, except it it is behind door 1. Thus, by switching, you get the prize with probability 2/3.
SLIDE 65
Monty Hall Game
Recall: You picked door 1 and Carol opened door 3. Should you switch to door 2? First intuition: Doors 1 and 2 are equally likely to hide the prize: no need to switch. Opening door 3 did not tell us anything about doors 1 and 2. Wrong! Better observation: If you switch, you get the prize, except it it is behind door 1. Thus, by switching, you get the prize with probability 2/3. If you do not switch, you get it with probability 1/3.
SLIDE 66
SLIDE 67
Monty Hall Game Analysis
Ω = {1,2,3}2;ω = (a,b) = ( prize, your initial choice); uniform.
SLIDE 68
Monty Hall Game Analysis
Ω = {1,2,3}2;ω = (a,b) = ( prize, your initial choice); uniform. If you do not switch, you win if a = b.
SLIDE 69
Monty Hall Game Analysis
Ω = {1,2,3}2;ω = (a,b) = ( prize, your initial choice); uniform. If you do not switch, you win if a = b. If you switch, you win if a = b.
SLIDE 70
Monty Hall Game Analysis
Ω = {1,2,3}2;ω = (a,b) = ( prize, your initial choice); uniform. If you do not switch, you win if a = b. If you switch, you win if a = b. E.g., (a,b) = (1,2) → shows 3
SLIDE 71
Monty Hall Game Analysis
Ω = {1,2,3}2;ω = (a,b) = ( prize, your initial choice); uniform. If you do not switch, you win if a = b. If you switch, you win if a = b. E.g., (a,b) = (1,2) → shows 3 → switch to 1.
SLIDE 72
Monty Hall Game Analysis
Ω = {1,2,3}2;ω = (a,b) = ( prize, your initial choice); uniform. If you do not switch, you win if a = b. If you switch, you win if a = b. E.g., (a,b) = (1,2) → shows 3 → switch to 1. Pr[{(a,b) | a = b}] =
SLIDE 73
Monty Hall Game Analysis
Ω = {1,2,3}2;ω = (a,b) = ( prize, your initial choice); uniform. If you do not switch, you win if a = b. If you switch, you win if a = b. E.g., (a,b) = (1,2) → shows 3 → switch to 1. Pr[{(a,b) | a = b}] = 3
9 = 1 3
SLIDE 74
Monty Hall Game Analysis
Ω = {1,2,3}2;ω = (a,b) = ( prize, your initial choice); uniform. If you do not switch, you win if a = b. If you switch, you win if a = b. E.g., (a,b) = (1,2) → shows 3 → switch to 1. Pr[{(a,b) | a = b}] = 3
9 = 1 3
Pr[{(a,b) | a = b}] =
SLIDE 75
Monty Hall Game Analysis
Ω = {1,2,3}2;ω = (a,b) = ( prize, your initial choice); uniform. If you do not switch, you win if a = b. If you switch, you win if a = b. E.g., (a,b) = (1,2) → shows 3 → switch to 1. Pr[{(a,b) | a = b}] = 3
9 = 1 3
Pr[{(a,b) | a = b}] = 1−Pr[{(a,b) | a = b}] = 2
3.
SLIDE 76
Independence
Definition: Two events A and B are independent if
SLIDE 77
Independence
Definition: Two events A and B are independent if Pr[A∩B] = Pr[A]Pr[B].
SLIDE 78
Independence
Definition: Two events A and B are independent if Pr[A∩B] = Pr[A]Pr[B]. Examples:
SLIDE 79
Independence
Definition: Two events A and B are independent if Pr[A∩B] = Pr[A]Pr[B]. Examples:
◮ When rolling two dice, A = sum is 7 and B = red die is 1
are
SLIDE 80
Independence
Definition: Two events A and B are independent if Pr[A∩B] = Pr[A]Pr[B]. Examples:
◮ When rolling two dice, A = sum is 7 and B = red die is 1
are independent;
SLIDE 81
Independence
Definition: Two events A and B are independent if Pr[A∩B] = Pr[A]Pr[B]. Examples:
◮ When rolling two dice, A = sum is 7 and B = red die is 1
are independent;
◮ When rolling two dice, A = sum is 3 and B = red die is 1
are
SLIDE 82
Independence
Definition: Two events A and B are independent if Pr[A∩B] = Pr[A]Pr[B]. Examples:
◮ When rolling two dice, A = sum is 7 and B = red die is 1
are independent;
◮ When rolling two dice, A = sum is 3 and B = red die is 1
are not independent;
SLIDE 83
Independence
Definition: Two events A and B are independent if Pr[A∩B] = Pr[A]Pr[B]. Examples:
◮ When rolling two dice, A = sum is 7 and B = red die is 1
are independent;
◮ When rolling two dice, A = sum is 3 and B = red die is 1
are not independent;
◮ When flipping coins, A = coin 1 yields heads and B = coin
2 yields tails are
SLIDE 84
Independence
Definition: Two events A and B are independent if Pr[A∩B] = Pr[A]Pr[B]. Examples:
◮ When rolling two dice, A = sum is 7 and B = red die is 1
are independent;
◮ When rolling two dice, A = sum is 3 and B = red die is 1
are not independent;
◮ When flipping coins, A = coin 1 yields heads and B = coin
2 yields tails are independent;
SLIDE 85
Independence
Definition: Two events A and B are independent if Pr[A∩B] = Pr[A]Pr[B]. Examples:
◮ When rolling two dice, A = sum is 7 and B = red die is 1
are independent;
◮ When rolling two dice, A = sum is 3 and B = red die is 1
are not independent;
◮ When flipping coins, A = coin 1 yields heads and B = coin
2 yields tails are independent;
◮ When throwing 3 balls into 3 bins, A = bin 1 is empty and
B = bin 2 is empty are
SLIDE 86
Independence
Definition: Two events A and B are independent if Pr[A∩B] = Pr[A]Pr[B]. Examples:
◮ When rolling two dice, A = sum is 7 and B = red die is 1
are independent;
◮ When rolling two dice, A = sum is 3 and B = red die is 1
are not independent;
◮ When flipping coins, A = coin 1 yields heads and B = coin
2 yields tails are independent;
◮ When throwing 3 balls into 3 bins, A = bin 1 is empty and
B = bin 2 is empty are not independent;
SLIDE 87
Independence and conditional probability
Fact: Two events A and B are independent if and only if
SLIDE 88
Independence and conditional probability
Fact: Two events A and B are independent if and only if Pr[A|B] = Pr[A].
SLIDE 89
Independence and conditional probability
Fact: Two events A and B are independent if and only if Pr[A|B] = Pr[A]. Indeed:
SLIDE 90
Independence and conditional probability
Fact: Two events A and B are independent if and only if Pr[A|B] = Pr[A]. Indeed: Pr[A|B] = Pr[A∩B]
Pr[B] , so that
SLIDE 91
Independence and conditional probability
Fact: Two events A and B are independent if and only if Pr[A|B] = Pr[A]. Indeed: Pr[A|B] = Pr[A∩B]
Pr[B] , so that
Pr[A|B] = Pr[A] ⇔ Pr[A∩B] Pr[B] = Pr[A]
SLIDE 92
Independence and conditional probability
Fact: Two events A and B are independent if and only if Pr[A|B] = Pr[A]. Indeed: Pr[A|B] = Pr[A∩B]
Pr[B] , so that
Pr[A|B] = Pr[A] ⇔ Pr[A∩B] Pr[B] = Pr[A] ⇔ Pr[A∩B] = Pr[A]Pr[B].
SLIDE 93
Total probability
Here is a simple useful fact:
SLIDE 94
Total probability
Here is a simple useful fact: Pr[B] = Pr[A∩B]+Pr[¯ A∩B].
SLIDE 95
Total probability
Here is a simple useful fact: Pr[B] = Pr[A∩B]+Pr[¯ A∩B].
SLIDE 96
Total probability
Here is a simple useful fact: Pr[B] = Pr[A∩B]+Pr[¯ A∩B]. Indeed, B is the union of two disjoint sets A∩B and ¯ A∩B.
SLIDE 97
Total probability
Here is a simple useful fact: Pr[B] = Pr[A∩B]+Pr[¯ A∩B]. Indeed, B is the union of two disjoint sets A∩B and ¯ A∩B. Thus, Pr[B] = Pr[A]Pr[B|A]+Pr[¯ A]Pr[B|¯ A].
SLIDE 98
Total probability
Assume that Ω is the union of the disjoint sets A1,...,AN.
SLIDE 99
Total probability
Assume that Ω is the union of the disjoint sets A1,...,AN. Then, Pr[B] = Pr[A1 ∩B]+···+Pr[AN ∩B].
SLIDE 100
Total probability
Assume that Ω is the union of the disjoint sets A1,...,AN. Then, Pr[B] = Pr[A1 ∩B]+···+Pr[AN ∩B]. Indeed, B is the union of the disjoint sets An ∩B for n = 1,...,N.
SLIDE 101
Total probability
Assume that Ω is the union of the disjoint sets A1,...,AN. Then, Pr[B] = Pr[A1 ∩B]+···+Pr[AN ∩B]. Indeed, B is the union of the disjoint sets An ∩B for n = 1,...,N. Thus, Pr[B] = Pr[A1]Pr[B|A1]+···+Pr[AN]Pr[B|AN].
SLIDE 102
Total probability
Assume that Ω is the union of the disjoint sets A1,...,AN. Pr[B] = Pr[A1]Pr[B|A1]+···+Pr[AN]Pr[B|AN].
SLIDE 103
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise.
SLIDE 104
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise. You flip your coin and it yields heads.
SLIDE 105
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise. You flip your coin and it yields heads. What is the probability that it is fair?
SLIDE 106
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise. You flip your coin and it yields heads. What is the probability that it is fair? Analysis:
SLIDE 107
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise. You flip your coin and it yields heads. What is the probability that it is fair? Analysis: A = ‘coin is fair’,
SLIDE 108
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise. You flip your coin and it yields heads. What is the probability that it is fair? Analysis: A = ‘coin is fair’,B = ‘outcome is heads’
SLIDE 109
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise. You flip your coin and it yields heads. What is the probability that it is fair? Analysis: A = ‘coin is fair’,B = ‘outcome is heads’ We want to calculate P[A|B].
SLIDE 110
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise. You flip your coin and it yields heads. What is the probability that it is fair? Analysis: A = ‘coin is fair’,B = ‘outcome is heads’ We want to calculate P[A|B]. We know P[B|A] =
SLIDE 111
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise. You flip your coin and it yields heads. What is the probability that it is fair? Analysis: A = ‘coin is fair’,B = ‘outcome is heads’ We want to calculate P[A|B]. We know P[B|A] = 1/2,P[B|¯ A] =
SLIDE 112
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise. You flip your coin and it yields heads. What is the probability that it is fair? Analysis: A = ‘coin is fair’,B = ‘outcome is heads’ We want to calculate P[A|B]. We know P[B|A] = 1/2,P[B|¯ A] = 0.6,
SLIDE 113
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise. You flip your coin and it yields heads. What is the probability that it is fair? Analysis: A = ‘coin is fair’,B = ‘outcome is heads’ We want to calculate P[A|B]. We know P[B|A] = 1/2,P[B|¯ A] = 0.6,Pr[A] =
SLIDE 114
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise. You flip your coin and it yields heads. What is the probability that it is fair? Analysis: A = ‘coin is fair’,B = ‘outcome is heads’ We want to calculate P[A|B]. We know P[B|A] = 1/2,P[B|¯ A] = 0.6,Pr[A] = 1/2
SLIDE 115
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise. You flip your coin and it yields heads. What is the probability that it is fair? Analysis: A = ‘coin is fair’,B = ‘outcome is heads’ We want to calculate P[A|B]. We know P[B|A] = 1/2,P[B|¯ A] = 0.6,Pr[A] = 1/2 = Pr[¯ A]
SLIDE 116
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise. You flip your coin and it yields heads. What is the probability that it is fair? Analysis: A = ‘coin is fair’,B = ‘outcome is heads’ We want to calculate P[A|B]. We know P[B|A] = 1/2,P[B|¯ A] = 0.6,Pr[A] = 1/2 = Pr[¯ A] Now, Pr[B] = Pr[A∩B]+Pr[¯ A∩B] =
SLIDE 117
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise. You flip your coin and it yields heads. What is the probability that it is fair? Analysis: A = ‘coin is fair’,B = ‘outcome is heads’ We want to calculate P[A|B]. We know P[B|A] = 1/2,P[B|¯ A] = 0.6,Pr[A] = 1/2 = Pr[¯ A] Now, Pr[B] = Pr[A∩B]+Pr[¯ A∩B] = Pr[A]Pr[B|A]+Pr[¯ A]Pr[B|¯ A]
SLIDE 118
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise. You flip your coin and it yields heads. What is the probability that it is fair? Analysis: A = ‘coin is fair’,B = ‘outcome is heads’ We want to calculate P[A|B]. We know P[B|A] = 1/2,P[B|¯ A] = 0.6,Pr[A] = 1/2 = Pr[¯ A] Now, Pr[B] = Pr[A∩B]+Pr[¯ A∩B] = Pr[A]Pr[B|A]+Pr[¯ A]Pr[B|¯ A] = (1/2)(1/2)+(1/2)0.6 = 0.55.
SLIDE 119
Is you coin loaded?
Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise. You flip your coin and it yields heads. What is the probability that it is fair? Analysis: A = ‘coin is fair’,B = ‘outcome is heads’ We want to calculate P[A|B]. We know P[B|A] = 1/2,P[B|¯ A] = 0.6,Pr[A] = 1/2 = Pr[¯ A] Now, Pr[B] = Pr[A∩B]+Pr[¯ A∩B] = Pr[A]Pr[B|A]+Pr[¯ A]Pr[B|¯ A] = (1/2)(1/2)+(1/2)0.6 = 0.55. Thus, Pr[A|B] = Pr[A]Pr[B|A] Pr[B] = (1/2)(1/2) (1/2)(1/2)+(1/2)0.6 ≈ 0.45.
SLIDE 120
Is you coin loaded?
A picture:
SLIDE 121
Is you coin loaded?
A picture:
SLIDE 122
Is you coin loaded?
A picture: Imagine 100 situations, among which m := 100(1/2)(1/2) are such that A and B occur and n := 100(1/2)(0.6) are such that ¯ A and B occur.
SLIDE 123
Is you coin loaded?
A picture: Imagine 100 situations, among which m := 100(1/2)(1/2) are such that A and B occur and n := 100(1/2)(0.6) are such that ¯ A and B occur. Thus, among the m +n situations where B occurred, there are m where A occurred.
SLIDE 124
Is you coin loaded?
A picture: Imagine 100 situations, among which m := 100(1/2)(1/2) are such that A and B occur and n := 100(1/2)(0.6) are such that ¯ A and B occur. Thus, among the m +n situations where B occurred, there are m where A occurred. Hence, Pr[A|B] = m m +n = (1/2)(1/2) (1/2)(1/2)+(1/2)0.6.
SLIDE 125
Bayes Rule
Another picture: We imagine that there are N possible causes A1,...,AN.
SLIDE 126
Bayes Rule
Another picture: We imagine that there are N possible causes A1,...,AN.
SLIDE 127
Bayes Rule
Another picture: We imagine that there are N possible causes A1,...,AN. Imagine 100 situations, among which 100pnqn are such that An and B occur, for n = 1,...,N. Thus, among the 100∑m pmqm situations where B occurred, there are 100pnqn where An occurred.
SLIDE 128
Bayes Rule
Another picture: We imagine that there are N possible causes A1,...,AN. Imagine 100 situations, among which 100pnqn are such that An and B occur, for n = 1,...,N. Thus, among the 100∑m pmqm situations where B occurred, there are 100pnqn where An occurred. Hence, Pr[An|B] = pnqn ∑m pmqm .
SLIDE 129
Why do you have a fever?
SLIDE 130
Why do you have a fever?
Using Bayes’ rule, we find
SLIDE 131
Why do you have a fever?
Using Bayes’ rule, we find Pr[Flu|High Fever] = 0.15×0.80 0.15×0.80+10−8 ×1+0.85×0.1 ≈ 0.58
SLIDE 132
Why do you have a fever?
Using Bayes’ rule, we find Pr[Flu|High Fever] = 0.15×0.80 0.15×0.80+10−8 ×1+0.85×0.1 ≈ 0.58 Pr[Ebola|High Fever] = 10−8 ×1 0.15×0.80+10−8 ×1+0.85×0.1 ≈ 5×10−8
SLIDE 133
Why do you have a fever?
Using Bayes’ rule, we find Pr[Flu|High Fever] = 0.15×0.80 0.15×0.80+10−8 ×1+0.85×0.1 ≈ 0.58 Pr[Ebola|High Fever] = 10−8 ×1 0.15×0.80+10−8 ×1+0.85×0.1 ≈ 5×10−8 Pr[Other|High Fever] = 0.85×0.1 0.15×0.80+10−8 ×1+0.85×0.1 ≈ 0.42
SLIDE 134
Why do you have a fever?
Using Bayes’ rule, we find Pr[Flu|High Fever] = 0.15×0.80 0.15×0.80+10−8 ×1+0.85×0.1 ≈ 0.58 Pr[Ebola|High Fever] = 10−8 ×1 0.15×0.80+10−8 ×1+0.85×0.1 ≈ 5×10−8 Pr[Other|High Fever] = 0.85×0.1 0.15×0.80+10−8 ×1+0.85×0.1 ≈ 0.42 These are the posterior probabilities.
SLIDE 135
Why do you have a fever?
Using Bayes’ rule, we find Pr[Flu|High Fever] = 0.15×0.80 0.15×0.80+10−8 ×1+0.85×0.1 ≈ 0.58 Pr[Ebola|High Fever] = 10−8 ×1 0.15×0.80+10−8 ×1+0.85×0.1 ≈ 5×10−8 Pr[Other|High Fever] = 0.85×0.1 0.15×0.80+10−8 ×1+0.85×0.1 ≈ 0.42 These are the posterior probabilities. One says that ‘Flu’ is the Most Likely a Posteriori (MAP) cause of the high fever.
SLIDE 136
Bayes’ Rule Operations
SLIDE 137
Bayes’ Rule Operations
SLIDE 138
Bayes’ Rule Operations
Bayes’ Rule is the canonical example of how information changes our opinions.
SLIDE 139
Thomas Bayes
Source: Wikipedia.
SLIDE 140
Thomas Bayes
A Bayesian picture of Thomas Bayes.
SLIDE 141
Testing for disease.
Let’s watch TV!!
SLIDE 142
Testing for disease.
Let’s watch TV!! Random Experiment: Pick a random male.
SLIDE 143
Testing for disease.
Let’s watch TV!! Random Experiment: Pick a random male. Outcomes: (test,disease)
SLIDE 144
Testing for disease.
Let’s watch TV!! Random Experiment: Pick a random male. Outcomes: (test,disease) A - prostate cancer. B - positive PSA test.
SLIDE 145
Testing for disease.
Let’s watch TV!! Random Experiment: Pick a random male. Outcomes: (test,disease) A - prostate cancer. B - positive PSA test.
◮ Pr[A] = 0.0016, (.16 % of the male population is affected.) ◮ Pr[B|A] = 0.80 (80% chance of positive test with disease.) ◮ Pr[B|A] = 0.10 (10% chance of positive test without
disease.)
SLIDE 146
Testing for disease.
Let’s watch TV!! Random Experiment: Pick a random male. Outcomes: (test,disease) A - prostate cancer. B - positive PSA test.
◮ Pr[A] = 0.0016, (.16 % of the male population is affected.) ◮ Pr[B|A] = 0.80 (80% chance of positive test with disease.) ◮ Pr[B|A] = 0.10 (10% chance of positive test without
disease.) From http://www.cpcn.org/01 psa tests.htm and http://seer.cancer.gov/statfacts/html/prost.html (10/12/2011.)
SLIDE 147
Testing for disease.
Let’s watch TV!! Random Experiment: Pick a random male. Outcomes: (test,disease) A - prostate cancer. B - positive PSA test.
◮ Pr[A] = 0.0016, (.16 % of the male population is affected.) ◮ Pr[B|A] = 0.80 (80% chance of positive test with disease.) ◮ Pr[B|A] = 0.10 (10% chance of positive test without
disease.) From http://www.cpcn.org/01 psa tests.htm and http://seer.cancer.gov/statfacts/html/prost.html (10/12/2011.) Positive PSA test (B). Do I have disease?
SLIDE 148
Testing for disease.
Let’s watch TV!! Random Experiment: Pick a random male. Outcomes: (test,disease) A - prostate cancer. B - positive PSA test.
◮ Pr[A] = 0.0016, (.16 % of the male population is affected.) ◮ Pr[B|A] = 0.80 (80% chance of positive test with disease.) ◮ Pr[B|A] = 0.10 (10% chance of positive test without
disease.) From http://www.cpcn.org/01 psa tests.htm and http://seer.cancer.gov/statfacts/html/prost.html (10/12/2011.) Positive PSA test (B). Do I have disease? Pr[A|B]???
SLIDE 149
Bayes Rule.
SLIDE 150
Bayes Rule.
Using Bayes’ rule, we find
SLIDE 151
Bayes Rule.
Using Bayes’ rule, we find P[A|B] = 0.0016×0.80 0.0016×0.80+0.9984×0.10
SLIDE 152
Bayes Rule.
Using Bayes’ rule, we find P[A|B] = 0.0016×0.80 0.0016×0.80+0.9984×0.10 = .013.
SLIDE 153
Bayes Rule.
Using Bayes’ rule, we find P[A|B] = 0.0016×0.80 0.0016×0.80+0.9984×0.10 = .013. A 1.3% chance of prostate cancer with a positive PSA test.
SLIDE 154
Bayes Rule.
Using Bayes’ rule, we find P[A|B] = 0.0016×0.80 0.0016×0.80+0.9984×0.10 = .013. A 1.3% chance of prostate cancer with a positive PSA test. Surgery anyone?
SLIDE 155
Bayes Rule.
Using Bayes’ rule, we find P[A|B] = 0.0016×0.80 0.0016×0.80+0.9984×0.10 = .013. A 1.3% chance of prostate cancer with a positive PSA test. Surgery anyone? Impotence...
SLIDE 156
Bayes Rule.
Using Bayes’ rule, we find P[A|B] = 0.0016×0.80 0.0016×0.80+0.9984×0.10 = .013. A 1.3% chance of prostate cancer with a positive PSA test. Surgery anyone? Impotence... Incontinence..
SLIDE 157
Bayes Rule.
Using Bayes’ rule, we find P[A|B] = 0.0016×0.80 0.0016×0.80+0.9984×0.10 = .013. A 1.3% chance of prostate cancer with a positive PSA test. Surgery anyone? Impotence... Incontinence.. Death.
SLIDE 158
Summary
Change your mind?
SLIDE 159
Summary
Change your mind? Key Ideas:
◮ Conditional Probability:
Pr[A|B] = Pr[A∩B] Pr[B]
SLIDE 160
Summary
Change your mind? Key Ideas:
◮ Conditional Probability:
Pr[A|B] = Pr[A∩B] Pr[B]
◮ Bayes’ Rule:
Pr[An|B] = Pr[An]Pr[B|An] ∑m Pr[Am]Pr[B|Am].
SLIDE 161
Summary
Change your mind? Key Ideas:
◮ Conditional Probability:
Pr[A|B] = Pr[A∩B] Pr[B]
◮ Bayes’ Rule:
Pr[An|B] = Pr[An]Pr[B|An] ∑m Pr[Am]Pr[B|Am]. Pr[An|B] = posterior probability;Pr[An] = prior probability .
SLIDE 162
Summary
Change your mind? Key Ideas:
◮ Conditional Probability:
Pr[A|B] = Pr[A∩B] Pr[B]
◮ Bayes’ Rule:
Pr[An|B] = Pr[An]Pr[B|An] ∑m Pr[Am]Pr[B|Am]. Pr[An|B] = posterior probability;Pr[An] = prior probability .
◮ All these are possible:
Pr[A|B] < Pr[A];Pr[A|B] > Pr[A];Pr[A|B] = Pr[A].