Answered step by step
Verified Expert Solution
Link Copied!

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.

(20 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)(5 pts) Write a Matlab function montyhall_stay 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 1), 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 1(logical true), otherwise it should return 0(logical false).
(b)(10 pts) Write a Matlab function montyhall_switch 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 1), 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 randnum_reject() 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 1, otherwise it should return 0.
(c)(5 pts) Write a Matlab m-file montyhall_montecarlo.m that determines the probability of winning using each of the two strategies. Your program should simulate 100,000 different random realizations of the game using each different strategy (200,000 simulations in all). Your code should be general enough to work for n doors, where you specify n within the m-file. For each realization, there is a probability of 1n that the car is behind Door 1, a probability of 1n that the car is behind Door 2, 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 n=4.
3.(5 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 1, Door 2, or Door 3, with the other doors having goats behind them. There are also two different strategies: stay with Door 1, or switch doors. For example, suppose the car is behind Door 2. If you originally chose Door 1, Monty will open Door 3 to reveal a goat. If you switch, you switch to Door 2 and win the car. By completing the table given in MontyHallTable.txt determine the probability of winning if you stay with Door 1 and if you switch.
2
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.
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

Hands On Database

Authors: Steve Conger

1st Edition

013610827X, 978-0136108276

More Books

Students also viewed these Databases questions

Question

How is uncertainty in project scheduling dealt with?

Answered: 1 week ago