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

  How virtual memory relies on locality of reference principle

TLB entries are different than page table entries. Describehow they differ and why they differ. Virtual memory relies on a locality of reference principle. Describe.

  Individual traffic light has at least three states (g.y,r)

Consider a traffic light system at a four-way crossroads (two roads intersecting at right angles) with a countdown timer, a crosswalk button, and a speaker that announces it's ok or not ok to walk

  Design an e?cient algorithm to handle a sequence

Design an e?cient algorithm to handle a sequence of such operations.

  Information culture have negative impact on apple-s business

Which of the given information cultures would have the greatest negative impact on Apple's business? Information-functional culture, Information-sharing culture.

  Write a program that reads a string

Write a program that reads a string and outputs the number of times each lowercase vowel appears in it

  Lists the five different it systems identified

Create a diagram using Visio that lists the five different IT systems you identified

  1.what is the value of the following instruction?

1.What is the value of the following instruction? mov al,01101011b shr al,22.What is the two's complement of the binary number 11010000?3.Which statement defines an array local variable consisting 40 signed words?

  Line of developmental training and inspirational materials

The Becoming Company is a full service provider for a line of developmental training and inspirational materials including videos, music, and books called Drive Change.

  How many threads will you create to perform the input

Given: A system with two dual-core processors has four processors available for scheduling. A CPU-intensive application is running on this system. All input is performed at program start-up, when a single file must be opened. Similarly, all output is..

  Access and control of personal information

In debates regarding access and control of personal information, it is sometimes argued that an appropriate balance needs to be struck between individuals and organizations

  Show how an assembly might replace this pseudo-instruction

show how an assembly might replace this pseudo-instruction with the true instructions to achieve the same effect. You solution must observe MIPS register use conventions.

  What is the output of the following loop

What is the output of the following loop

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