Question

INSTRUCTIONS: I NEED THE SOLUTION TO THE FOLLOWING QUESTION ON MATLAB SOFTWARE CODE. PROBLEMS#1 This problem...

INSTRUCTIONS:
I NEED THE SOLUTION TO THE FOLLOWING QUESTION ON MATLAB SOFTWARE CODE.

PROBLEMS#1
This problem is commonly known as the Monty Hall Problem and is based on Bayes’ Theorem. In this problem suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?

As I mentioned, I need solution to this question via a MATLAB code

Homework Answers

Answer #1

N=10000;%N number of trials
%Lets assume candidate always picks the door 1
DoorWithPrize=randi([1,3],N,1);%this is an N element array, where each element is the door with prize

%when we never switch door
ProbabilityNotSwitching = sum(DoorWithPrize==1)/N;
%when we always switch
%in this case, we will win only when the prize door is not 1
ProbabilitySwitching = sum(DoorWithPrize~=1)/N;

fprintf('After %d trials:\nProbability of winning when not switching: %f\nProbability of winning when switching: %f\n',N,ProbabilityNotSwitching,ProbabilitySwitching)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
1) The Monty Hall problem is a counter-intuitive statistics puzzle: - There are 3 doors, behind...
1) The Monty Hall problem is a counter-intuitive statistics puzzle: - There are 3 doors, behind which are two goats and a car. - You pick a door (call it door 1). You’re hoping for the car of course. - Monty Hall, the game show host, examines the other doors (2 & 3) and opens one with a goat. (If both doors have goats, he picks randomly.) Here’s the game: Do you stick with door A (original guess) or switch...
Suppose you’re on a game show, and you’re given the choice of three doors. Behind one...
Suppose you’re on a game show, and you’re given the choice of three doors. Behind one door is a car, behind the others, goats. You pick a door, say number 1, and the host, who knows what’s behind the doors. Opens another door, say number 3, which has a goat. He says to you, “Do you want to pick door number 2?” Is it to your advantage to switch your choice of doors?
(Monty Hall problem) Suppose you’re on a game show, and you’re given the choice of three...
(Monty Hall problem) Suppose you’re on a game show, and you’re given the choice of three doors, say Door 1, Door 2, and Door 3. Behind one door there is a car; behind the others, goats. Assume it is equally likely that the car is behind any door, i.e., P(D1) = P(D2) = P(D3). You will win whatever is behind the door you choose. (a) If you pick Door 1, what is your probability of winning the car? [2 point]...
MATLAB question dont change subject Give the matlab code for the following, i need to find...
MATLAB question dont change subject Give the matlab code for the following, i need to find the critical damping coefficient of a system User will enter mass and stiffness and the code will print the critical damping coefficient Give working code or else i will badly downvote
I need MATLAB code no handwritten solution required. Write a MATLAB script to solve the following...
I need MATLAB code no handwritten solution required. Write a MATLAB script to solve the following equations using the Cramer’s rule, and compare your results with MATLAB’s root finding method ( 25 pts. ). 8x1 − 2x2 − 1x3 = 5 − 2x1 + 9x2 − 4x3 − x4 = 2 − x1 − 3x2 + 7x3 − x4 − 2x5 = 1 − 4x2 − 2x3 + 12x4 − 5x5 = 1 − 7x3 − 3x4 − 15x5 =...
I've posted this question like 3 times now and I can't seem to find someone that...
I've posted this question like 3 times now and I can't seem to find someone that is able to answer it. Please can someone help me code this? Thank you!! Programming Project #4 – Programmer Jones and the Temple of Gloom Part 1 The stack data structure plays a pivotal role in the design of computer games. Any algorithm that requires the user to retrace their steps is a perfect candidate for using a stack. In this simple game you...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...
What tools could AA leaders have used to increase their awareness of internal and external issues?...
What tools could AA leaders have used to increase their awareness of internal and external issues? ???ALASKA AIRLINES: NAVIGATING CHANGE In the autumn of 2007, Alaska Airlines executives adjourned at the end of a long and stressful day in the midst of a multi-day strategic planning session. Most headed outside to relax, unwind and enjoy a bonfire on the shore of Semiahmoo Spit, outside the meeting venue in Blaine, a seaport town in northwest Washington state. Meanwhile, several members of...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT