1. the two sequences $a_{1}>a_{2}>\ldots>a_{n}$ and $b_{1}<b_{2}<\ldots<b_{n}$ together contain each of the numbers $1,2, \ldots, 2 n$ exactly once. Determine the value of the sum

$$
\left|a_{1}-b_{1}\right|+\left|a_{2}-b_{2}\right|+\ldots+\left|a_{n}-b_{n}\right|
$$

## 1st solution
It always applies $|x-y|=\max (x, y)-\min (x, y)$. We claim that for $1 \leq k \leq n$ is always $\max \left(a_{k}, b_{k}\right) \geq n+1$ and $\min \left(a_{k}, b_{k}\right) \leq n$. Assume that $a_{k}, b_{k} \leq n$. Then the $n+1$ sequence members $a_{1}, \ldots, a_{k}, b_{k}, \ldots, b_{n}$ are all positive, different and at most equal to $n$, a contradiction. Analogously, the assumption $a_{k}, b_{k} \geq n+1$ leads to a contradiction. Consequently, the numbers $\min \left(a_{k}, b_{k}\right)$ pass through exactly the set $\{1,2, \ldots, n\}$ and the numbers $\max \left(a_{k}, b_{k}\right)$ pass through the set $\{n+1, n+2, \ldots, 2 n\}$. The following therefore applies

$$
\begin{aligned}
\sum_{k=1}^{n}\left|a_{k}-b_{k}\right| & =\sum_{k=1}^{n} \max \left(a_{k}, b_{k}\right)-\sum_{k=1}^{n} \min \left(a_{k}, b_{k}\right) \\
& =((n+1)+(n+2)+\ldots+2 n)-(1+2+\ldots+n)=n^{2}
\end{aligned}
$$

## 2nd solution

Assume there are indices $k$ and $l$ with $b_{l}=a_{k}+1$. Replace the sequences $\left(a_{1}, \ldots, a_{n}\right)$ and $\left(b_{1}, \ldots, b_{n}\right)$ with the two new sequences $\left(a_{1}, \ldots, a_{k-1}, a_{k}+1, a_{k+1}, \ldots, a_{n}\right)$ and $\left(b_{1}, \ldots, b_{l-1}, b_{l}-1, b_{l+1}, \ldots, b_{n}\right)$. It is easy to see that the two new sequences also fulfill the conditions of the task. We now claim that the sum to be calculated does not change during this operation and distinguish between three cases.

(1) $kb_{k}-1$, so $a_{k}-b_{k}$ and $a_{k}-b_{k}+1$ are both non-negative. Similarly, $a_{l}l$ An analogous argumentation also provides in this case

$$
D=-\left(a_{k}-b_{k}+1\right)+\left(a_{l}-b_{l}+1\right)+\left(a_{k}-b_{k}\right)-\left(a_{l}-b_{l}\right)=0
$$

(3) $k=l$. The sum changes by

$$
D=\left|\left(a_{k}+1\right)-\left(b_{k}-1\right)\right|-\left|a_{k}-b_{k}\right|
$$

In addition, $a_{k}=b_{k}-1$, so again $D=|1|-|-1|=0$.

After a finite number of such operations, we can assume that $b_{1}<\ldots<$ $b_{n}<a_{n}<\ldots<a_{1}$ applies. But then $b_{k}=k$ and $a_{k}=2 n+1-k$ for $k=1, \ldots, n$. In this case, the sum has the value

$$
\sum_{k=1}^{n}\left|a_{k}-b_{k}\right|=\sum_{k=1}^{n} 2 n+1-2 k=n(2 n+1)-2 \sum_{k=1}^{n} k=n(2 n+1)-n(n+1)=n^{2}
$$