You are given cards numbered 100, 99, 98, ..., 3, 2, 1 in that order. You want to rearrange them in the reverse order 1, 2, 3, ..., 98, 99,100 switching only two adjacent cards at a time.
What is the minimum number of switches necessary?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
card number 1 0 0 is switched between 9 9 cards before it, similarly card number n is switched between ( n − 1 ) cards.
Total number of switches is therefore ( 9 9 ∗ 1 0 0 ) / 2 = 4 9 5 0 , which is the sum of all individual switches.