For Homework #6, Problem 1, you calculated the probability of each player winnin
ID: 3681130 • Letter: F
Question
For Homework #6, Problem 1, you calculated the probability of each player winning in a marble color matching game as shown below. 1) 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 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) What is the probability that each of the players will win the game? Let Bi color of ball drawn by Player i; B.. color of ball drawn by host Prob ( Player l wins) = Prob (BI =BO) = 1/3 Prob ( Player 2 wins) = Prob ( Player 1 loses AND (B2 = B0 or E31 )) = (2/3) (2/3) = 4/9 Prob ( Player 3 wins) Prob (( Player l and Player 2 both lose) AND (B3 = B0 or B1 or B2)) = ( 1-( 1/344/9)) (3/3) = (2/9) ( 1 ) = 2/9 b) Will there always be a winner? Yes, there is always a winner, 1/3 + 4/9 + 2/9-9/9 1. Conceptually, if Player 3 gets a turn, three balls have been drawn without a match, so B3 must match one of them. Now, You will now develop a computational simulation of a generalized version of this game. Please use JAVA Programming language to write the code.Explanation / Answer
Please find below the source code for this game:
MastermindApplet.java:
ColourPanel.java:
DropList.java:
MessageBox.java:
PNZAnswer.java:
PNZColours.java:
ResultsCanvas.java:
TrueFalse.java:
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.