Macaulay2 » Documentation
Packages » Permutations :: length(Permutation)
next | previous | forward | backward | up | index | toc

# length(Permutation) -- computes the length of a permutation

- Function: length
- Usage:
    `length w`
- Inputs:
  - w, a permutation,
- Outputs:
  - an integer,

## Description

The length of a permutation is the size of its inversion set.

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

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

    o1 : Permutation

    i2 : length p

    o2 = 3

## See also

- inversions -- computes the inversions of a permutation

## Ways to use this method:

- length(Permutation) -- computes the length of a permutation

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Permutations/Documentation/mainDocs.m2:493:0.