Fill This Form To Receive Instant Help

#### You have made it onto an episode of the game show "Let's Make a Deal", hosted by the infamous Monty Hall

###### Math

You have made it onto an episode of the game show "Let's Make a Deal", hosted by the infamous Monty Hall. In this round of the game, you are asked to select one of three doors—behind one of the doors is a brand new Ferrari, and behind the other two doors are goats.1 After you choose a door (the door remains closed), Monty will open one of the other doors and reveal a goat; i.e., at this stage, Monty will never reveal the car. You then have the opportunity to select the remaining door or stick with your original choice. Is it a better strategy for you to switch doors or not switch?
a) Suppose that you start out by selecting Door #1.
i. If the car is behind Door #1 and you decide to switch, do you win the car?
ii. If the car is behind Door #2 and you decide to switch, do you win the car? Explain your logic.
b) 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 simulation assumes that deciding to switch doors occurs with probability 0.50. The code stops at specifying the outcomes for when the car is behind Door #1. Complete the code for the outcomes when the car is behind Door #2 or behind Door #3.
c) Run the simulation and view the results.
#define parameters
replicates = 1000
num.doors = 3
#create empty vectors to store results
switch = vector("numeric", replicates)
wins = vector("numeric", replicates)
#set seed for a pseudo-random sample
set.seed(2020)
#simulate rounds of the game
for(k in 1:replicates){
car.door = sample(c(1:num.doors), size = 1) #assign the door the car is behind
switch[k] = sample(c(0, 1), size = 1) #choose whether to switch or not
outcomes if car is behind door 1
if(car.door == 1){

if(switch[k] == 1){wins[k] = 0}
if(switch[k] == 0){wins[k] = 1}
}

#outcomes if car is behind door 2
if(car.door == 2){

if(switch[k] == 1){wins[k] = 0}
if(switch[k] == 0){wins[k] = 1}
}

#outcomes if car is behind door 3
if(car.door == 3){if(switch[k] == 1){wins[k] = 0}
if(switch[k] == 0){wins[k] = 1}}}view the results