Identifier
Identifier
Values
[1] => 0
[-1] => 1
[1,2] => 0
[1,-2] => 1
[-1,2] => 1
[-1,-2] => 2
[2,1] => 1
[2,-1] => 1
[-2,1] => 1
[-2,-1] => 1
[1,2,3] => 0
[1,2,-3] => 1
[1,-2,3] => 1
[1,-2,-3] => 2
[-1,2,3] => 1
[-1,2,-3] => 2
[-1,-2,3] => 2
[-1,-2,-3] => 3
[1,3,2] => 1
[1,3,-2] => 1
[1,-3,2] => 1
[1,-3,-2] => 1
[-1,3,2] => 2
[-1,3,-2] => 2
[-1,-3,2] => 2
[-1,-3,-2] => 2
[2,1,3] => 1
[2,1,-3] => 2
[2,-1,3] => 1
[2,-1,-3] => 2
[-2,1,3] => 1
[-2,1,-3] => 2
[-2,-1,3] => 1
[-2,-1,-3] => 2
[2,3,1] => 1
[2,3,-1] => 1
[2,-3,1] => 1
[2,-3,-1] => 1
[-2,3,1] => 2
[-2,3,-1] => 2
[-2,-3,1] => 2
[-2,-3,-1] => 2
[3,1,2] => 1
[3,1,-2] => 2
[3,-1,2] => 1
[3,-1,-2] => 2
[-3,1,2] => 1
[-3,1,-2] => 2
[-3,-1,2] => 1
[-3,-1,-2] => 2
[3,2,1] => 2
[3,2,-1] => 2
[3,-2,1] => 1
[3,-2,-1] => 1
[-3,2,1] => 2
[-3,2,-1] => 2
[-3,-2,1] => 1
[-3,-2,-1] => 1
click to show generating function       
Description
The number of descents of a signed permutation.
A descent of a signed permutation $\sigma$ of length $n$ is the number of indices $0 \leq i < n$ such that $\sigma(i) > \sigma(i+1)$ where one considers $\sigma(0) = 0$.
Code
def statistic(pi):
    pi = [0] + list(pi)
    return sum(1 for i in range(len(pi)-1) if pi[i] > pi[i+1])

Created
Jun 21, 2019 at 13:52 by Christian Stump
Updated
Jun 21, 2019 at 13:52 by Christian Stump