Page 1 of 1

Swap those numbers

Posted: Fri Apr 11, 2014 11:49 am
by Nayeemul Islam Swad
The numbers from $1$ to $n$ are written in a line in increasing order and at each time you are allowed to swap any two neighboring numbers. Now, is it possible to have this initial sequence of numbers after $2007$ such swappings?

Re: Swap those numbers

Posted: Fri Apr 11, 2014 5:16 pm
by Labib
The answer is No.
Why? Since we can only swap two neighboring numbers, if a number is swapped with a larger number, it has to swapped again with the same number to get the initial sequence. (Otherwise the sequence will no longer be increasing)
Thus the number of swaps needed to gain the initial sequence has to be even. Thus, we cannot get the initial sequence after $2007$ swaps.