"The Permutation Puzzle"

Sometimes a puzzle seems to come out of nowhere.

You have to wonder how anyone could have accidentally put together the sequence of steps that make a magic result pop out at the end.

Here is an example of a puzzling property of permutations.

Start with an arbitrary pair of permutations, do some things, and you end up with two orthogonal vectors.

Perhaps that was chance. But do it again with different permutations and the same thing happens.

After a few more tries, you suspect something deeper is going on, but you can't for the life of you see where it is coming from!

So let P1 and P2 be arbitrary permutations of the integers from 1 to 10.

Pair corresponding entries of the permutations to create the set of 10 points (P1(1),P2(1)) through (P1(10),P2(10)).

Now subtract 5, that is, N/2, from the X and Y coordinates of each point so that their average value is zero.

Then apply a rotation of 45 degrees to each vector.

Now instead of looking at 10 vectors (X(I),Y(I)), each of length 2, consider the data as two vectors X and Y, each of length 10.

If the instructions have been followed correctly, then X are Y are perpendicular to each other in 10-dimensional space.

MATLAB code to verify a random example of this property is:

n = 10;
p1 = randperm ( n );
p2 = randperm ( n );
xy = [ p1; p2 ];
scatter ( xy(1,1:n), xy(2,1:n) );
pause
xy = xy - ( n / 2 );
scatter ( xy(1,1:n) ,xy(2,1:n) );
pause
angle = pi / 4;
A = [ cos ( angle ), - sin ( angle ); ...
sin ( angle ),   cos ( angle ) ];
xy = A * xy;
scatter ( xy(1:1:n) ,xy(2,1:n) );
dot = xy(1,1:n) * xy(2,1:n)';
fprintf ( 1, '  The dot product is %f\n', dot );

Claim: This property is true for any pair of permutations P1 and P2.

Claim: This property is true even if P1 and P2 are equal.

Claim: This property is true for any positive integer N.

Claim: This property is not true for arbitrary values of the rotation angle. For instance, using an angle of pi/3 will not work.

Claim: Let Q be an arbitrary vector of length N. Instead of P1 and P2, consider the vectors Q1=Q(P1) and Q2=Q(P2). The property is still true!

Puzzle: Can you verify that each of the claims is true? Can you explain why?

I give up, let me see the solution.

This puzzle comes by way of David Halitsky.
Last revised on 30 March 2011.