If you understand the number (n-r-1)/n as the propability of a given number to be bigger than the pivot and (r-1) the quantity of these given number that are in the wrong place, it's easy.
Sum in respect to r means that the number above consider that the pivot is in a given position r. But...
I didn't understand the same as you. I was working in "suming in respect to r" and trying to figure out what does it mean. I've tryed to sum from r=1 to N, but it doesn't work. And I haven't understand why he uses (N-r-1) and do not use (N-r), what I think is correct.
Did you find the answer...