Docsity

Bayes Theorem with Examples - Lecture Slides | ECE 303, Study notes of Electrical and Electronics Engineering

Partial preview of the text

Download Bayes Theorem with Examples - Lecture Slides | ECE 303 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Department of Electrical & Computer Engineering

Remark: The total probability is still valid even if the union of B

n^

does

not equal S, provided that

N U n^

n B

A

Bayes’ Theorem: Recall that conditional probability applies to any two events,

(^

B

P

B A P B A P

,^

(^

B

P

and

(^

A

P

B

A

P

A

P

A B P A B P

,^

(^

A

P

Department of Electrical & Computer Engineering

Thus we can write,

(^

A

P

B P B A P A B P

… Bayes’ Theorem

where, P(A | B) =

A priori

conditional probability measured from experiments

P(B | A) =

A posteriori

conditional probability that

cannot be measured from experiments

Generally if B

’s, nn

[1, N], are mutually exclusive events

exhausting set S, i.e., containing all possible outcomes of an experiment. Then,

(^

A

P

n B P n B A P A n B P

,^

]

[^

N

n^

Department of Electrical & Computer Engineering

P(A | B

) = “n^

A priori

” conditional probability estimated from

past measurements or pre-supposed experience (before the experiment is performed)

P(B

) = “n^

prior

” probability of B

n

Example 1:

In the resistor example in Lecture 4, find theprobability that the resistor selected had 5%tolerance, given it was 22

, using Bayes’ theorem.

(^

1

1

1

D

P

B P B D P D B P P

Solution:

Department of Electrical & Computer Engineering

Example 2:

A fair coin is tossed. If it comes up heads, a singledie is rolled. If it comes up tails, two dice are rolled.Given that the outcome of the dice is 3, but we don’tknow if one or two dice were rolled, find the prob.that the coin come up heads.

Solution:

(^

P

H P H P H P

(^

H

P

and

H

P

1.^2

]

[{(

(^

T P T P H P H P P

Thus,

(^

H

P

Department of Electrical & Computer Engineering

7

We want

Solution:

] 1

[^

Y

X

P

Prob. of one transmitted, given Y = 1 received

Using Bayes’ rule,

] 1

[

] 1

[

] 1

[^

Y

P

Y X P Y X P

] 0

[

] 0

[

] 1

[

] 1

[

] 1

[

] 1

[

X P X Y P X P X Y P

X

P

X

Y

P 0

1

1 )

(^1) (

P

P

P

β

β β

For a noiseless channel,

β

= 0. Thus,

P[X = 1| Y = 1] = 1

Department of Electrical & Computer Engineering

Example 4:

Suppose there exists a fictitious test for cancer withfollowing properties. Let

: Event that the test states that tested person has cancer.: Event that person has cancer.: Event that the test states that person is free from cancer.: Event that person is free from cancer. A B A B

]

[^

B

P

It is known that

and (^95). 0 ] | [ ] |

[^

B A P B A P

Is the test a good one?^ In other words, determine the likelihood that a person has^ actually cancer if the test so states, i.e., P[B | A], where A^ is a conditioning event, which says that person has cancer^ according to the test.

Department of Electrical & Computer Engineering

You're on a game show hosted by Monty Hall.

There are three doors: behind one door is a newcar. You are asked to pick a door. Then, Montyopens one of the other two doors to show youthat there is no car behind it (note that he knowsexactly which door has the car). Monty thengives you the choice of either staying with youroriginal choice or switching to the remainingdoor. What should you do? Does it matter?

Example 5:

Department of Electrical & Computer Engineering

11

•If the prize is indeed behind door 1, the host is free to pickbetween doors 2 and 3 with•If the prize is behind door 2, the host must pick door 3 with•In case the prize is behind door 3, the host must pick door 2.Hence,

.Using total probability

Solution:

(^3) / 1 ) ( ) ( )

(^

3

2

1

=

=

=

A P A P A P

Let us define events of the prize behind doors 1,2 and 3 by

3 2 1

,^

A

A

A

Assume you picked door 1 and define the event

the door Monty

opens.

B

1 )

| 3

(^

2

Initially equally likely:

=

=

A

door

B P

(^2) / 1 ) | 3

(^

1

=

=

A

door

B P

0 ) | 3

(^

3

=

=

A

door

B P

= + = = = =

3 1

(^2) / 1 (^3) / 1 ) 3 / 1 )( 2 / 1 ( ) ( ) | 3 (

) 3

(

i

i

i^

A P A

door B P

door B P

Department of Electrical & Computer Engineering

Independent Events: Events A and B are said to be “statistically independent” if

(^

A

P

B

A

P

i.e., the prob. of event A is the same whether event B has occurred or not. Thus the equivalent condition is

(^

A

P

B

P

B A P B A P

(^

B P A P B A P

i.e., their joint probability is equal to the product of theirindividual probabilities. Note that statistical independenceassumes

B

A

Department of Electrical & Computer Engineering

Generalization: N events, A

, nn

[1, N] are said to be statistically independent

if the following conditions apply,

(^

m A P n A P m A n A P

]

[

,^

N

n m

n

m

(1)

(^

k A P m A P n A P k A m A n A P

(^

2

1

1

N

N n

n^

A P A P A P A P

L

I

=

(2)

Department of Electrical & Computer Engineering (a) From the diagram,

Solution:

(^

A

P

(^

B

P

and

(^

B

A

P

But,

(^

B P A P B A P

i.e., they are statistically independent events. (b) From corollary 3,

(^

B A P B P A P B A P

Department of Electrical & Computer Engineering

Combined Experiments: A combined experiment is formed of multiple experiments with outcomes in different universal sets S

, S 1

, … S 2

. The outcomesN

of the combined experiment consist of a set of N-tuple (an ordered set of N elements) in S=S

× 1

S

×

S

.N

For example, Experiment 1 is tossing a fair coin and Experiment 2 is rolling a fair die.

S

={H,T} and S 1

And, combined experiment has outcomes in

S=S

1

×

S

={(H,1),(T,1),(H,2), ….(T,6)} 2

Typically, we assume the experiments are independent which allows finding probability of a combined event A= A

× 1

A

2

as Pr(A)=Pr(A

× 1

A

)=Pr(A 2

).Pr(A 1

Department of Electrical & Computer Engineering

A particular sequence of occurrence (combined event)is

L A A A A A A

A

A

A

A occurred k times,

occurred N – k times. A

Then,

L

L

(^

A P A P A P A A A P

… Due to statistical independence.

[^

]^

[^

]^

k N

k^

A

P

A

P

−

k N

k^

p

p^

−

Obviously, there are other sequences, which yield k events Aand N – k events

, each having the same prob. Using

combinatorial analysis, the number of such sequences is

A

Department of Electrical & Computer Engineering

k

N k

N

N k

⎛^ ⎜ ⎝

Binomial Coefficient

Recall that

n! = n (n – 1) … 1

and

Now, since the sum of all such probabilities will be desired probability of A occurring exactly k times in N trials, as they are independent,

{^

}^

k N

k^

p

p N k

P

−

k times

exactly

occurs A

which is known as “binomial distribution”.