00:01
To find the number of inversions in this permutation, 65, 4, 3, 2, 1, we're just going to count up every possible pair and see how many have a value on the left that is larger than the value on the right.
00:14
So the number of inversions in this is equal to, and we'll look at each pair now.
00:18
So starting with 6, we'll get 6 and 5.
00:21
5 is smaller than 6, so that's 1 inversion.
00:25
Same for 4, 3.
00:27
So same for all these values since 6 is the largest.
00:29
So that's a total of five inversions.
00:34
So next we'll look at five.
00:37
And looking to the right, we see all the values are smaller.
00:39
So five and four, five, three, two, and one is all smaller than five.
00:46
So they're all inversions.
00:48
So that's plus four versions...