Problem 1
Let and be real numbers. Prove that if is any permutation of , then .
Step 3 of 5: Key lemma: swapping an out-of-order pair never decreases the dot product
In plain words
With just two numbers this is the whole problem in miniature: if car is bigger than car but spot is smaller than spot , swapping the cars to match sizes can only shorten the total parking distance, never lengthen it.
Detailed analysis
Suppose in some permutation there are positions with (an "inversion": a smaller value sits where a larger is, since ). Swap and ; every other term of is unchanged, so it suffices to compare with . Their difference is , because and by assumption. Hence swapping the inversion into the correct order weakly increases .