\section*{Problem 7}

What is the largest possible value of \(|\ldots|\left|a_{1}-a_{2}\right|-a_{3}\left|-\ldots-a_{1990}\right|\), where \(\mathrm{a}_{1}, a_{2}, \ldots, a_{1990}\) is a permutation of \(1,2,3, \ldots, 1990\) ?

Answer \(\quad 1989\)


\section*{Solution}

Since \(|a-b| \leq \max (a, b)\), a trivial induction shows that the expression does not exceed \(\max \left(a_{1}\right.\), \(\left.\mathrm{a}_{2}, \ldots, \mathrm{a}_{1990}\right)=1990\). But for integers la-bl has the same parity as \(a+b\), so a trivial induction shows that the expression has the same parity as \(\mathrm{a}_{1}+\mathrm{a}_{2}+\ldots+\mathrm{a}_{1990}=1990 \cdot 1991 / 2\), which is odd. So it cannot exceed 1989. That can be attained by the permutation \(2,4,5,3,6,8,9,7, \ldots\) , \(4 \mathrm{k}+2,4 \mathrm{k}+4,4 \mathrm{k}+5,4 \mathrm{k}+3, \ldots, 1984+2,1984+4,1984+5\), 1984+3, 1990, 1. Because we get successively \(2,3,0 ; 6,2,7,0 ; 10,2,11,0 ; \ldots ; 4 \mathrm{k}+2,2,4 \mathrm{k}+3,0 ; \ldots ; 1986,2,1987,0 ; 1990\), 1989.

