Tokens and colors.

163 Views Asked by At

Here's the question:

On a table there are 2009 tokens which are black on one side and red on the other. A and B play by turns. In each turn it is permitted to remove any number of tokens of one color or flip any number of tokens of the same color. The one who removes the last token from the table wins the game. If A plays first, who has the winning strategy?

My approach:

Assumption: Before the game begins, all the tokens in the table are not of the same color.

It is self evident that the number of tokens of one of the colors in the game is odd. If A plays first and removes or flips some number of tokens of one color, say Black, B can, in his turn, always remove some red colors to end up with equal number of tokens in the table. By this fact, we can conclude that the game will at one point reach to a situation where one Token of Black and One token of red are all that's present on the table and it's A's turn to move. In this case, B has won the game.

Is this solution valid or not?

1

There are 1 best solutions below

1
On BEST ANSWER

Here's my solution:

Since there are an odd number of tokens, A can remove the more "popular" token color until there are an equal number of black and red tokens. Then, for whatever move B makes, there will be an unequal number again. A then continually removes tokens so that the number will be balanced at the end of their turn. Since A is always removing tokens, the game will eventually end, and A is the only one who can win (since there will always be an unequal number of red and black tokens after each of B's moves.