CS70: Jean Walrand: Lecture 24. Changing your mind? CS70: Jean - - PowerPoint PPT Presentation

cs70 jean walrand lecture 24
SMART_READER_LITE
LIVE PREVIEW

CS70: Jean Walrand: Lecture 24. Changing your mind? CS70: Jean - - PowerPoint PPT Presentation

CS70: Jean Walrand: Lecture 24. Changing your mind? CS70: Jean Walrand: Lecture 24. Changing your mind? 1. Bayes Rule. 2. Examples. Recall definition: Conditional Probability. Consider = { 1 , 2 ,..., N } with Pr [ n ] = p n . Recall


slide-1
SLIDE 1

CS70: Jean Walrand: Lecture 24.

Changing your mind?

slide-2
SLIDE 2

CS70: Jean Walrand: Lecture 24.

Changing your mind?

  • 1. Bayes Rule.
  • 2. Examples.
slide-3
SLIDE 3

Recall definition: Conditional Probability.

Consider Ω = {1,2,...,N} with Pr[n] = pn.

slide-4
SLIDE 4

Recall definition: Conditional Probability.

Consider Ω = {1,2,...,N} with Pr[n] = pn.

slide-5
SLIDE 5

Recall definition: Conditional Probability.

Consider Ω = {1,2,...,N} with Pr[n] = pn. Pr[A|B] =

slide-6
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
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
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
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
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
SLIDE 11

More fun with conditional probability.

Toss a red and a blue die, sum is 4,

slide-12
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
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
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
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
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
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
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
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
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
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
SLIDE 22

Emptiness..

Suppose I toss 3 balls into 3 bins.

slide-23
SLIDE 23

Emptiness..

Suppose I toss 3 balls into 3 bins. A =“1st bin empty”;

slide-24
SLIDE 24

Emptiness..

Suppose I toss 3 balls into 3 bins. A =“1st bin empty”; B =“2nd bin empty.”

slide-25
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
SLIDE 40

Gambler’s fallacy.

Flip a fair coin 51 times.

slide-41
SLIDE 41

Gambler’s fallacy.

Flip a fair coin 51 times. A = “first 50 flips are heads”

slide-42
SLIDE 42

Gambler’s fallacy.

Flip a fair coin 51 times. A = “first 50 flips are heads” B = “the 51st is heads”

slide-43
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
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
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
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
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
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
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
SLIDE 50

Monty Hall Game.

slide-51
SLIDE 51

Monty Hall Game.

Monty Hall is the host of a game show. His assistant is Carol.

slide-52
SLIDE 52

Monty Hall Game.

Monty Hall is the host of a game show. His assistant is Carol.

◮ Three doors;

slide-53
SLIDE 53

Monty Hall Game.

Monty Hall is the host of a game show. His assistant is Carol.

◮ Three doors; one prize

slide-54
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
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
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
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
SLIDE 58

Monty Hall Game

slide-59
SLIDE 59

Monty Hall Game

Recall: You picked door 1 and Carol opened door 3. Should you switch to door 2?

slide-60
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
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
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
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
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
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 66
slide-67
SLIDE 67

Monty Hall Game Analysis

Ω = {1,2,3}2;ω = (a,b) = ( prize, your initial choice); uniform.

slide-68
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
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
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
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
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
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
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
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
SLIDE 76

Independence

Definition: Two events A and B are independent if

slide-77
SLIDE 77

Independence

Definition: Two events A and B are independent if Pr[A∩B] = Pr[A]Pr[B].

slide-78
SLIDE 78

Independence

Definition: Two events A and B are independent if Pr[A∩B] = Pr[A]Pr[B]. Examples:

slide-79
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
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
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
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
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
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
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
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
SLIDE 87

Independence and conditional probability

Fact: Two events A and B are independent if and only if

slide-88
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
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
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
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
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
SLIDE 93

Total probability

Here is a simple useful fact:

slide-94
SLIDE 94

Total probability

Here is a simple useful fact: Pr[B] = Pr[A∩B]+Pr[¯ A∩B].

slide-95
SLIDE 95

Total probability

Here is a simple useful fact: Pr[B] = Pr[A∩B]+Pr[¯ A∩B].

slide-96
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
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
SLIDE 98

Total probability

Assume that Ω is the union of the disjoint sets A1,...,AN.

slide-99
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
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
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
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
SLIDE 103

Is you coin loaded?

Your coin is fair w.p. 1/2 or such that Pr[H] = 0.6, otherwise.

slide-104
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
SLIDE 120

Is you coin loaded?

A picture:

slide-121
SLIDE 121

Is you coin loaded?

A picture:

slide-122
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
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
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
SLIDE 125

Bayes Rule

Another picture: We imagine that there are N possible causes A1,...,AN.

slide-126
SLIDE 126

Bayes Rule

Another picture: We imagine that there are N possible causes A1,...,AN.

slide-127
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
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
SLIDE 129

Why do you have a fever?

slide-130
SLIDE 130

Why do you have a fever?

Using Bayes’ rule, we find

slide-131
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
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
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
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
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
SLIDE 136

Bayes’ Rule Operations

slide-137
SLIDE 137

Bayes’ Rule Operations

slide-138
SLIDE 138

Bayes’ Rule Operations

Bayes’ Rule is the canonical example of how information changes our opinions.

slide-139
SLIDE 139

Thomas Bayes

Source: Wikipedia.

slide-140
SLIDE 140

Thomas Bayes

A Bayesian picture of Thomas Bayes.

slide-141
SLIDE 141

Testing for disease.

Let’s watch TV!!

slide-142
SLIDE 142

Testing for disease.

Let’s watch TV!! Random Experiment: Pick a random male.

slide-143
SLIDE 143

Testing for disease.

Let’s watch TV!! Random Experiment: Pick a random male. Outcomes: (test,disease)

slide-144
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
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
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
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
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
SLIDE 149

Bayes Rule.

slide-150
SLIDE 150

Bayes Rule.

Using Bayes’ rule, we find

slide-151
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
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
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
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
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
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
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
SLIDE 158

Summary

Change your mind?

slide-159
SLIDE 159

Summary

Change your mind? Key Ideas:

◮ Conditional Probability:

Pr[A|B] = Pr[A∩B] Pr[B]

slide-160
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
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
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].