Content deleted Content added
m Reword to avoid confusing use of the word "element" to refer to 2 different things in the same sentence. |
m Remove dead link and fix for grammar. |
||
Line 20:
===Inversion number===
The '''inversion number''' <math>\mathtt{inv}(X)</math>{{sfn|Mannila|1985}} of a sequence <math>X=\langle x_1,\dots,x_n\rangle</math>, is the [[cardinality]] of the inversion set. It is a common
For example <math>\mathtt{inv}(\langle1,2,\dots, n\rangle)=0</math> since the sequence is ordered. Also, for <math>m=n/2</math>, <math>\mathtt{inv}(\langle m+1,m+2,\dots,2m,1,2,\dots, m\rangle)=m^2</math> as each pair <math>(1\le i\le m < j\le 2m)</math> is an inversion. This last example shows that a set that is intuitively "nearly" sorted can still have a quadratic number of inversions.
|