Recently I watch a youtube video, a scene from $X + Y$ movie, which shows a boy named Nathan solve a problem. Here is the link to the video.
Original Problem: There are 21 cards facing down put in a row. We choose one card that facing down and one card to the right then turn both card. Show that, no matter which card you choose, this move will terminate.
I found this problem interesting and wonder what if there are two people playing this, and who will have the winning strategies.
Question: With the same rule as above, two person, say $A$ and $B$ , moving alternately. Who will have winning strategy(if any)? The person start first or the second one? Or is there any other condition? The loser is the one that can no more move(no more card to choose).
more generaly,
Problem: If there are $n$ cards facing down, who has the winning strategy?
I don't know how to solve this, but I'm just curious about this one.
The initial state of the game is
The ending state is always
Now for each state let's count how many face-down cards there are in even-numbered positions on the table
This number starts at $10$ and ends at $0$. In each move exactly one of these cards will be flipped so the number changes by $\pm 1$.
Therefore there is always an even number of moves in the game, no matter which strategy anyone follows.
This analysis generalizes easily to other numbers of cards. We see that who wins depends only on how many cards there are modulo 4.