Van 1-1 doboz Caro, Holló és Mackó sajtunk, kiborítjuk tartalmukat az asztalra. Hányféleképpen lehet a 18 egyforma cikkből 6-ot visszarakni az egyik dobozba, címkéjükkel fölfelé? (2 elhelyezést nem tekintünk különbözőnek, ha alkalmas elforgatással átvihetők egymásba.)

We have one box each of Caro, Holló, and Mackó cheese, and we spill their contents onto the table. In how many ways can 6 out of the 18 identical pieces be put back into one of the boxes, with their labels facing up? (Two arrangements are not considered different if they can be transformed into each other by a suitable rotation.)
I. solution. a) If we put only one type of cheese in the box, the arrangement is unique, and we have 3 choices for selecting the type of cheese. Thus, we get 3 arrangements.

b) When putting two types of cheese in the box, we consider how many pieces we use from each type. The number of pieces can be chosen in three ways: 5 pieces from one type and 1 from the other; 4 from one and 2 from the other; or 3 from each. If we put 5 pieces of one type and 1 of another, the arrangement is unique; the first type can be chosen in 3 ways, and the second in 2 ways. Thus, the number of arrangements is 3 * 2 = 6.

If we use 4 pieces of one type and 2 of another, we can also choose the two types in 6 ways, but the arrangement is not unique: the two identical pieces can be adjacent, second neighbors, or opposite each other. The number of such choices and arrangements is therefore 6 * 3 = 18.

If we take 3 pieces of each type, we have 4 possible arrangements (Figure 1).
![](https://cdn.mathpix.com/cropped/2024_05_02_f0f42523629524cfa6c3g-1.jpg?height=242&width=978&top_left_y=716&top_left_x=557)

Figure 1

The two types used can now be chosen in 3 ways (the number of ways to choose which one is not used from the three types), so the number of such arrangements is 4 * 3 = 12.

c) If we put all three types of cheese in the box, we can take 4+1+1, 3+2+1, or 2+2+2 pieces from each type. In the (4+1+1) case, it is advisable to place the single pieces first, then fill the box with the 4 identical pieces. The single pieces can be adjacent, second neighbors, or opposite. In the first two cases, we can choose the type of the first piece in 3 ways and the second in 2 ways. If the single pieces are opposite, the arrangement is uniquely determined by which type we use 4 pieces of. The number of arrangements here is 2 * 3 * 2 + 3 = 15.

In the (3+2+1) case, we can choose the type with only 1 piece in 3 ways, and the type with 2 pieces in 2 ways. Place the single piece first, then choose the positions of the two identical pieces from the remaining 5 positions in \(\binom{5}{2} = 10\) ways. Thus, we get 10 * 6 = 60 arrangements.

Finally, in the (2+2+2) case, the pairs of identical pieces can be adjacent, only two pairs, only one pair, or none. The number of arrangements is 2, 3, 3 * 2 = 6, and 5 (CHCHMH, CHMCHM, CHMCHM, CHMCHM, and CHMCHM), respectively. Thus, we get 16 arrangements in this case.

Summarizing our results, the number of possibilities is: 3 + (6 + 18 + 12) + (15 + 60 + 16) = 130.

$$
\text{György Turán (Budapest, Fazekas M. Gyak. Gimn., III. o. t.)}
$$

II. solution (outline). Classify the arrangements according to how many pairs of adjacent pieces are of different types. In other words, consider the partition of the box filling into blocks of adjacent pieces of the same type.

1. If there are no