ANSWERS TO ACTIVITIES

 

TOPIC 15 - Learning About Models Using Bayes' Rule

 

ÝActivity 15-1

 

(a)

 

 

 

DATA

 

 

 

+

-

TOTAL

MODEL

Have Disease

 

 

 

 

Don't Have Disease

 

 

 

 

TOTAL

 

 

10,000

 

(d)

 

 

 

 

DATA

 

 

 

+

-

TOTAL

MODEL

Have Disease

 

 

10

 

Don't Have Disease

 

 

9990

 

TOTAL

 

 

10,000

 

(k)

 

 

 

DATA

 

 

 

+

-

TOTAL

MODEL

Have Disease

9

1

10

 

Don't Have Disease

999

8990

9990

 

TOTAL

1008

8991

10,000

 

(m)

 

 

 

DATA

 

 

 

+

PROPORTION

MODEL

Have Disease

9

9/1008 = .0089

 

Don't Have Disease

999

999/1008 = .9911

 

TOTAL

1008

1.0000

 

Activity 15-2

 

(a)Ý

 

 

COUNT

PROPORTION

MODEL

fair die

2700

.9

 

fixed die

300

.1

 

TOTAL

3000

1.0

 

(c) The fair dice:

NUMBER ON DIE

 

1

2

3

4

5

6

TOTAL

450

450

450

450

450

450

2700

 

(d) The fixed dice:

NUMBER ON DIE

 

1

2

3

4

5

6

TOTAL

100

100

100

0

0

0

300

 

(e)

 

 

 

NUMBER ON DIE

 

 

 

1

2

3

4

5

6

TOTAL

MODEL

fair die

450

450

450

450

450

450

2700

 

fixed die

100

100

100

0

0

0

300

 

TOTAL

 

 

 

 

 

 

 

 

(f) 450 + 100 = 550

 

(g) 450

 

(h) 450/550 = .818

 

(i) 150/550 = .182


Activity 15-3

 

The Bayes' box:

 

 

 

DATA

 

 

 

tagged

not tagged

TOTAL

 

one fish

250

0

250

MODEL

two fish

125

125

250

 

three fish

83

167

250

 

four fish

62

188

250

 

TOTAL

520

480

1000

 

If you observed a tagged fish, look only at the "tagged column":

 

 

 

DATA

 

 

 

tagged

PROPORTION

 

one fish

250

250/520 = .48

MODEL

two fish

125

125/520 = .24

 

three fish

83

83/520 = .16

 

four fish

62

62/520 = .12

 

TOTAL

520

1.00

 

Activity 15-4

 

The likelihoods:

 

data result = "not defective"

 

MODEL

PRIOR

LIKELIHOOD

0 defective

.7

1

1 defective

.1

.75

2 defective

.1

.50

3 defective

.05

.25

4 defective

.05

0

 

Computing posterior probabilities:

 

MODEL

PRIOR

LIKELIHOOD

PRODUCT

POSTERIOR

0 defective

.7

1

.7

.8358

1 defective

.1

.75

.075

.0896

2 defective

.1

.50

.050

.0597

3 defective

.05

.25

.0125

.0149

4 defective

.05

0

0

0

SUM

 

 

.8375

1.000

 

(f)      The model "4 defectives" is not possible -- has a probability of 0.

 

(g)     Using PRIOR, Prob(2 or fewer defectives) = Prob(0, 1, 2 defectives)Ý = .7 + .1 + .1 = .9

(h)     Using POSTERIOR, Prob(2 or fewer defectives) = Prob(0, 1, 2 defectives) = .8358 + .0896 + .0597 = 0.9851

 

ÝÝÝ Activity 15-5

 

Bayes' box after observing the data "D scored first":

 

MODEL

PRIOR

LIKE

PRODUCT

POSTERIOR

D wins

.6

21/29 = .724

.434

.798

P wins

.4

8/29Ý = .276

.110

.202

SUM

 

 

.544

1.000

 

ÝÝÝ Activity 15-7

 

(a)Ý

 

 

PRIOR

MODEL

white bag

.5

 

mixed bag

.5

 

TOTAL

1.0

 

(b)     Bayes' box:

 

 

 

DATA (ball drawn)

 

 

 

white

black

TOTAL

MODEL

white bag

150

0

150

 

mixed bag

75

75

150

 

TOTAL

225

75

300

 

Observe "white ball drawn"

 

 

NEW PROBS

MODEL

white bag

150/225 = .67

 

mixed bag

75/225 = .33

 

TOTAL

1.0

 

(c)     New ball drawn -- new prior probs of "white bag" and "mixed bag" are .67 and .33.

 

New Bayes' box:

 

 

 

DATA (ball drawn)

 

 

 

white

black

TOTAL

MODEL

white bag

200

0

200

 

mixed bag

50

50

100

 

TOTAL

250

50

300

 

 

Observe "white ball drawn"

 

 

NEW PROBS

MODEL

white bag

200/250 = ..8

 

mixed bag

50/250 = .2

 

TOTAL

1.0

 

(d)     New ball drawn -- new prior probs of "white bag" and "mixed bag" are .8 and .2.

 

New Bayes' box:

 

 

 

DATA (ball drawn)

 

 

 

white

black

TOTAL

MODEL

white bag

240

0

240

 

mixed bag

30

30

60

 

TOTAL

270

30

300

 

 

Observe "white ball drawn"

 

 

NEW PROBS

MODEL

white bag

240/270 = ..89

 

mixed bag

30/270 = .11

 

TOTAL

1.0

 

Activity 15-9

 

Example 1:

 

Likelihoods if Data = "Heads on coin"

 

MODEL

LIKELIHOOD

fair

1/2

two-headed

1

two-tailed

0

 

Likelihoods if Data = "Tails on coin"

 

MODEL

LIKELIHOOD

fair

1/2

two-headed

0

two-tailed

1

 

Example 2:

 

Four models are

 

MODEL

(0 men, 3 women)

(1 man, 2 women)

(2 men, 1 women)

(3 men, 0 woman)

 

Data result: "person chosen is male"

 

MODEL

LIKELIHOOD

(0 men, 3 women)

0

(1 man, 2 women)

1/3

(2 men, 1 women)

2/3

(3 men, 0 woman)

1

 

Data result: "person chosen is female"

 

MODEL

LIKELIHOOD

(0 men, 3 women)

1

(1 man, 2 women)

2/3

(2 men, 1 women)

1/3

(3 men, 0 woman)

0

 

Computation of posterior probabilities given data "person chosen is female"

 

MODEL

PRIOR

LIKELIHOOD

PRODUCT

POSTERIOR

(0 men, 3 women)

.25

1

.25

.5

(1 man, 2 women)

.25

2/3 = .67

.167

.334

(2 men, 1 women)

.25

1/3 = .33

.083

.166

(3 men, 0 woman)

.25

0

0

0

SUM

 

 

.5

1

 

Activity 15-12

 

 

 

DATA

 

 

HH

HT

TH

HH

TOTAL

MODEL

coin is fair

125

125

125

125

500

 

coin is two-headed

500

0

0

0

500

 

TOTAL

625

125

125

125

1000

 

Since we observe datum HH, focus on HH column of table:

 

 

 

DATA

 

 

 

HH

PROBABILITY

MODEL

coin is fair

125

125/625 = .2

 

coin is two-headed

500

500/625 = .8

 

TOTAL

625

1

 

So probability that coin is two-headed has increased from .5 to .8 after seeing HH.