Design and implement a simulation experiment


Consider the following game between two players: Both players simultaneously declare "one" or "two". Player 1 wins if the sum of the two declared numbers is odd and Player 2 wins otherwise. In either case the loser in obliged to pay the winner (in dollars) the sum of the two declared numbers. So Player 1 may lose 2 or 4 dollars and may win 3 dollars.

Write a computer program in Java that allows a user to play this game against a computer and also allows the computer to play against itself. The computer's strategy will be as follows. A computer player will have a threshold variable associated with it called t that is between 0 and 1.

The computer will generate a random number between 0 and 1. If the number is greater than t the computer will declare "two" if the random number is less than t the computer will declare "one". If both players are computers then each computer player will have its own threshold variable. At the end of each round, report the amount of money each player has won or lost so far during the session. At the end of each round ask the user if another round should be played.

Design and implement a simulation experiment that will answer the following question: Is this a fair game? That is, in the long run should we expect each player's balance to be close to zero or is there a strategy that leads to a positive balance for one player no matter what the other player does. 

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Design and implement a simulation experiment
Reference No:- TGS097210

Expected delivery within 24 Hours