Question

In: Statistics and Probability

Two people are playing an exciting game in which they take turns removing marbles from a...

Two people are playing an exciting game in which they take turns removing marbles from a bag. At the beginning of the game, this bag contains some red marbles and some blue marbles. The bag is transparent so at any time during the game, the players know exactly how many red and how many blue marbles are in the bag.

The players alternate taking turns. On a player’s turn, he or she must remove some marbles from the bag. The player chooses which marbles to remove, under the condition that he or she remove at least one marble and the marbles removed in a single turn are all the same color. The player to remove the last marble from the bag during his or her turn wins.

Assume that player 1 is playing the game with player 2, and player 1 makes the first move. If you were player 1, what optimal strategy could you use to play this game? Under what starting conditions would this optimal strategy guarantee a win, and why? What can you say about the outcome of the game if these starting conditions are not met?

(Hint: Try thinking of an invariant you could maintain during certain points of the game)

Solutions

Expert Solution

let's say player one start the game and pick out some of the marbles from the bag now it's chance for player to to play suppose player to takes out any number of marble from the bag of a particular colour now the strategy to win the game is to balance the number of marbles in the bag colour wise that means at any point of time there must be equal number of marbles red and blue present in the back so when the chance came back for player 12 play he must take out the number of marbles in such a way that the colours in the bag remains balanced. So at the end let's see there is X number of red marble and X number of Y marble now since we are balancing the number of marbles at every step so we must ensure that we must pick the last marble of a particular colour and leave one marble for the player to of other colour to pick up hence in this way we can ensure to win every time.

It's a standard programming problem you can also find it's solution on YouTube.


Related Solutions

Consider a game in which two players, Fred and Barney, take turns removing matchsticks from a...
Consider a game in which two players, Fred and Barney, take turns removing matchsticks from a pile. They start with 21 matchsticks, and Fred goes first. On each turn, each player may remove either one, two, or three matchsticks. The player to remove the last matchstick wins the game. (a) Suppose there are only 5 matchsticks left, and it is Fred’s turn. What move should Fred make to guarantee himself victory? Explain your reasoning. (b) Suppose there are 10 matchsticks...
Suppose two players take turns playing another version of the parlor game discussed in class on...
Suppose two players take turns playing another version of the parlor game discussed in class on Tuesday. In this version, players can say any whole number between 1 and 10. The first person to get the running total to 25 wins. Do you want to go first or second? Figure out the optimal strategy for this game. Show your work. (b) (5 points) ECN-322 only for this part: Suppose two players take turns playing another version of the parlor game...
There are 21 pennies on a table between two players. The two players take turns removing...
There are 21 pennies on a table between two players. The two players take turns removing either 1, 2 or 3 pennies at a time. The player who takes the last penny loses. Use backward induction to come up with a strategy that the player who takes the second turn in the game can use to guarantee that she wins the game.
There are 100 coins in a jar. Two players take turns removing anywhere from 1-10 coins...
There are 100 coins in a jar. Two players take turns removing anywhere from 1-10 coins from the jar. The player who empties the jar by removing the remaining coin(s) wins the game. To guarantee that you win the game, would you choose to move first or second, and what strategy would you follow?
In a game of Tic Tac Toe, two players take turns making an available cell in...
In a game of Tic Tac Toe, two players take turns making an available cell in a 3 x 3 grid with their respective tokens (either X or O). When one player has placed three tokens in a horizontal, vertical, or diagonal row on the grid, the game is over and that player has won. A stalemate occurs when all the cells on the grid have been filled with tokens and neither player has achieved a win. Write a program...
In a game of Tic Tac Toe, two players take turns making an available cell in...
In a game of Tic Tac Toe, two players take turns making an available cell in a 3 x 3 grid with their respective tokens (either X or O). When one player has placed three tokens in a horizontal, vertical, or diagonal row on the grid, the game is over and that player has won. A stalemate occurs when all the cells on the grid have been filled with tokens and neither player has achieved a win. Write a program...
In a game of Tic Tac Toe, two players take turns making an available cell in...
In a game of Tic Tac Toe, two players take turns making an available cell in a 3 x 3 grid with their respective tokens (either X or O). When one player has placed three tokens in a horizontal, vertical, or diagonal row on the grid, the game is over and that player has won. A stalemate occurs when all the cells on the grid have been filled with tokens and neither player has achieved a win. Write a program...
You and a friend are playing a game. You alternate turns rolling a single die, and...
You and a friend are playing a game. You alternate turns rolling a single die, and the first person to roll a 1 or a 2 wins. Your friend goes first. a. What’s the probability that the game ends in three rolls or fewer? b. What’s the expected number of rolls? c. What’s the probability that your friend wins?
(Go go gadget problem solver!) Joe, Bill, and Fred are playing a game with marbles at...
(Go go gadget problem solver!) Joe, Bill, and Fred are playing a game with marbles at the top of an uncarpeted (wooden) staircase. They decide to try to roll their marbles off the top step and see how many steps the marble will skip before hitting. The faster they roll the marbles, the farther down the staircase the marble will go before hitting a step. Suppose one of these marbles leaves the floor at the top of the staircase at...
Two people play the game of Count 21 by taking turns entering a 1, 2, or...
Two people play the game of Count 21 by taking turns entering a 1, 2, or 3, which is added to a running total. The player who adds the value that makes the total reach or exceed 21 loses the game. Create a game of Count 21 in which a player competes against the computer, and program a strategy that always allows the computer to win. On any turn, if the player enters a value other than 1, 2, or...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT