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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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