Question
Write a program in Java that does a simulation of the Lets Make a Deal game. The program will take as input the number of
Write a program in Java that does a simulation of the Lets Make a Deal game. The program will take as input the number of simulations to be done. The game is simply choosing a door from 3 options, one of which has a prize behind it. Each simulation will require you to randomly generate a prize behind a door (door 0, door 1, or door 2). Next, the player randomly chooses a door (again door 0, 1, or 2). The simulation will then reveal a door that does not contain the prize. Then the player will follow two different strategies. Either stick to the door they currently have picked, or switch to the other door (there is only one that has not been revealed and is not the one they currently have). The player wins if at the end of the game the door they currently have matches the prize door. Keep track of how many times the player won employing both strategies (stay or switch). Calculate the average amount of games won for each strategy.
Due to the use of random numbers your outputs may vary but the trending towards 1 and 2 33
should happen.
Enter the number of simulations to be run: 1000 Stay win average = 0.344 Switch win average = 0.656
Enter the number of simulations to be run: 100000 Stay win average = 0.33553 Switch win average = 0.66447
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started