I have a problem that says:
Find the number of inversions in each of the following permutations of S = {1,2,3,4,5}:
(a) 52134 (b) 45213 (c) 42135
In the text it doesn't do that great of a job of explaining how you find inversions, I assumed (a) was 5 inversions because the numbers are in five different positions from the orginal S. However in (b) the answer is 7, but I can't figure out why. Is there a general line of attack I should take with these types of problems?
Thanks,