February 2026
Problem of the Month

Card Game Strategy
Submitted by K. Sengupta from Calcutta, India



This game is a variation of the old Eastern game "Nim".

Starting with a deck of cards, two players take turns removing cards from the deck.

During his turn a player may take one, two, or three cards.

The winner is the person who takes the last card (or cards) from the deck.


There is a strategy that the first player can follow in order to assure his victory for some decks, but this strategy will not work for every deck configuration.

What is this strategy and which of the following decks will it work for, and why?

13 cards (2 through Ace in one suit)
32 cards (7s through Aces)
36 cards (6s through Aces)
39 cards (2 through Ace in three suits)
52 cards (2s through Aces)
54 cards (2s through Aces + 2 Jokers)



Solution to the Problem:

The strategy is to make sure that the deck contains the number of cards that's a multiple of four after your turn.

The strategy will not work for decks containing cards that are a multiple of four.

Only the 13 card deck, the 39 card deck, and the 54 card deck guarantee a win for the first player.

For example, for the 13 card deck, the first player would take one card, leaving 12 cards (a multiple of four).

    If the second player takes one card, then the first player takes 3 cards, leaving 8 cards.

    But if the second player takes 2 cards, then the first player takes 2 cards, again leaving 8 cards.

    And if the second player takes 3 cards, then the first player takes one card, leaving 8 cards.

    The use the same strategy to get down to four cards and again to win.



Here is Colin Bowey's excellent solution, which is better than my explanation:

Strategy
The first player should, on their first move, leave a multiple of 4 cards in the deck.

Let N be the number of cards in the deck.
The first player takes Nmod4 cards (that is, 1, 2, or 3), so that the remaining number of cards is divisible by 4:

N−(Nmod4)
After that, the first player always takes the complement to 4.

Whatever the opponent takes (1, 2, or 3), the first player takes enough so that the two moves total 4:

Why this works
If the first player can keep handing the opponent a deck size that is a multiple of 4 at the start of each of the opponent’s turns, the opponent is forced into losing positions:


When it cannot work
If the starting number of cards N is already a multiple of 4, the first player cannot leave a multiple of 4 on the first move.
No matter what the first player takes, the second player can then apply the same strategy and force a win.


Which decks the strategy works for
We compute Nmod4:





Correctly solved by:

1. Colin (Yowie) Bowey Beechworth, Victoria, Australia
2. Davit Banana Istanbul, Turkey
3. Kamal Lohia Hisar, Haryana, India
4. Dr. Hari Kishan D.N. College,
Meerut, Uttar Pradesh, India
5. Kelly Stubblefield Mobile, Alabama, USA
6. Eva Hull Central High School,
Grand Junction, Colorado, USA


Send any comments or questions to: David Pleacher