Macaulay2 » Documentation
Packages » MatrixSchubert » Functions for investigating permutations » lastDescent
next | previous | forward | backward | up | index | toc

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

- Usage:
    `lastDescent w`
- Inputs:
  - w, a list,

## 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:

- `lastDescent(List)`

## For the programmer

The object lastDescent is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/MatrixSchubert/permutationMethodsDOC.m2:63:0.