All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Games
Who will win? (Posted on 2005-01-10) Difficulty: 4 of 5
There are 2n cards labeled 1, 2, ..., 2n respectively, and the cards are distributed randomly between two players so that each has n cards. Each player takes turns to place one card, and you win if you put down a card so that the current sum of all the played cards is divisible by 2n+1.

For example, if n=10, and the previously placed cards are 5, 8, 9, 19, then if player A now places 1, he wins since 5+8+9+19+1 = 42 is divisible by 2*10+1=21.

Assuming both players want to win, what strategy should one adopt in order to win? Following the strategy, is there a consistent winner of this game?

  Submitted by Bon    
Rating: 2.0000 (1 votes)
Solution: (Hide)
First notice that the sum of 1 to 2n = (2n+1)2n/2 = (2n+1)n, which is divisible by 2n+1. That is, if all cards are played, the first player will lost as the second player would've put down the last card, making the sum divisible by 2n+1. So this game will always have a winner.

Now suppose we are in the middle of the game. The strategy to play is that if I have a card so that the current sum + that card allows me to win, I'll place that card. Otherwise, I'll choose a card so that my opponent does not have another card that allows him to win instantly. I can do this because I know what his cards are from my own deck. For example if I know that my opponent has {2, 3, 4} left on his deck, and the current sum is 20 and n=5, I would avoid putting down {11, 10, 9}. Finally, if I don't have any other cards other than those that makes me lost, I must play any card so accept the loss. However, notice that if I have k cards that allow me to lose, my opponent must have another set of cards in his deck that makes me lose respectively. And this set must contain k cards because the arithmetic inverse of r mod (2n+1) is unique and 1 to 1 for any r, modded by (2n+1).

Now suppose I have m cards. I'd lose if and only if each of these m cards makes me lose. That also means my opponent has m respective cards. However, if I were the second player, I always has 1 more card than the first player when it is my turn. So if all my m cards are the 'bad' cards, the first player must have at least m cards, contradicting with the fact that he has m-1 cards at this moment. Therefore, as the second player, I always have at least one 'safe' card. However, if I am the first player, it is possible that all my m cards are 'bad' and my opponent has exactly m cards.

So one can see that it is impossible to lose as the second player, and at each turn the first player has a chance to lose, and if the games drags on until the end, the second player still wins because the last card placed will make the current sum divisible by 2n+1 as shown in the first paragraph.

So, the second player always win.

Comments: ( You must be logged in to post comments.)
  Subject Author Date
Puzzle Thoughts K Sengupta2023-07-14 00:21:13
re: More thorough solutionJay Schamel2005-01-14 23:49:40
re(5): SolutionCharlie2005-01-10 20:12:13
More thorough solutionDavid Shin2005-01-10 19:50:27
re(4): SolutionDavid Shin2005-01-10 19:40:00
Questionre(3): SolutionCharlie2005-01-10 19:11:59
re(2): SolutionDavid Shin2005-01-10 18:52:43
SolutionPossible solutionHugo2005-01-10 18:11:17
Some Thoughtsre: Solutione.g.2005-01-10 18:07:22
SolutionSolutionDavid Shin2005-01-10 17:22:13
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information