Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Understanding Bayes Theorem: Solving Problems with Monty Hall and Disease Detection - Prof, Study Guides, Projects, Research of Electrical and Electronics Engineering

Solutions to two problems that illustrate the application of bayes' theorem. The first problem is the monty hall problem, where the goal is to find the probability of a car being behind the chosen door given that a goat has been revealed. The second problem deals with testing for a disease, where the objective is to find the probability of an individual having the disease given that they have tested positive. The document also includes instructions for verifying the results through computer simulation.

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 08/19/2009

koofers-user-l5e-1
koofers-user-l5e-1 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Understanding Bayes Theorem
Random Signals and Noise (EE 326)
Introduction
The purpose of this assignment is to understand Bayes’ Theorem and to use it to find conditional probabilities of
events. Additionally, we will verify the results of applying Bayes’ Theorem by computer simulation, showing that
Bayes’ Theorem is in fact accurate, despite the counter-intuitive results that it sometimes gives. Bayes’ Theorem is
defined as:
p(A|B) = p(B|A)p(A)
p(B)(1)
Problem 1: The Monty Hall problem
Suppose you are a game show contestant, and you presented with three doors. A “prize” is behind each door, and you
will be given the prize that is behind the door that you choole. Behind one of these doors is a new car; goats are behind
the other two. The probability of the car being behind any given door is uniform and equal to 1
3After choosing a door,
the host of the game show reveals one of the other doors. Because the host knows where the car is, he will always
reveal a goat. You are asked if you want to change your selection to the other remaining door.
(a.) Without doing any computations, do you believe that choosing to switch/stay makes any difference? If so what do
you choose?
(b.) Using Bayes’ Theorem, compute the probability that there is a car behind the door that you chose. (Hint: Using
SC to represent the event that you have selected a car and GR to represent the event of a goat being revealed, you
are computing p(SC |GR).) Using the total probability theorem, compute the probability that the car is behind the
remaining door. Does this change your answer?
(c.) Suppose that for some reason, the host does not have knowledge of the car’s location and randomly chooses
to reveal one of the remaining doors. Supposing a goat is revealed, compute the probability that the door you selected
contains a car and the probability that the remaining door contains a car. Does it matter which door you pick? If so,
which one do you pick? (Hint: p(GR)has changed)
(d.) Verify your results in parts b and c by simulation. In both cases, use a sample size of 1,000, and randomly
select which door the car is behind and which door you initially choose.
In the case of part b, if the car is selected, have the host randomly choose reveal one of the remaining doors. If the car
is not selected, have the host choose the remaining door that contains the goat. Record the number of times the car is
behind the chosen door and the number of times it is behind the remaining door. Does this simulation support your
findings?
In the case of part c, have the host randomly choose reveal one of the remaining doors. Record the number of times
the car is behind the chosen door, the number of times it is behind the remaining door, and the number of times that
the car is revealed. Does this simulation support your findings?
Problem 2: Testing for a Disease
Suppose that there exists a disease that affects 1% of a population. A test exists to detect this disease. If an individual
has the disease, the test will return a positive result with probability .95. When applied to individuals who do not have
the disease, this test will return a positive result with probability .02.
(a.) Without doing any computations, make a guess at the probability that someone has the disease given that they
1
pf2

Partial preview of the text

Download Understanding Bayes Theorem: Solving Problems with Monty Hall and Disease Detection - Prof and more Study Guides, Projects, Research Electrical and Electronics Engineering in PDF only on Docsity!

Understanding Bayes Theorem

Random Signals and Noise (EE 326)

Introduction

The purpose of this assignment is to understand Bayes’ Theorem and to use it to find conditional probabilities of events. Additionally, we will verify the results of applying Bayes’ Theorem by computer simulation, showing that Bayes’ Theorem is in fact accurate, despite the counter-intuitive results that it sometimes gives. Bayes’ Theorem is defined as:

p(A|B) =

p(B|A)p(A) p(B)

Problem 1: The Monty Hall problem

Suppose you are a game show contestant, and you presented with three doors. A “prize” is behind each door, and you will be given the prize that is behind the door that you choole. Behind one of these doors is a new car; goats are behind the other two. The probability of the car being behind any given door is uniform and equal to 13 After choosing a door, the host of the game show reveals one of the other doors. Because the host knows where the car is, he will always reveal a goat. You are asked if you want to change your selection to the other remaining door.

(a.) Without doing any computations, do you believe that choosing to switch/stay makes any difference? If so what do you choose?

(b.) Using Bayes’ Theorem, compute the probability that there is a car behind the door that you chose. (Hint: Using SC to represent the event that you have selected a car and GR to represent the event of a goat being revealed, you are computing p(SC|GR).) Using the total probability theorem, compute the probability that the car is behind the remaining door. Does this change your answer?

(c.) Suppose that for some reason, the host does not have knowledge of the car’s location and randomly chooses to reveal one of the remaining doors. Supposing a goat is revealed, compute the probability that the door you selected contains a car and the probability that the remaining door contains a car. Does it matter which door you pick? If so, which one do you pick? (Hint: p(GR) has changed)

(d.) Verify your results in parts b and c by simulation. In both cases, use a sample size of 1,000, and randomly select which door the car is behind and which door you initially choose. In the case of part b, if the car is selected, have the host randomly choose reveal one of the remaining doors. If the car is not selected, have the host choose the remaining door that contains the goat. Record the number of times the car is behind the chosen door and the number of times it is behind the remaining door. Does this simulation support your findings? In the case of part c, have the host randomly choose reveal one of the remaining doors. Record the number of times the car is behind the chosen door, the number of times it is behind the remaining door, and the number of times that the car is revealed. Does this simulation support your findings?

Problem 2: Testing for a Disease

Suppose that there exists a disease that affects 1% of a population. A test exists to detect this disease. If an individual has the disease, the test will return a positive result with probability. 95. When applied to individuals who do not have the disease, this test will return a positive result with probability. 02.

(a.) Without doing any computations, make a guess at the probability that someone has the disease given that they

tested positive?

(b.) Using Bayes’ Theorem, compute the probability that an individual has the disease given that they tested posi- tive. (Hint: use the fact that p(B) = p(A)p(B|A) + p(A)p(B|A))

(c.) Verify your results in part b by simulation. For a population of 10,000, assign the disease to individuals with probability .01. Give a positive test result with probability .95 to individuals with the disease and probability .02 to in- dividuals without the disease. Of the individuals who tested positive, count the number who actually have the disease. Does this simulation support your findings?