Identifier
- St000446: Permutations ⟶ ℤ
Values
[1] => 0
[1,2] => 0
[2,1] => 1
[1,2,3] => 0
[1,3,2] => 1
[2,1,3] => 2
[2,3,1] => 2
[3,1,2] => 1
[3,2,1] => 3
[1,2,3,4] => 0
[1,2,4,3] => 1
[1,3,2,4] => 2
[1,3,4,2] => 2
[1,4,2,3] => 1
[1,4,3,2] => 3
[2,1,3,4] => 3
[2,1,4,3] => 4
[2,3,1,4] => 3
[2,3,4,1] => 3
[2,4,1,3] => 4
[2,4,3,1] => 4
[3,1,2,4] => 2
[3,1,4,2] => 2
[3,2,1,4] => 5
[3,2,4,1] => 5
[3,4,1,2] => 2
[3,4,2,1] => 5
[4,1,2,3] => 1
[4,1,3,2] => 3
[4,2,1,3] => 4
[4,2,3,1] => 4
[4,3,1,2] => 3
[4,3,2,1] => 6
[1,2,3,4,5] => 0
[1,2,3,5,4] => 1
[1,2,4,3,5] => 2
[1,2,4,5,3] => 2
[1,2,5,3,4] => 1
[1,2,5,4,3] => 3
[1,3,2,4,5] => 3
[1,3,2,5,4] => 4
[1,3,4,2,5] => 3
[1,3,4,5,2] => 3
[1,3,5,2,4] => 4
[1,3,5,4,2] => 4
[1,4,2,3,5] => 2
[1,4,2,5,3] => 2
[1,4,3,2,5] => 5
[1,4,3,5,2] => 5
[1,4,5,2,3] => 2
[1,4,5,3,2] => 5
[1,5,2,3,4] => 1
[1,5,2,4,3] => 3
[1,5,3,2,4] => 4
[1,5,3,4,2] => 4
[1,5,4,2,3] => 3
[1,5,4,3,2] => 6
[2,1,3,4,5] => 4
[2,1,3,5,4] => 5
[2,1,4,3,5] => 6
[2,1,4,5,3] => 6
[2,1,5,3,4] => 5
[2,1,5,4,3] => 7
[2,3,1,4,5] => 4
[2,3,1,5,4] => 5
[2,3,4,1,5] => 4
[2,3,4,5,1] => 4
[2,3,5,1,4] => 5
[2,3,5,4,1] => 5
[2,4,1,3,5] => 6
[2,4,1,5,3] => 6
[2,4,3,1,5] => 6
[2,4,3,5,1] => 6
[2,4,5,1,3] => 6
[2,4,5,3,1] => 6
[2,5,1,3,4] => 5
[2,5,1,4,3] => 7
[2,5,3,1,4] => 5
[2,5,3,4,1] => 5
[2,5,4,1,3] => 7
[2,5,4,3,1] => 7
[3,1,2,4,5] => 3
[3,1,2,5,4] => 4
[3,1,4,2,5] => 3
[3,1,4,5,2] => 3
[3,1,5,2,4] => 4
[3,1,5,4,2] => 4
[3,2,1,4,5] => 7
[3,2,1,5,4] => 8
[3,2,4,1,5] => 7
[3,2,4,5,1] => 7
[3,2,5,1,4] => 8
[3,2,5,4,1] => 8
[3,4,1,2,5] => 3
[3,4,1,5,2] => 3
[3,4,2,1,5] => 7
[3,4,2,5,1] => 7
[3,4,5,1,2] => 3
[3,4,5,2,1] => 7
[3,5,1,2,4] => 4
[3,5,1,4,2] => 4
>>> Load all 1201 entries. <<<
search for individual values
searching the database for the individual values of this statistic
/
search for generating function
searching the database for statistics with the same generating function
Description
The disorder of a permutation.
Consider a permutation $\pi = [\pi_1,\ldots,\pi_n]$ and cyclically scanning $\pi$ from left to right and remove the elements $1$ through $n$ on this order one after the other. The disorder of $\pi$ is defined to be the number of times a position was not removed in this process.
For example, the disorder of $[3,5,2,1,4]$ is $8$ since on the first scan, 3,5,2 and 4 are not removed, on the second, 3,5 and 4, and on the third and last scan, 5 is once again not removed.
Consider a permutation $\pi = [\pi_1,\ldots,\pi_n]$ and cyclically scanning $\pi$ from left to right and remove the elements $1$ through $n$ on this order one after the other. The disorder of $\pi$ is defined to be the number of times a position was not removed in this process.
For example, the disorder of $[3,5,2,1,4]$ is $8$ since on the first scan, 3,5,2 and 4 are not removed, on the second, 3,5 and 4, and on the third and last scan, 5 is once again not removed.
References
[1] Triangle of Mahonian numbers T(n,k): coefficients in expansion of Product_i=0..n-1 (1 + x + ... + x^i), where k ranges from 0 to A000217(n-1). OEIS:A008302
Code
def statistic(pi):
i = 1
pos = 0
count = 0
while i < len(pi):
if pi[pos] == i:
i += 1
elif pi[pos] > i:
count += 1
pos = (pos+1)%len(pi)
return count
Created
Mar 15, 2016 at 22:34 by Christian Stump
Updated
May 10, 2019 at 17:35 by Henning Ulfarsson
searching the database
Sorry, this statistic was not found in the database
or
add this statistic to the database – it's very simple and we need your support!