Browse · MathNet
Print66th Czech and Slovak Mathematical Olympiad
Czech Republic counting and probability
Problem
We have empty boxes; each of them having square base. The height and the width of each box belongs to and every two boxes differ in at least one of these two dimensions. One box fits into another one if both its dimensions are smaller and at least one is smaller by at least 2. In this way, we can form sequences of boxes (the first one in the second one, the second one in the third one, and so on). We put any such set of boxes on a different shelf. How many shelves do we need to store all the boxes? (Peter Novotný)


Solution
We will show that the required minimal number of shelves is . This answer is clearly correct for and since for such we have and each box has to be stored on a different shelf. From now on, let . We identify boxes with points in an grid: A box of width and height corresponds to point with coordinates . No two boxes from the set (three longest diagonals, see Fig. 1 for ) can be on the same shelf: Indeed, Assume and are on the same shelf and . Then , and either or . Either way, summing up we obtain .
Fig. 1 Fig. 2 If then , hence . As , we need at least shelves. Now we show how to split the boxes so that shelves are enough. A possible way for is clear from Fig. 2 (the sequences of boxes stored inside one another are illustrated by arrows) and it can be directly generalised to any . Two boxes , are put on the same shelf if and only if . In other words, we start with “largest” boxes , for and for , and we put each of these boxes on a different shelf. Then we follow the following algorithm on each shelf: Assume the last box put on the shelf is . If and , we add box to the shelf (inside the previous box) and repeat this step; otherwise we end. Obviously, the arrangement of boxes on every shelf satisfies the requirements. Moreover, each box is stored on exactly one shelf: To identify it, keep increasing by 2 and by 1 (simultaneously) until or . Thus shelves are also sufficient.
Fig. 1 Fig. 2 If then , hence . As , we need at least shelves. Now we show how to split the boxes so that shelves are enough. A possible way for is clear from Fig. 2 (the sequences of boxes stored inside one another are illustrated by arrows) and it can be directly generalised to any . Two boxes , are put on the same shelf if and only if . In other words, we start with “largest” boxes , for and for , and we put each of these boxes on a different shelf. Then we follow the following algorithm on each shelf: Assume the last box put on the shelf is . If and , we add box to the shelf (inside the previous box) and repeat this step; otherwise we end. Obviously, the arrangement of boxes on every shelf satisfies the requirements. Moreover, each box is stored on exactly one shelf: To identify it, keep increasing by 2 and by 1 (simultaneously) until or . Thus shelves are also sufficient.
Final answer
3n - 2
Techniques
Coloring schemes, extremal argumentsAlgorithms