Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Develop a computational simulation of a generalized version of this game. Please

ID: 3681450 • Letter: D

Question

Develop a computational simulation of a generalized version of this game. Please use JAVA Programming language to write the code for the below game. A game is designed for a host and three players, each has a bag containing three different color marbles. The host begins the game by drawing one marble from his/her bag. Player 1 then draws a marble from his/her bag and wins the game if the color matches the host's marble. If Player 1 does not win, Player 2 draws a marble from his/her bag and wins if the color matches either of the two previous marbles. If there is still no winner, Player 3 draws a marble from his/her bag and wins if the color matches any of the three previous marbles. (A) Develop a computational solution (spreadsheet or program) to calculate the likelihood of each player winning the game. Your simulation should allow you to vary the number of players (2-6) and to specify the number of marbles of each color in the bags. The number of colors will always equal the number of players. Simulate a total of 5000 trials (games), generating a table summarizing the percentage of games won by each player after various number of games. (Choose a reasonable number of cases for which to generate the table; do not print results after each of the 5000 trials.) (B) Execute your simulation for the following three conditions: (1) 3 players, I marble of each color (2) 3 players, 10, 20, and 30 marbles for the three different color, and (3) 6 players, 10 marbles eaclh of three colors and 20 marbles each of the other three colors.

Explanation / Answer

this consists of three classes

pile:

player :