A card deck consists of 1024 cards. On each card, a set of distinct decimal digits is written in such a way that no two of these sets coincide (thus, one of the cards is empty). Two players alternately take cards from the deck, one card per turn. After the deck is empty, each player checks if he can throw out one of his cards so that each of the ten digits occurs on an even number of his remaining cards. If one player can do this but the other one cannot, the one who can is the winner; otherwise a draw is declared. Determine all possible first moves of the first player after which he has a winning strategy. (Russia) Answer. All the moves except for taking the empty card.
Solution
Let us identify each card with the set of digits written on it. For any collection of cards denote by their sum the set consisting of all elements belonging to an odd number of the 's. Denote the first and the second player by and , respectively. Since each digit is written on exactly 512 cards, the sum of all the cards is . Therefore, at the end of the game the sum of all the cards of will be the same as that of ; denote this sum by . Then the player who took can throw it out and get the desired situation, while the other one cannot. Thus, the player getting card wins, and no draw is possible. Now, given a nonempty card , one can easily see that all the cards can be split into 512 pairs of the form because . The following lemma shows a property of such a partition that is important for the solution.
Lemma. Let be some card. Let us choose 512 cards so that exactly one card is chosen from every pair . Then the sum of all chosen cards is either or .
Proof. Let be some element of . Enumerate the pairs; let be the card not containing in the pair, and let be the other card in this pair. Then the sets are exactly all the sets not containing , therefore each digit is written on exactly 256 of these cards, so . Now, if we replace some summands in this sum by the other elements from their pairs, we will simply add several times to this sum, thus the sum will either remain unchanged or change by , as required.
Now we consider two cases.
Case 1. Assume that takes the card on his first move. In this case, we present a winning strategy for .
Let take an arbitrary card . Assume that takes card after that; then takes . Split all 1024 cards into 512 pairs of the form ; we call two cards in one pair partners. Then the four cards taken so far form two pairs and belonging to and , respectively. On each of the subsequent moves, when takes some card, should take the partner of this card in response.
Consider the situation at the end of the game. Let us for a moment replace card belonging to by . Then he would have one card from each pair; by our lemma, the sum of all these cards would be either or . Now, replacing back by we get that the actual sum of the cards of is either or , and he has both these cards. Thus wins.
Case 2. Now assume that takes some card on his first move. Let us present a winning strategy for in this case.
Assume that takes some card on his first move; then takes . Again, let us split all the cards into pairs of the form ; then the cards which have not been taken yet form several complete pairs and one extra element (card has not been taken while its partner has). Now, on each of the subsequent moves, if takes some element from a complete pair, then takes its partner. If takes the extra element, then takes an arbitrary card , and the partner of becomes the new extra element.
Thus, on his last move is forced to take the extra element. After that player has cards and , player has cards and , and has exactly one element from every other pair. Thus the situation is the same as in the previous case with roles reversed, and wins.
Finally, if takes on his first move then denotes any card which has not been taken yet by and takes . After that, the same strategy as above is applicable.
Comment 1. If one wants to avoid the unusual question about the first move, one may change the formulation as follows. (The difficulty of the problem would decrease somewhat.)
A card deck consists of 1023 cards; on each card, a nonempty set of distinct decimal digits is written in such a way that no two of these sets coincide. Two players alternately take cards from the deck, one card per turn. When the deck is empty, each player checks if he can throw out one of his cards so that for each of the ten digits, he still holds an even number of cards with this digit. If one player can do this but the other one cannot, the one who can is the winner; otherwise a draw is declared.
Determine which of the players (if any) has a winning strategy. The winner in this version is the first player. The analysis of the game from the first two paragraphs of the previous solution applies to this version as well, except for the case in which the result is a draw. Then the strategy for in Case 1 works for in this version: the sum of all his cards at the end is either or , thus nonempty in both cases.
Comment 2. Notice that all the cards form a vector space over , with the operation of addition. Due to the automorphisms of this space, all possibilities for 's first move except are equivalent. The same holds for the response by if takes the card on his first move.
Comment 3. It is not that hard to show that in the initial game, has a winning move, by the idea of "strategy stealing".
Namely, assume that has a winning strategy. Let us take two card decks and start two games, in which will act by his strategy. In the first game, takes an arbitrary card ; assume that takes some in response. Then takes the card at the second game; let the response by be . Then takes in the first game and gets a response , and so on.
This process stops at some moment when in the second game takes . At this moment the players hold the same sets of cards in both games, but with roles reversed. Now, if some cards remain in the decks, takes an arbitrary card from the first deck starting a similar cycle.
At the end of the game, player 's cards in the first game are exactly player 's cards in the second game, and vice versa. Thus in one of the games will win, which is impossible by our assumption.
One may notice that the strategy in Case 2 is constructed exactly in this way from the strategy in Case 1. This is possible since every response by wins if takes the card on his first move.