Macaulay2 » Documentation
Packages » Permutations :: inversions
next | previous | forward | backward | up | index | toc

inversions -- computes the inversions of a permutation

Description

A permutation $p$ has an inversion $(i,j)$ if $i < j$ and $p(i) > p(j)$. inversions computes all of the inversions of a permutation.

i1 : p = permutation {3,1,2,5,4}

o1 = Permutation{3, 1, 2, 5, 4}

o1 : Permutation
i2 : inversions p

o2 = {{1, 2}, {1, 3}, {4, 5}}

o2 : List

See also

Ways to use inversions:

  • inversions(Permutation)

For the programmer

The object inversions is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.25.06+ds/M2/Macaulay2/packages/Permutations/Documentation/mainDocs.m2:371:0.