[Math] Turn 6 cards upside down

discrete mathematicspuzzle

Six identical cards are placed on a table. Each card has number '1' marked on one side and '2' on the other. All cards are placed with '1' facing upward on a table. In one try, exactly four cards (neither more nor less) can be turned upside down. In how many least number of tries can the cards be turned so that all six cards show '2' on the upper side?
Please explain how.

Best Answer

From a state with $k$ cards showing 2, by turning $a$ cards showing 2 and $4-a$ cards showing 1, we reach a state with $k-a+(4-a)=k+4-2a$ cards showing 2. Of course, we must obey the restrictions that $0\le a\le k$ and $0\le 4-a\le 6-k$, i.e. $\max\{k-2,0\}\le a\le\min\{k,4\}$.

Thus we have the following allowed moves: $$0\stackrel{a=0}\longrightarrow 4 \begin{cases}\stackrel{a=2}\longrightarrow4\\\stackrel{a=3}\longrightarrow2\stackrel{a=0}\longrightarrow 6\\ \stackrel{a=4}\longrightarrow0\\\end{cases}$$ where the second moves leading to $k=4$ or $k=0$ are obviously no good, hence the three moves shown are the shortest possibility.

Related Question