Identifier
Identifier
Values
[1] => 0
[-1] => 1
[1,2] => 0
[1,-2] => 3
[-1,2] => 1
[-1,-2] => 4
[2,1] => 1
[2,-1] => 2
[-2,1] => 2
[-2,-1] => 3
[1,2,3] => 0
[1,2,-3] => 5
[1,-2,3] => 3
[1,-2,-3] => 8
[-1,2,3] => 1
[-1,2,-3] => 6
[-1,-2,3] => 4
[-1,-2,-3] => 9
[1,3,2] => 1
[1,3,-2] => 4
[1,-3,2] => 4
[1,-3,-2] => 7
[-1,3,2] => 2
[-1,3,-2] => 5
[-1,-3,2] => 5
[-1,-3,-2] => 8
[2,1,3] => 1
[2,1,-3] => 6
[2,-1,3] => 2
[2,-1,-3] => 7
[-2,1,3] => 2
[-2,1,-3] => 7
[-2,-1,3] => 3
[-2,-1,-3] => 8
[2,3,1] => 2
[2,3,-1] => 3
[2,-3,1] => 5
[2,-3,-1] => 6
[-2,3,1] => 3
[-2,3,-1] => 4
[-2,-3,1] => 6
[-2,-3,-1] => 7
[3,1,2] => 2
[3,1,-2] => 5
[3,-1,2] => 3
[3,-1,-2] => 6
[-3,1,2] => 3
[-3,1,-2] => 6
[-3,-1,2] => 4
[-3,-1,-2] => 7
[3,2,1] => 3
[3,2,-1] => 4
[3,-2,1] => 4
[3,-2,-1] => 5
[-3,2,1] => 4
[-3,2,-1] => 5
[-3,-2,1] => 5
[-3,-2,-1] => 6
click to show generating function       
Description
The number of B-inversions of a signed permutation.
The number of B-inversions of a signed permtutation $\sigma$ of length $n$ is
$$\operatorname{inv}_B(\sigma) = \big|\{ 1 \leq i < j \leq n \mid \sigma(i) > \sigma(j) \}\big| + \big|\{ 1 \leq i \leq j \leq n \mid \sigma(-i) > \sigma(j) \}\big|,$$
see [1, Eq. (8.2)]. According to [1, Eq. (8.4)], this is the Coxeter length of $\sigma$.
References
[1] Björner, A., Brenti, F. Combinatorics of Coxeter groups MathSciNet:2133266
Code
def statistic(pi):
    pi = list(pi)
    n = len(pi)
    return sum(1 for i in range(n) for j in range(i+1,n) if  pi[i] > pi[j]) + \
           sum(1 for i in range(n) for j in range(i  ,n) if -pi[i] > pi[j])

Created
Jun 21, 2019 at 14:03 by Christian Stump
Updated
Jun 21, 2019 at 14:38 by Christian Stump