1. Trang chủ
  2. » Giáo án - Bài giảng

Discrrete mathematics for computer science conditional

11 37 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 11
Dung lượng 155,32 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

What is a conditional probability?• Now suppose we know that the first roll is 4 or 5... Conditional Probability and Independence• Fact: A and B are independent events iff PrA|B = PrA..

Trang 1

Conditional Probability

Trang 2

What is a conditional probability?

• It is the probability of an event in a subset of the sample space

• Example: Roll a die twice, win if total ≥ 9

• Sample space S = set of outcomes

= {11, 12, 13, 14, 15, 16, 21, 22, …, 65, 66}

• Event W = pairs that sum to ≥ 9

= {36, 45, 46, 54, 55, 56, 63, 64, 65, 66}

• Pr(W) = 10/36

Trang 3

What is a conditional probability?

• Now suppose we know that the first roll is 4 or 5 What is now the probability that the sum of the two rolls will be ≥ 9?

• Let B = first roll is 4 or 5

= {41, 42, …, 46, 51, 52, …, 56}

• Event W∩B = {45, 46, 54, 55, 56}

• Pr(W | B) = |W∩B|/|B| = 5/12

• “Probability of W given B”

Trang 4

Conditional probability

• But since the sample space is the same,

• In general, the conditional probability of event A given event B is defined as

Pr(W | B) = | Ω ∩ Β |

| Β | = |

Ω ∩ Β | / | Σ |

| Β | / | Σ | = Πρ(

Ω ∩ Β ) Πρ( Β )

Pr(A | B) = Πρ( Α ∩ Β )

Πρ( Β )

Trang 5

What is the difference between

Pr(A|B) and Pr(B|A)?

• Pr(A|B) is the proportion of B that is also within A, that is, Pr(A|B) is | A∩B| as a proportion of |B|

• Pr(A|B) is close to 1 but Pr(B|A) is close to 0

A∩B

Trang 6

• This class has 42 students, 13 freshmen, 17 women, and 5 women freshmen

• So if a student is selected at random,

– Pr(Freshman) = 13/42,

– Pr(Woman) = 17/42

– Pr(Woman freshman) = 5/42.

• If a random selection chooses a woman, what is the probability she is

a freshman?

– Simple way: #women freshmen/#women = 5/17

– Using probability:

Pr(F | W ) = Πρ( Ω ∩ Φ )

Πρ( Ω ) = 5 / 42 17 / 42 = 5 17

Trang 7

Conditional Probability and Independence

• Fact: A and B are independent events iff Pr(A|B) = Pr(A)

• That is, knowing whether B is the case gives no information that would help determine the probability of A

• Proof:

A and B independent iff Pr(A)∙Pr(B) = Pr(A∩B)

Pr(A∩B) = Pr(A|B)∙Pr(B)

So as long as Pr(B) is nonzero,

Pr(A)∙Pr(B) = Pr(A|B)∙Pr(B) iff Pr(A) = Pr(A|B)

Trang 8

Total Probability

• Suppose (hypothetically!):

– Rick Santorum has a 5% probability of getting enough delegates to become the Republican nominee, unless the voting goes beyond the first ballot and there is a brokered convention

– In a brokered convention, Santorum has a 65% probability of winning the nomination

– There is a 7% probability of a brokered convention (cf Intrade.com)

• What is the probability that Santorum will be the Republican nominee?

Trang 9

Total Probability

Simple version: For any events A and B whose probability is neither

0 nor 1:

That is, Pr(A) is the weighted average of the probability of A

conditional on B happening, and the probability of A conditional

on B not happening

_

A

S

Trang 10

“Total probability” = weighted average of

probabilities

• Pr(Santorum|Brokered) = 65

• Pr(Santorum|¬Brokered) = 05

• Pr(Brokered) = 07

• Then Pr(Santorum) =

65∙.07 + 05∙.93 = 092

Trang 11

FINIS

Ngày đăng: 22/03/2019, 11:14