Suppose we have 52 cards: 26 black and 26 red ones. When the cards are placed in a row if between two given cards of one colour there is no cards of other colour we can take those two out. The questions is in how many ways can we place cards such that we'd be able to take out all cards.
-
What have you tried? For instance, have you tried the problem for $n$ black and $n$ red cards for small $n$? – N. F. Taussig Dec 16 '21 at 11:10
-
Could you describe the last take? As I understand, in a row of 3 cards of the same color, you take out the ones on the endings. How would you take the last card? – Maroon Racoon Dec 16 '21 at 11:16
-
@Daniel Egea I am taking out pairs of cards so it’s impossible to leave just one. – Invincible Dec 16 '21 at 12:01
-
1I tried to draw pictures but didn’t notice anything interesting – Invincible Dec 16 '21 at 12:02
-
26 blacks in a row, followed by a row of 26 reds. Then pick up two consecutive cards and repeat until the end of the row: First 13 black pick up, and finally the same for red half. Is this one of the valid solutions? – Maroon Racoon Dec 16 '21 at 12:12
-
But there will be 2 cards left, not one – Invincible Dec 16 '21 at 13:38
-
This question is deeply related, and you can extract a solution to your question from this answer to that question. – Mike Earnest Dec 16 '21 at 16:02
1 Answers
Hint
In general, given $2n$ cards in a row where each is black or red, number the positions they occupy from $1$ to $2n$ from left to right, and consider the quantity $$ (\text{# black cards at an even position})-(\text{# black cards at an odd position}). $$ Whenever you remove two adjacent black cards, you can push the the cards together to get a smaller line of $2n-2$ cards. When you compute the same quantity for the new line, you will find it is the same as before. Same goes for removing two adjacent red cards. So clearly, in order to remove all the cards, it is necessary for this quantity to be zero. It turns out this condition is also sufficient; which I leave to you to prove.
Further hint:
In order to prove sufficiency by induction, it suffices to prove that when there are $2n$ black cards and $2m$ red cards in a line, such that the quantity is zero, then there exists a legal move. This is trivially true when $m\neq n$. When $n=m$, it is easier to prove the contrapositive: "If no legal move exists (and you haven't already won), then the quantity is nonzero."
Once you have proven that a position is solvable if the quantity is zero, you just need to count the number of card placements where there are $13$ black cards at an even position, and $13$ black cards at an odd position.
- 84,902