Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Let's use a simulation to investigate how often we would win the game if we decided to switch doors half the time ( i .

Let's use a simulation to investigate how often we would win the game if we decided to switch doors half the time (i.e., with probability 0.50) when playing many rounds of the game. The simulation shown in the template is used to simulate 1,000 rounds of the game in which you initially select Door #1. The vector switch records whether you decide to switch, while the vector wins records whether you win the car. The value 1 in switch represents deciding to switch and the value 1 in wins represents a win. The sample() function is used so that switch has value 1 half the time.
b) The code stops at specifying the outcomes for when the car is behind Door #1. Complete the code by specifying how outcomes should be assigned if the car is behind Door #2 or Door #3.
c) Run the simulation and view the results.
i. Based on the simulation results, what is the approximate overall probability of winning with this strategy of switching doors 50% of the time?
ii. Based on the simulation results, is it a better strategy to always switch doors or always
not switch? Explain your answer, referencing relevant numerical results.
d) Using an algebraic approach, calculate the probability of winning by always switching doors.
Let Ws represent the event of winning by always switching doors. It may be helpful to define the events of the car being behind Door #1, Door #2, or Door #3 as D,, D2, and D3, respectively, and to suppose that you initially select Door #1.
replicates -1000
num.doors -3
#create empty vectors to store results
switch - rep(NA, replicates)
wins - rep(NA, replicates)
#set seed for a pseudo-random sample
set.seed(2020)
#simulate rounds of the game
for(k in 1:replicates){switch[k]- sample(c(0,1), size =1) #choose whether to switch or notif(car, door ==1){ if(switch[k]==0){wins[k]-1}#outcomes if car is behind door 2#outcomes if car is behind door 3}
#view the resultse) Consider a modification of the game in which you are asked to select from one of four doors, where one door leads to a car and the others lead to goats (all other aspects of the game remain the same; Monty will only open one door and that door must lead to a goat). Calculate the probability of winning by always switching doors and compare this to the probability of winning by never switching doors.
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions

Question

=+2. Explain the interactions in the newspaper and magazine market!

Answered: 1 week ago