Question
Write a new test class called Simulation that allows you to run some simulations (play many games of computer versus computer) using various combinations of
Write a new test class called Simulation that allows you to run some simulations (play many games of computer versus computer) using various combinations of the threshold variable t for each player. A single simulated game need not print or return anything. Check to see how much each player loses or wins for each combination of thresholds after many games. Is it better to be the odd player? The even player? Does it matter? Better here means that if enough games are played there is a strategy (threshold) that one player can use that guarantees positive average outcome regardless of the other player's strategy. We call it a fair game if there is no such strategy for either player. By using the computer vs. computer option in your program set up some extended sessions of computer vs. computer to test different combinations of Player 1's t and Player 2's t (Hint: use a nested for loop structure to vary each player's threshold). Determine if either player has an advantage and if so which player it is and determine a threshold value t* that demonstrates the advantage. I have included a sample test class for this part called SimTest.
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