Identifier
Identifier
Values
[1] => 1
[-1] => 0
[1,2] => 2
[1,-2] => 1
[-1,2] => 1
[-1,-2] => 0
[2,1] => 2
[2,-1] => 1
[-2,1] => 1
[-2,-1] => 0
[1,2,3] => 3
[1,2,-3] => 2
[1,-2,3] => 2
[1,-2,-3] => 1
[-1,2,3] => 2
[-1,2,-3] => 1
[-1,-2,3] => 1
[-1,-2,-3] => 0
[1,3,2] => 3
[1,3,-2] => 2
[1,-3,2] => 2
[1,-3,-2] => 1
[-1,3,2] => 2
[-1,3,-2] => 1
[-1,-3,2] => 1
[-1,-3,-2] => 0
[2,1,3] => 3
[2,1,-3] => 2
[2,-1,3] => 2
[2,-1,-3] => 1
[-2,1,3] => 2
[-2,1,-3] => 1
[-2,-1,3] => 1
[-2,-1,-3] => 0
[2,3,1] => 3
[2,3,-1] => 2
[2,-3,1] => 2
[2,-3,-1] => 1
[-2,3,1] => 2
[-2,3,-1] => 1
[-2,-3,1] => 1
[-2,-3,-1] => 0
[3,1,2] => 3
[3,1,-2] => 2
[3,-1,2] => 2
[3,-1,-2] => 1
[-3,1,2] => 2
[-3,1,-2] => 1
[-3,-1,2] => 1
[-3,-1,-2] => 0
[3,2,1] => 3
[3,2,-1] => 2
[3,-2,1] => 2
[3,-2,-1] => 1
[-3,2,1] => 2
[-3,2,-1] => 1
[-3,-2,1] => 1
[-3,-2,-1] => 0
Description
The number of positive entries in a signed permutation.
Code
def statistic(pi):
return sum(1 for a in pi if a > 0)


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