I'm trying to find the expected number of swaps in a algorithm I'm working on. I've gotten to this point:
$E[S] =\sum_{j=1}^n\sum_{i=0}^{i
I don't know how to reduce this further. The answer is supposed to be n(n-1)/4, but I don't know how to get there.