Consider a random permutation of the values 1, 2, 3, 4, 5, and 6, for example (1, 2, 3, 4, 6, 5). Let a distance of a number be defined as the number of places between the number's position from the position indexed by the number. For example, the distance of 6 in (1, 2, 3, 4, 6, 5) is 1 because 6 is in the 5th position, which is 1 place away from the 6th position. The score of a permutation is the total distance of all numbers in the permutation. In the example (1, 2, 3, 4, 6, 5), the score would be 2 = 1 + 1 for 5 and 6. Find the total score across all permutations of the values 1, 2, 3, 4, 5, and 6.
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.
A number x is at position y in 6 6 ! permutations and it's distance is ∣ x − y ∣ . Since the contribution of a number to the score in a particular case is always independent of the position of other numbers, so we can add the distance of each number individually. Therefore the score is 6 6 ! ∑ x = 1 6 ∑ y = 1 6 ∣ x − y ∣ = 8 4 0 0