Inversion (discrete mathematics)

From Wikipedia, the free encyclopedia
  (Redirected from Weak order of permutations)
Jump to: navigation, search

In computer science and discrete mathematics, an inversion in a sequence of numbers is a pair of numbers in the sequence that are "out of order" with respect to an ascending or descending order.

Contents

[edit] Definitions

Formally, let (A(1), \ldots, A(n)) be a sequence of n distinct numbers. If i < j and A(i) > A(j), then the pair (i, j) is called an inversion of A.[1][2]

The inversion number of a sequence is one common measure of its sortedness.[3][2] Formally, the inversion number is defined to be the number of inversions, that is,

\text{inv}(A) = \# \{(A(i),A(j)) \mid i < j \text{ and } A(i) > A(j)\}.[3]

Other measures of (pre-)sortedness include the minimum number of elements that can be deleted from the sequence to yield a fully sorted sequence, the number and lengths of sorted "runs" within the sequence, and the smallest number of exchanges needed to sort the sequence.[4] Standard comparison sorting algorithms can be adapted to compute the inversion number in time O(n log n).

The inversion vector V(i) of the sequence is defined for i = 2, ..., n as V[i] = \left\vert\{k \mid k < i \text{ and } A(k) > A(i)\}\right\vert. In other words each element is the number of elements preceding the element in the original sequence that are greater than it. Note that the inversion vector of a sequence has one less element than the sequence, because of course the number of preceding elements that are greater than the first is always zero. Each permutation of a sequence has a unique inversion vector and it is possible to construct any given permutation of a (fully sorted) sequence from that sequence and the permutation's inversion vector.[5]

[edit] Weak order of permutations

The set of permutations on n items can be given the structure of a partial order, called the weak order of permutations, which forms a lattice.

To define this order, consider the items being permuted to be the integers from 1 to n, and let Inv(u) denote the set of inversions of a permutation u for the natural ordering on these items. That is, Inv(u) is the set of ordered pairs (i, j) such that 1 ≤ i < jn and u(i) > u(j). Then, in the weak order, we define uv whenever Inv(u) ⊆ Inv(v).

The edges of the Hasse diagram of the weak order are given by permutations u and v such that u < v and such that v is obtained from u by interchanging two consecutive values of u. These edges form a Cayley graph for the group of permutations that is isomorphic to the skeleton of a permutohedron.

The identity permutation is the minimum element of the weak order, and the permutation formed by reversing the identity is the maximum element.

[edit] Example

The following files show the permutations of 4 elements, their inversion vectors and their sets of up to six inversions. When a pair (i,j) is marked in red as an element of the inversion set, it means that the elements on places i and j are out of their natural order in the permutation. For example the inversion set of permutation number 1 contains only the pair (1,2), so only the elements on places 1 and 2 are out of their natural order.

These 2-element subsets of 4 elements.svg are the six possible pairs.

Loupe light.svg List of 4 element permutations
showing 4 place inversion vectors
and sets of up to 6 inversions
Permutations ordered by the bitwise less or equal \le relation
between their inversion vectors
Loupe light.svg Permutations ordered by the subset \subseteq relation
between their inversion sets

[edit] See also

[edit] References

  1. ^ Cormen et al. 2001, pp. 39.
  2. ^ a b Vitter & Flajolet 1990, pp. 459.
  3. ^ a b Barth & Mutzel 2004, pp. 183.
  4. ^ Mahmoud 2000, pp. 284.
  5. ^ Pemmaraju & Skiena 2003, pp. 69.

[edit] Source bibliography

[edit] Further reading

  • Margolius, Barbara H. (2001). "Permutations with Inversions". Journal of Integer Sequences 4. 

[edit] Presortedness measures

  • Mannila, Heikki (1984). "Measures of presortedness and optimal sorting algorithms". Lecture Notes in Computer Science 172: 324–336. doi:10.1007/3-540-13345-3_29. 
  • Estivill-Castro, Vladimir; Wood, Derick (1989). "A new measure of presortedness". Information and Computation 83 (1): 111–119. 
  • Skiena, Steven S. (1988). "Encroaching lists as a measure of presortedness". BIT 28 (4): 755–784. 
Personal tools
Namespaces

Variants
Actions
Navigation
Interaction
Toolbox
Print/export