4. A tea set consists of six identical cups and six identical saucers. Six different sets were packed into two boxes, all saucers in one box, and all cups in the other. All items are wrapped in opaque paper and are indistinguishable by touch. Find the minimum number of items that need to be taken out of these boxes to guarantee getting at least one pair consisting of a cup and a saucer from the same set. Justify your answer. (You know which box contains the cups and which box contains the saucers.)
Solution. Explanation by example. 18 cups and 12 saucers may not be enough. Let's number the sets. By randomly picking 18 cups, we might get all the cups from sets №1, 2, 3.

By randomly picking 12 saucers, we might get all the saucers from sets №5, 6. It is impossible to form a cup-saucer pair. Adding one more saucer to this set, the only way it still cannot form a pair is if the thirteenth saucer belongs to set №4.

General proof. $n$ taken cups and $30-n$ taken saucers can end up from different sets $(n>0)$. Suppose the taken cups completely occupy $k$ sets, and $r$ more cups are taken from some single set. Then $n=6k+r, 30-n=30-6k-r=6(4-k)+(6-r)$, here the saucers also occupy $4-k$ sets completely, and there are $6-r$ saucers left. It can happen that the sets occupied by cups and saucers do not intersect, and such sets sum up to 4. The remaining taken cups and saucers can end up from different sets, the remainders from division by 6 allow this. Further, adding the 31st item may still not allow forming a cup-saucer pair, as the new item belongs to an already encountered incomplete set, or the 30 cups and saucers are grouped by 6 and belong to different sets.

Now we show that 32 items allow forming a pair. Take 31 cups. Since there are more than 30 cups, we have at least one cup from each set. Any taken saucer will allow forming a pair. Answer. 32 items.