Twelve cards lie in a row. The cards are of three kinds: with both sides white, both sides black, or with a white and a black side. Initially, nine of the twelve cards have a black side up. The cards 1-6 are turned, and subsequently four of the twelve cards have a black side up. Now cards 4-9 are turned, and six cards have a black side up. Finally, the cards 1-3 and 10-12 are turned, after which five cards have a black side up. How many cards of each kind are there?
Answer: there are 9 cards with one black and one white side and 3 cards with both sides white.

Divide the cards into four types according to the table below.

| Type | Initially up | Initially down |
| :---: | :---: | :---: |
| $A$ | black | white |
| $B$ | white | black |
| $C$ | white | white |
| $D$ | black | black |

When the cards 1-6 were turned, the number of cards with a black side up decreased by 5. Hence among the cards 1-6 there are five of type $A$ and one of type $C$ or $D$. The result of all three moves is that cards $7-12$ have been turned over, hence among these cards there must be four of type $A$, and the combination of the other two must be one of the following:

(a) one of type $A$ and one of type $B$;

(b) one of type $C$ and one of type $D$;

(c) both of type $C$;

(d) both of type $D$.

Hence the unknown card among the cards 1-6 cannot be of type $D$, since this would make too many cards having a black side up initially. For the same reason, the alternatives (a), (b) and (d) are impossible. Hence there were nine cards of type $A$ and three cards of type $C$.

Alternative solution. Denote by $a_{1}, a_{2}, \ldots, a_{12}$ the sides of each card that are initially visible, and by $b_{1}, b_{2}, \ldots, b_{12}$ the initially invisible sides each of these is either white or black. The conditions of the problem imply the following:

(a) there are 9 black and 3 white sides among $a_{1}, a_{2}, a_{3}, a_{4}, a_{5}, a_{6}$, $a_{7}, a_{8}, a_{9}, a_{10}, a_{11}, a_{12}$

(b) there are 4 black and 8 white sides among $b_{1}, b_{2}, b_{3}, b_{4}, b_{5}, b_{6}, a_{7}$, $a_{8}, a_{9}, a_{10}, a_{11}, a_{12}$;
(c) there are 6 black and 6 white sides among $b_{1}, b_{2}, b_{3}, a_{4}, a_{5}, a_{6}, b_{7}$, $b_{8}, b_{9}, a_{10}, a_{11}, a_{12}$;

(d) there are 5 black and 7 white sides among $a_{1}, a_{2}, a_{3}, a_{4}, a_{5}, a_{6}, b_{7}$, $b_{8}, b_{9}, b_{10}, b_{11}, b_{12}$.

Cases (b) and (d) together enumerate each of the sides $a_{i}$ and $b_{i}$ exactly once - hence there are 9 black and 15 white sides altogether. Therefore, all existing black sides are enumerated in (a), implying that we have 9 cards with one black and one white side, and the remaining 3 cards have both sides white.