MathDB
Shuffling cards

Source: MEMO 2022 I2

September 2, 2022
combinatorics

Problem Statement

Let nn be a positive integer. Anna and Beatrice play a game with a deck of nn cards labelled with the numbers 1,2,...,n1, 2,...,n. Initially, the deck is shuffled. The players take turns, starting with Anna. At each turn, if kk denotes the number written on the topmost card, then the player first looks at all the cards and then rearranges the kk topmost cards. If, after rearranging, the topmost card shows the number k again, then the player has lost and the game ends. Otherwise, the turn of the other player begins. Determine, depending on the initial shuffle, if either player has a winning strategy, and if so, who does.