Browse · MathNet
PrintMathematica competitions in Croatia
Croatia counting and probability
Problem
Andrija and Boris have 2014 cards labelled with numbers from 1 to 2014. Andrija has all the cards with even, and Boris all the cards with odd numbers. Andrija arranged his cards in a circle clockwise, from 2 to 2014 respectively, and put them upside down, so that the numbers on the cards can not be seen. Boris knows that the cards are arranged in that order and that direction, but does not know the position of the card with number 2. After that, Boris puts one of his cards on top of each Andrija's card thus forming 1007 pairs of cards.
For each pair they compare the numbers on the cards and give one point to the player whose card has the larger number. Find the largest possible such that Boris can be certain he will gain at least points. (Ukraine 2010)

For each pair they compare the numbers on the cards and give one point to the player whose card has the larger number. Find the largest possible such that Boris can be certain he will gain at least points. (Ukraine 2010)
Solution
The largest number of points for which Boris can be certain to gain is .
We claim that if Boris arranges his cards clockwise, but in the reverse order, from to , then regardless of Andrija's arrangement of cards, Boris will gain points.
For such Boris' arrangement, let us consider some Andrija's arrangement. Under Boris' card is Andrija's card , for some . Let us assume that , the case in which follows directly. In the figure we can see the arrangement of the cards in a series, starting with the position where Boris put the card . We split pairs of cards into two parts: the part containing Andrija's cards , , ..., , , and the other part containing , , ..., , . In the first part Andrija's cards (from left to right) increase from to , and Boris' decrease from . In other words, at the beginning of that part Boris' cards are larger, but at the end Andrija's cards are larger. Let us denote by () the last Boris' card in the first part which is larger than the corresponding Andrija's card, which we denote by for some . Hence, we have From the previous inequalities we get , so or . Let us notice that the sum of the cards in each pair of the first part is the same and equals to . In fact, in each next pair Boris' number is by smaller than the previous, while Andrija's is by larger than the previous, so the sum does not change. Hence we have .
If , then is odd and . Similarly, if , then is even and . If is the number of the pairs in the first part in which Boris' card is larger than Andrija's, then . Thus we have Furthermore, let us denote by the number of pairs in the second part in which Boris' card is larger than Andrija's. Analogously we get Hence , regardless of the number , so we can conclude that arranging the cards in this way Boris will gain points (and Andrija points).
It remains to prove that Boris can not arrange his cards such that he gains more than points, regardless of Andrija's arrangement.
Let us assume that there is Boris' arrangement for which Andrija gains less than points, regardless of how he arranges his cards. For such Boris' arrangement, let us denote by the total number of points that Andrija gains in all of his possible arrangements. There are possible Andrija's arrangements, so by the assumption we have . On the other hand, let us see how many points each of Boris' cards contributes to the number . The card with the number contributes point because it gives points only in the arrangement in which the card with the number is on top of it. The card with the number contributes points (cases in which cards and are on top of it). In general, for the card with the number contributes points. Hence we have We reached a contradiction, so we conclude that our assumption was wrong, i.e. Boris can not be certain to gain more than points.
We claim that if Boris arranges his cards clockwise, but in the reverse order, from to , then regardless of Andrija's arrangement of cards, Boris will gain points.
For such Boris' arrangement, let us consider some Andrija's arrangement. Under Boris' card is Andrija's card , for some . Let us assume that , the case in which follows directly. In the figure we can see the arrangement of the cards in a series, starting with the position where Boris put the card . We split pairs of cards into two parts: the part containing Andrija's cards , , ..., , , and the other part containing , , ..., , . In the first part Andrija's cards (from left to right) increase from to , and Boris' decrease from . In other words, at the beginning of that part Boris' cards are larger, but at the end Andrija's cards are larger. Let us denote by () the last Boris' card in the first part which is larger than the corresponding Andrija's card, which we denote by for some . Hence, we have From the previous inequalities we get , so or . Let us notice that the sum of the cards in each pair of the first part is the same and equals to . In fact, in each next pair Boris' number is by smaller than the previous, while Andrija's is by larger than the previous, so the sum does not change. Hence we have .
If , then is odd and . Similarly, if , then is even and . If is the number of the pairs in the first part in which Boris' card is larger than Andrija's, then . Thus we have Furthermore, let us denote by the number of pairs in the second part in which Boris' card is larger than Andrija's. Analogously we get Hence , regardless of the number , so we can conclude that arranging the cards in this way Boris will gain points (and Andrija points).
It remains to prove that Boris can not arrange his cards such that he gains more than points, regardless of Andrija's arrangement.
Let us assume that there is Boris' arrangement for which Andrija gains less than points, regardless of how he arranges his cards. For such Boris' arrangement, let us denote by the total number of points that Andrija gains in all of his possible arrangements. There are possible Andrija's arrangements, so by the assumption we have . On the other hand, let us see how many points each of Boris' cards contributes to the number . The card with the number contributes point because it gives points only in the arrangement in which the card with the number is on top of it. The card with the number contributes points (cases in which cards and are on top of it). In general, for the card with the number contributes points. Hence we have We reached a contradiction, so we conclude that our assumption was wrong, i.e. Boris can not be certain to gain more than points.
Final answer
503
Techniques
Counting two waysGames / greedy algorithmsInvariants / monovariants