Answered step by step
Verified Expert Solution
Question
1 Approved Answer
( 2 0 pts ) When playing Let's Make A Deal game, the contestants would no doubt prefer to win a car than a goat.
pts When playing "Let's Make A Deal" game, the contestants would no doubt prefer to win a car than a goat. Let's use Matlab to test whether it is more advantageous, from a probabilistic standpoint, to stay with the first door or to switch to a different door which Monty didn't open.
a pts Write a Matlab function montyhallstay that implements a single round of the "Let's Make A Deal" game where the contestant sticks with their original door. Your function should pick the contestant's door for simplicity, you may always choose door and uses your randnum function to choose which door the car is behind. If the car door matches the contestant's door your function should return logical true otherwise it should return logical false
b pts Write a Matlab function montyhallswitch that implements a single round of the "Let's Make A Deal" game where the contestant switches their door. Your function should pick the original contestant's door for simplicity, you may always choose door and use your randnum function to choose which door the car is behind. It should then choose which door Monty Hall shows the contestant your randnumreject function will be useful here Remember, he won't show the door the contestant picked or the door the car is behind. Then, your function should choose the contestant's final door which will not be the original door or the door Monty shows them If the car door matches the contestant's final door your function should return otherwise it should return
c pts Write a Matlab mfile montyhallmontecarlo.m that determines the probability of winning using each of the two strategies. Your program should simulate different random realizations of the game using each different strategy simulations in all Your code should be general enough to work for doors, where you specify within the mfile. For each realization, there is a probability of that the car is behind Door a probability of that the car is behind Door etc. for every door. Keep track of how many times you win for each strategy. The estimate for the probability that you win the car for a given strategy is equal to the number of times you won divided by the total number of tries. Your program's output should be clear enough that we can tell which probability corresponds to the "stay strategy" and which corresponds to the "switch strategy". Doing simulations like this to estimate probabilities is known as the Monte Carlo method.
Please turn in code with
pts We can also solve this problem exactly, for the three door case. There are three equally probable arrangements: the car could be behind Door Door or Door with the other doors having goats behind them. There are also two different strategies: stay with Door or switch doors. For example, suppose the car is behind Door If you originally chose Door Monty will open Door to reveal a goat. If you switch, you switch to Door and win the car. By completing the table given in MontyHallTable.txt determine the probability of winning if you stay with Door and if you switch.
Please turn in the completed table and a short explanation of how you determined the probabilities and which strategy you should use; submit this as a file called MontyHallTable.txt
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started