Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code in R studio In the Monty Hall problem, there are 3 doors, and only 1 of them contains a prize behind them (it is

Code in R studio

image text in transcribed

In the Monty Hall problem, there are 3 doors, and only 1 of them contains a prize behind them (it is equally likely for the prize to be behind any of the 3 doors). A volunteer selects one of the doors at random. If the selected one contains the prize, 1 of the other 2 doors without the prize will be revealed; if the selected one does not contain the prize, the other door without the prize will be revealed. The volunteer then decides whether to switch away from the original choice of door. If the final choice contains the prize, the volunteer wins and takes the prize. First, consider the strategy of switching. We want to consider using simulation to approximate the winning probability under this strategy. One way to do this is as follows: - Generate a vector of length 3 to simulate the doors, where only one entry is 1, representing the prize; and two other entries are 0 , representing no prize. - Wlog, you can always select the first door in your first selection. - If your first selection contains the prize, i.e. is 1 , then randomly remove any of the two other entries; if your first selection does not contain the prize, i.e. is 0 , then remove the other 0 entry. - Based on the two entries remaining, decide whether you won or not under the current strategy. - Repeat the above process B times, where B is a large integer, for example 1e6. - Examine the percentage of wins out of the B repetitions. This percentage would be an approximation to the winning probability. Grading Method The grading of this assignment will be based on: Completion. Submissions that are empty or did not show sufficient efforts will receive 0 . Submissions that showed significant efforts will receive the full amount of points (corresponding to the instructions of the question). Tasks for this Assignment (a) (8 points) Conduct the simulation to determine the probability under the strategy: Switching. Then conduct the simulation to determine the probability under the strategy: Staying with original choice. (b) (2 points) Report is in the required format, and within the required length (see the beginning of this assignment)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management With Website Development Applications

Authors: Greg Riccardi

1st Edition

0201743876, 978-0201743876

More Books

Students also viewed these Databases questions