Daily

Random

Practice set

Baltic Way 1990 · Problem 1

Combinatorics

Integers 1,2,…,n1,2, \ldots, n are written (in some order) on the circumference of a circle. What is the smallest possible sum of moduli of the differences of neighbouring numbers?

Change pool

When you’re ready

Review material becomes available with the next Daily.

Review

Topics

Colorings and configurations · Pigeonhole and extremal arguments

Solutions

Solution

Solution:

Let a1=1,a2,…,ak=n,ak+1,…,ana_{1} = 1, a_{2}, \ldots, a_{k} = n, a_{k+1}, \ldots, a_{n} be the order in which the numbers 1,2,…,n1, 2, \ldots, n are written around the circle. Then the sum of moduli of the differences of neighbouring numbers is

∣1−a2∣+∣a2−a3∣+⋯+∣ak−n∣+∣n−ak+1∣+⋯+∣an−1∣≥∣1−a2+a2−a3+⋯+ak−n∣+∣n−ak+1+⋯+an−1∣=∣1−n∣+∣n−1∣=2n−2.\begin{aligned} & \left|1 - a_{2}\right| + \left|a_{2} - a_{3}\right| + \cdots + \left|a_{k} - n\right| + \left|n - a_{k+1}\right| + \cdots + \left|a_{n} - 1\right| \\ & \geq \left|1 - a_{2} + a_{2} - a_{3} + \cdots + a_{k} - n\right| + \left|n - a_{k+1} + \cdots + a_{n} - 1\right| \\ & = |1 - n| + |n - 1| = 2n - 2. \end{aligned}

This minimum is achieved if the numbers are written around the circle in increasing order.