$\textbf{Heaps of Beans}$
A game starts with four heaps of beans, containing $3$, $4$, $5$ and $6$ beans, respectively. The two players move alternately. A move consists of taking either one bean from a heap, provided at least two beans are left behind in that heap, or a complete heap of two or three beans. The player who takes the last bean wins. Does the first or second player have a winning strategy?
$\textbf{Answer}$
The first player has a winning strategy.
$\textbf{Analysis}$
This problem can be solved using the odd-even parity and the invariant method.
If there are sufficient number of beans in a heap, then each player can only remove one bean in each move. Such transition is deterministic. However, when the number of remaining beans is $3$, the game becomes a bit tricky because there exist two possible paths: $$4\rightarrow 3 \rightarrow 0\qquad\text{or}\qquad 4\rightarrow 3\rightarrow 2\rightarrow 0$$
Existence of two possible paths is unwelcome to have a guaranteed win. Hence, a heap of $3$ should be eliminated in the winning strategy.
The basic idea of the first player's winning strategy is to ensure the total parity is even when it is his opponent's turn and his opponent can only change the total parity from even to odd. If so, the first player can always ensure that his opponent will always leave something for him. Meanwhile, the first player should also ensure that there exist no heap of $3$ beans.
To implement his strategy, the first player can first remove one bean from the pile of $3$. Then, the four heaps have $2$, $4$, $5$, and $6$ beans, respectively. When his opponent creates a new heap of $3$ beans during the game, he will then remove the entire heap. As a result, the number of beans in a heap will always be $4\rightarrow 2\rightarrow 0$ (because by rule, no heap of $1$ bean will exist).
Conceptually, we can treat $2$ as an odd number because both $4$ and $0$ are even. Then, the total parity of $2$, $4$, $5$ and $6$ is even when it is his opponent's turn. Whatever his move, the total parity will become odd and the first player can always change that back to even with an appropriate move (remember $2$ is odd!).
$\textbf{Note}$
This is a hard problem from a prestigious college-level math competition. However, the essence of the solution is similar to that of other simpler problems such as # 4710. In that problem, the first player creates a symmetric situation to ensure that he can always find a vacant mirroring position in order to guarantee his win. In this problem, the vacant mirroring position is created by odd-even transition. The real challenge in this problem is how to handle the situation of a $3$-bean heap. For this, we need to eliminate the case of $3$ and enforce the odd-even parity. The solution is an unusual one: treating $2$ as odd.