For each permutation of , compute
Let be the maximum possible value of this sum. Find the number of permutations attaining .
, 2008
Solution
The answer is 28800.
Define
After removing the absolute value signs of the given expression, we get a sum of 10 terms from minus the sum of the remaining 10 terms from .
Therefore, we must have
In the following, we will show that equality can be attained, and hence .
Indeed, we shall count the number of permutations such that the sum is .
In order that each of for and for is the larger term of the pair in the same absolute value sign, the large numbers cannot be adjacent terms (where and are considered as adjacent). Also, cannot be the term immediately after the large numbers. Similarly, the small numbers cannot be adjacent, and cannot be the term immediately before the small numbers. Conversely, whenever all these conditions are satisfied, the given expression is equal to .
Note that for any pair of large numbers, there must be a small number in between (possibly together with and/or ), and vice versa. WLOG assume is the first term. There are ways to arrange the small numbers and the large numbers (for example, ). Afterwards, we can only place and in the 4 gaps between a small number and a large number (but not between a large number and a small number). By some basic counting, we know that there are ways to do so (4 ways to place , and then 5 ways to place since there is one more position in the same gap as ). As we can shift all terms cyclically in 10 ways, the final answer is