Macaulay2 » Documentation
Packages » MatrixSchubert :: lastDescent
next | previous | forward | backward | up | index | toc

lastDescent -- finds the location of the last descent of a permutation

Synopsis

Description

Given a non-identity permutation in 1-line notation, finds the location of its last descent, i.e., the greatest $i$ so that $w_{i+1}<w_i$.

i1 : w = {7,2,5,8,1,3,6,4}

o1 = {7, 2, 5, 8, 1, 3, 6, 4}

o1 : List
i2 : lastDescent w

o2 = 7
i3 : v = {1,6,9,2,4,7,3,5,8}

o3 = {1, 6, 9, 2, 4, 7, 3, 5, 8}

o3 : List
i4 : lastDescent v

o4 = 6

Ways to use lastDescent:

For the programmer

The object lastDescent is a method function.