Write a function to simulate the game show problem

Assignment Help Basic Computer Science
Reference no: EM13806956

You are a contestant on a game show and have won a shot at the grand prize. Before you are three doors. $1,000,000 in cash has randomly been placed behind one door. Behind the other two doors are the consolation prizes of dishwasher detergent. The game show host asks you to select a door, and you randomly pick one. However, before revealing the prize behind your door, the game show host reveals one of the other doors that contains a consolation prize. At this point, the game show host asks if you would like to stick with your original choice or to switch to the remaining door.

Write a function to simulate the game show problem. Your function should randomly select locations for the prizes, select a door at random chosen by the contestant, and then determine whether the contestant would win or lose by sticking with the original choice or switching to the remaining door. You may wish to create additional functions invoked by this function.

Next, modify your program so that it simulates playing 10,000 games. Count the number of times the contestant wins when switching versus staying. If you are the contestant, what choice should you make to optimize your chances of winning the cash, or does it not matter?

Reference no: EM13806956

Questions Cloud

Prepare a statement of annual cash flows for years : THE FINAL PROBLEM IS A CALCULATION PROBLEM with multiple parts Frozen Turkeys Scenario Cost of Land  $ 200,000 Cost of Buildings & Equipment $ 350,000 MACRS Class 20 Life of Project (Years) 5 Terminal Value of Land $300,000 Terminal Value of Building..
Using probability sampling techniques. : What can you do if you just cannot use a probability sampling technique? (For example, suppose there is no good sampling frame available for the population of interest.)
Advantages and disadvantages of broadcasting the ssid : The access point (AP) may be configured to broadcast or not to broadcast the SSID (Service Set Identifier). Determine the advantages and disadvantages of broadcasting the SSID. Explain whether or not you would broadcast your SSID.
Approaches to ethical decision-making most : Which of the basic approaches to ethical decision-making most closely matches your approach for dealing with ethical dilemmas?
Write a function to simulate the game show problem : Write a function to simulate the game show problem. Your function should randomly select locations for the prizes, select a door at random chosen by the contestant, and then determine whether the contestant would win or lose by sticking with the o..
The standard deviation of the jewelry store''s profit issues : What is the probability (rounded to the nearest ten thousandth) that both cards are diamonds?
Websites for open source databases : Review the following websites for open source databases, such as PostgreSQL and MySQL Identify the open source databases back-up and recovery strategies Address the major differences in database back-ups and recovery between open source databases and..
Identifies the business processes and requirements : Finalize the 7- to 10-page executive summary of the project that identifies the business processes and requirements that have been identified for improvement
Write a paper about the saudi national dish : Write a paper about The Saudi National Dish.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Assess new technologies and the benefits the technologies

Write a document that will assess new technologies and the benefits the technologies will bring to an organization.

  Discusses six reasons why proper forensics protocols

Using at least 500 words - summarize the article. The author discusses six reasons why proper forensics protocols must be followed when collecting computer evidence - can you think of any other reasons

  E-books distributor

You are a linguistic working at an e-books distributor. Your management has interest in finding out if commonly used words used in a book make the books more popular, therefore more books would be sold if the number of commonly used words in the book..

  Prepare a script to go along with the slide presentation

Prepare a script to go along with the slide presentation that could be read to provide an in-depth discussion of the topics highlighted on the slides. Research the topics above, using your textbook, information provided in class, and resources pro..

  Assess the ease of use and efficiency of using both the

evaluate the ease of use and efficiency of using both windows and unix file management systems. of the two file

  Describe the five forces model

Describe the Five Forces Model. What role does the Five Forces Model play in decision making? Define a database management system and discuss each of the five important software components of a database management system.

  How code function that multiplies two matrices using matlab

How to code a function that multiplies two matrices using MATLAB?

  The processing of the reference scheme

Page faults occur during the processing of the reference scheme? The hit ratio is for each of the following policies in a pure demand paging system? What do you observe when you move from Scheme 1 to Scheme 2? Explain.

  Typical features of organisational culture

Explain which of these aspects of your organisation you like in their present form, which you would change and your recommendations for an intervention to bring about that change.

  Write down differences in company policies of firm

For Firm ABC, each of the relations is in 3NF. Write down two differences should exist in company policies of Firm ABC? Explain your answer.

  Create a web page online reservation system

create a web page online reservation system. (feedback page and package pake )

  Average memory access time for load data

Compute the average memory access time for load data reference in this new con?guration?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd