A little bit of magic

I first came wideness this problem years ago, somewhere online, but the word-for-word source remains elusive:

Split \{1, 2, 3, ..., 2n\} randomly into two subsets X and Y, each containing n integers. Put the elements of X into increasing order x_1<x_2<\cdots <x_n and put the elements of Y into decreasing order y_1>y_2>\cdots >y_n

Prove that \lvert x_1-y_1\rvert  \lvert x_2-y_2\rvert   \cdots  \lvert x_n-y_n\rvert=n^2

 

This is an uncanny result, and on first glance you might be incredulous. Playing with small examples might uncork to transpiration your mind, but it stills seems unbelievable.

Incredibly, there is a remarkably simple proof, which I found only recently years are first seeing the problem

In each pair (x_i,y_i), one number will contribute positively and one negatively to the final sum. It turns out that no matter how you split the initial set, it is unchangingly the same numbers that contribute positively, namely the integers n 1, n 2, ..., 2n, (which will we undeniability large), with the remaining numbers 1, 2, ..., n unchangingly contributing negatively (which we will call small).

To see why this is true, just observe that any large integers in the set X must towards at the when of the tail end of the sequence x_1<x_2<\cdots <x_n, whereas any large integers in the set Y must towards at the front of the sequence y_1>y_2>\cdots >y_n, in effect filling the gaps left by the large integers in X.

The result of this is that no two large integers are paired with each other, and as every large integer is greater than every small integer, it is unchangingly the large integers that contribute positively to the final sum. What is this sum?

(n 1) (n 2) \cdots  2n-1-2-\cdots -n

=(n 1)-1 (n 2)-2 \cdots  (2n-n)

=n\times n

=n^2

Finally, the word ‘magic’ in the title of this post refers to a trick that used this result to stun audiences at a gathering of mathematics enthusiasts I went to last year.

So there you have it – a worthy entrant into The Vault, I think you’ll agree.