In the popular television game show of the 70s, Let's Make a Deal, game show host, Monty Hall, would show a contestant 3 doors. Behind one of the doors was a prize and the contestant would have to guess which one it was. Once the contestant made a guess which door led to the prize, Monty Hall would open of the other doors showing that the prize was not behind it. The contestant then had the opportunity of changing his or her guess or sticking to the original guess. Monty Hall would then open the door that concealed the prize.
The common place belief was that there was no real advantage in changing one's guess. The reasoning went as follows: since one of the doors was eliminated, the prize would be behind one of the two remaining doors, i.e. the probability of if being behind the door the contestant guessed was 0.5. The probability of the prize being behind the other door was also 0.5. So the prize being behind one of the two doors was just as likely as being behind the other door. It did not make sense to switch.
In 1990, a reader of Parade magazine, wrote to Marilyn vos Savant asking her what the best strategy would be to play this game. Her advice was, that no matter what the initial guess was, to switch. You should read all the comments that other readers sent her including college professors berating her for her suggestion. But subsequent analysis has shown that she was right.
In this programming assignment you are going to simulate the game show and demonstrate that indeed Marilyn vos Savant gave sensible advice. The following describes the steps that you will be taking:
A sample session and output will look as follows:
Enter number of times you want to play: 10 Prize Guess View New Guess 2 2 3 1 1 3 2 1 1 1 2 3 3 1 2 3 3 1 2 3 3 1 2 3 2 2 3 1 2 1 3 2 3 2 1 3 2 1 3 2 Probability of winning if you switch = 0.70 Probability of winning if you do not switch = 0.30Your output must be in the above format. The column headers and numbers must be printed as shown. The probabilites are expressed correct to 2 places of decimal. You can use the round() function to do so.
For this assignment you may work with a partner. Both of you must read the paper on Pair Programming. .
Your program should have a good, clean logical structure. You must print out the results in the format specified. We will be looking at good documentation and descriptive variable names. Your file Deal.py will have the following header:
# File: Deal.py # Description: # Student Name: # Student UT EID: # Partner's Name: # Partner's UT EID: # Course Name: CS 303E # Unique Number: # Date Created: # Date Last Modified:
If you are working with a partner both of you will be submitting identical programs but make sure that you have your partner's name and eid in your program. If you are working alone, then remove the two lines that has partner's name and eid in the header.
Use the turnin program to submit your Deal.py file. The proctors should receive your work by 11 PM on Tuesday 15 October 2013. There will be substantial penalties if you do not adhere to the guidelines.