Identifier
Identifier
Values
[] => 0
[1] => 0
[1,2] => 0
[2,1] => 0
[1,2,3] => 0
[1,3,2] => 0
[2,1,3] => 0
[2,3,1] => 0
[3,1,2] => 0
[3,2,1] => 1
[1,2,3,4] => 0
[1,2,4,3] => 0
[1,3,2,4] => 0
[1,3,4,2] => 0
[1,4,2,3] => 0
[1,4,3,2] => 1
[2,1,3,4] => 0
[2,1,4,3] => 0
[2,3,1,4] => 0
[2,3,4,1] => 0
[2,4,1,3] => 0
[2,4,3,1] => 1
[3,1,2,4] => 0
[3,1,4,2] => 0
[3,2,1,4] => 1
[3,2,4,1] => 1
[3,4,1,2] => 1
[3,4,2,1] => 2
[4,1,2,3] => 0
[4,1,3,2] => 1
[4,2,1,3] => 1
[4,2,3,1] => 2
[4,3,1,2] => 2
[4,3,2,1] => 2
[1,2,3,4,5] => 0
[1,2,3,5,4] => 0
[1,2,4,3,5] => 0
[1,2,4,5,3] => 0
[1,2,5,3,4] => 0
[1,2,5,4,3] => 1
[1,3,2,4,5] => 0
[1,3,2,5,4] => 0
[1,3,4,2,5] => 0
[1,3,4,5,2] => 0
[1,3,5,2,4] => 0
[1,3,5,4,2] => 1
[1,4,2,3,5] => 0
[1,4,2,5,3] => 0
[1,4,3,2,5] => 1
[1,4,3,5,2] => 1
[1,4,5,2,3] => 1
[1,4,5,3,2] => 2
[1,5,2,3,4] => 0
[1,5,2,4,3] => 1
[1,5,3,2,4] => 1
[1,5,3,4,2] => 2
[1,5,4,2,3] => 2
[1,5,4,3,2] => 2
[2,1,3,4,5] => 0
[2,1,3,5,4] => 0
[2,1,4,3,5] => 0
[2,1,4,5,3] => 0
[2,1,5,3,4] => 0
[2,1,5,4,3] => 1
[2,3,1,4,5] => 0
[2,3,1,5,4] => 0
[2,3,4,1,5] => 0
[2,3,4,5,1] => 0
[2,3,5,1,4] => 0
[2,3,5,4,1] => 1
[2,4,1,3,5] => 0
[2,4,1,5,3] => 0
[2,4,3,1,5] => 1
[2,4,3,5,1] => 1
[2,4,5,1,3] => 1
[2,4,5,3,1] => 2
[2,5,1,3,4] => 0
[2,5,1,4,3] => 1
[2,5,3,1,4] => 1
[2,5,3,4,1] => 2
[2,5,4,1,3] => 2
[2,5,4,3,1] => 2
[3,1,2,4,5] => 0
[3,1,2,5,4] => 0
[3,1,4,2,5] => 0
[3,1,4,5,2] => 0
[3,1,5,2,4] => 0
[3,1,5,4,2] => 1
[3,2,1,4,5] => 1
[3,2,1,5,4] => 1
[3,2,4,1,5] => 1
[3,2,4,5,1] => 1
[3,2,5,1,4] => 1
[3,2,5,4,1] => 2
[3,4,1,2,5] => 1
[3,4,1,5,2] => 1
[3,4,2,1,5] => 2
[3,4,2,5,1] => 2
[3,4,5,1,2] => 1
[3,4,5,2,1] => 2
[3,5,1,2,4] => 1
[3,5,1,4,2] => 2
[3,5,2,1,4] => 2
[3,5,2,4,1] => 3
[3,5,4,1,2] => 2
[3,5,4,2,1] => 3
[4,1,2,3,5] => 0
[4,1,2,5,3] => 0
[4,1,3,2,5] => 1
[4,1,3,5,2] => 1
[4,1,5,2,3] => 1
[4,1,5,3,2] => 2
[4,2,1,3,5] => 1
[4,2,1,5,3] => 1
[4,2,3,1,5] => 2
[4,2,3,5,1] => 2
[4,2,5,1,3] => 2
[4,2,5,3,1] => 3
[4,3,1,2,5] => 2
[4,3,1,5,2] => 2
[4,3,2,1,5] => 2
[4,3,2,5,1] => 2
[4,3,5,1,2] => 2
[4,3,5,2,1] => 3
[4,5,1,2,3] => 1
[4,5,1,3,2] => 2
[4,5,2,1,3] => 2
[4,5,2,3,1] => 3
[4,5,3,1,2] => 3
[4,5,3,2,1] => 4
[5,1,2,3,4] => 0
[5,1,2,4,3] => 1
[5,1,3,2,4] => 1
[5,1,3,4,2] => 2
[5,1,4,2,3] => 2
[5,1,4,3,2] => 2
[5,2,1,3,4] => 1
[5,2,1,4,3] => 2
[5,2,3,1,4] => 2
[5,2,3,4,1] => 3
[5,2,4,1,3] => 3
[5,2,4,3,1] => 3
[5,3,1,2,4] => 2
[5,3,1,4,2] => 3
[5,3,2,1,4] => 2
[5,3,2,4,1] => 3
[5,3,4,1,2] => 3
[5,3,4,2,1] => 4
[5,4,1,2,3] => 2
[5,4,1,3,2] => 3
[5,4,2,1,3] => 3
[5,4,2,3,1] => 4
[5,4,3,1,2] => 4
[5,4,3,2,1] => 5
[1,2,3,4,5,6] => 0
[1,2,3,4,6,5] => 0
[1,2,3,5,4,6] => 0
[1,2,3,5,6,4] => 0
[1,2,3,6,4,5] => 0
[1,2,3,6,5,4] => 1
[1,2,4,3,5,6] => 0
[1,2,4,3,6,5] => 0
[1,2,4,5,3,6] => 0
[1,2,4,5,6,3] => 0
[1,2,4,6,3,5] => 0
[1,2,4,6,5,3] => 1
[1,2,5,3,4,6] => 0
[1,2,5,3,6,4] => 0
[1,2,5,4,3,6] => 1
[1,2,5,4,6,3] => 1
[1,2,5,6,3,4] => 1
[1,2,5,6,4,3] => 2
[1,2,6,3,4,5] => 0
[1,2,6,3,5,4] => 1
[1,2,6,4,3,5] => 1
[1,2,6,4,5,3] => 2
[1,2,6,5,3,4] => 2
[1,2,6,5,4,3] => 2
[1,3,2,4,5,6] => 0
[1,3,2,4,6,5] => 0
[1,3,2,5,4,6] => 0
[1,3,2,5,6,4] => 0
[1,3,2,6,4,5] => 0
[1,3,2,6,5,4] => 1
[1,3,4,2,5,6] => 0
[1,3,4,2,6,5] => 0
[1,3,4,5,2,6] => 0
[1,3,4,5,6,2] => 0
[1,3,4,6,2,5] => 0
[1,3,4,6,5,2] => 1
[1,3,5,2,4,6] => 0
[1,3,5,2,6,4] => 0
[1,3,5,4,2,6] => 1
[1,3,5,4,6,2] => 1
[1,3,5,6,2,4] => 1
[1,3,5,6,4,2] => 2
[1,3,6,2,4,5] => 0
[1,3,6,2,5,4] => 1
[1,3,6,4,2,5] => 1
[1,3,6,4,5,2] => 2
[1,3,6,5,2,4] => 2
[1,3,6,5,4,2] => 2
[1,4,2,3,5,6] => 0
[1,4,2,3,6,5] => 0
[1,4,2,5,3,6] => 0
[1,4,2,5,6,3] => 0
[1,4,2,6,3,5] => 0
[1,4,2,6,5,3] => 1
[1,4,3,2,5,6] => 1
[1,4,3,2,6,5] => 1
[1,4,3,5,2,6] => 1
[1,4,3,5,6,2] => 1
[1,4,3,6,2,5] => 1
[1,4,3,6,5,2] => 2
[1,4,5,2,3,6] => 1
[1,4,5,2,6,3] => 1
[1,4,5,3,2,6] => 2
[1,4,5,3,6,2] => 2
[1,4,5,6,2,3] => 1
[1,4,5,6,3,2] => 2
[1,4,6,2,3,5] => 1
[1,4,6,2,5,3] => 2
[1,4,6,3,2,5] => 2
[1,4,6,3,5,2] => 3
[1,4,6,5,2,3] => 2
[1,4,6,5,3,2] => 3
[1,5,2,3,4,6] => 0
[1,5,2,3,6,4] => 0
[1,5,2,4,3,6] => 1
[1,5,2,4,6,3] => 1
[1,5,2,6,3,4] => 1
[1,5,2,6,4,3] => 2
[1,5,3,2,4,6] => 1
[1,5,3,2,6,4] => 1
[1,5,3,4,2,6] => 2
[1,5,3,4,6,2] => 2
[1,5,3,6,2,4] => 2
[1,5,3,6,4,2] => 3
[1,5,4,2,3,6] => 2
[1,5,4,2,6,3] => 2
[1,5,4,3,2,6] => 2
[1,5,4,3,6,2] => 2
[1,5,4,6,2,3] => 2
[1,5,4,6,3,2] => 3
[1,5,6,2,3,4] => 1
[1,5,6,2,4,3] => 2
[1,5,6,3,2,4] => 2
[1,5,6,3,4,2] => 3
[1,5,6,4,2,3] => 3
[1,5,6,4,3,2] => 4
[1,6,2,3,4,5] => 0
[1,6,2,3,5,4] => 1
[1,6,2,4,3,5] => 1
[1,6,2,4,5,3] => 2
[1,6,2,5,3,4] => 2
[1,6,2,5,4,3] => 2
[1,6,3,2,4,5] => 1
[1,6,3,2,5,4] => 2
[1,6,3,4,2,5] => 2
[1,6,3,4,5,2] => 3
[1,6,3,5,2,4] => 3
[1,6,3,5,4,2] => 3
[1,6,4,2,3,5] => 2
[1,6,4,2,5,3] => 3
[1,6,4,3,2,5] => 2
[1,6,4,3,5,2] => 3
[1,6,4,5,2,3] => 3
[1,6,4,5,3,2] => 4
[1,6,5,2,3,4] => 2
[1,6,5,2,4,3] => 3
[1,6,5,3,2,4] => 3
[1,6,5,3,4,2] => 4
[1,6,5,4,2,3] => 4
[1,6,5,4,3,2] => 5
[2,1,3,4,5,6] => 0
[2,1,3,4,6,5] => 0
[2,1,3,5,4,6] => 0
[2,1,3,5,6,4] => 0
[2,1,3,6,4,5] => 0
[2,1,3,6,5,4] => 1
[2,1,4,3,5,6] => 0
[2,1,4,3,6,5] => 0
[2,1,4,5,3,6] => 0
[2,1,4,5,6,3] => 0
[2,1,4,6,3,5] => 0
[2,1,4,6,5,3] => 1
[2,1,5,3,4,6] => 0
[2,1,5,3,6,4] => 0
[2,1,5,4,3,6] => 1
[2,1,5,4,6,3] => 1
[2,1,5,6,3,4] => 1
[2,1,5,6,4,3] => 2
[2,1,6,3,4,5] => 0
[2,1,6,3,5,4] => 1
[2,1,6,4,3,5] => 1
[2,1,6,4,5,3] => 2
[2,1,6,5,3,4] => 2
[2,1,6,5,4,3] => 2
[2,3,1,4,5,6] => 0
[2,3,1,4,6,5] => 0
[2,3,1,5,4,6] => 0
[2,3,1,5,6,4] => 0
[2,3,1,6,4,5] => 0
[2,3,1,6,5,4] => 1
[2,3,4,1,5,6] => 0
[2,3,4,1,6,5] => 0
[2,3,4,5,1,6] => 0
[2,3,4,5,6,1] => 0
[2,3,4,6,1,5] => 0
[2,3,4,6,5,1] => 1
[2,3,5,1,4,6] => 0
[2,3,5,1,6,4] => 0
[2,3,5,4,1,6] => 1
[2,3,5,4,6,1] => 1
[2,3,5,6,1,4] => 1
[2,3,5,6,4,1] => 2
[2,3,6,1,4,5] => 0
[2,3,6,1,5,4] => 1
[2,3,6,4,1,5] => 1
[2,3,6,4,5,1] => 2
[2,3,6,5,1,4] => 2
[2,3,6,5,4,1] => 2
[2,4,1,3,5,6] => 0
[2,4,1,3,6,5] => 0
[2,4,1,5,3,6] => 0
[2,4,1,5,6,3] => 0
[2,4,1,6,3,5] => 0
[2,4,1,6,5,3] => 1
[2,4,3,1,5,6] => 1
[2,4,3,1,6,5] => 1
[2,4,3,5,1,6] => 1
[2,4,3,5,6,1] => 1
[2,4,3,6,1,5] => 1
[2,4,3,6,5,1] => 2
[2,4,5,1,3,6] => 1
[2,4,5,1,6,3] => 1
[2,4,5,3,1,6] => 2
[2,4,5,3,6,1] => 2
[2,4,5,6,1,3] => 1
[2,4,5,6,3,1] => 2
[2,4,6,1,3,5] => 1
[2,4,6,1,5,3] => 2
[2,4,6,3,1,5] => 2
[2,4,6,3,5,1] => 3
[2,4,6,5,1,3] => 2
[2,4,6,5,3,1] => 3
[2,5,1,3,4,6] => 0
[2,5,1,3,6,4] => 0
[2,5,1,4,3,6] => 1
[2,5,1,6,3,4] => 1
[2,5,1,6,4,3] => 2
[2,5,3,1,4,6] => 1
[2,5,3,1,6,4] => 1
[2,5,3,4,1,6] => 2
[2,5,3,4,6,1] => 2
[2,5,3,6,1,4] => 2
[2,5,3,6,4,1] => 3
[2,5,4,1,3,6] => 2
[2,5,4,1,6,3] => 2
[2,5,4,3,1,6] => 2
[2,5,4,3,6,1] => 2
[2,5,4,6,1,3] => 2
[2,5,4,6,3,1] => 3
[2,5,6,1,3,4] => 1
[2,5,6,1,4,3] => 2
[2,5,6,3,1,4] => 2
[2,5,6,3,4,1] => 3
[2,5,6,4,1,3] => 3
[2,5,6,4,3,1] => 4
[2,6,1,3,4,5] => 0
[2,6,1,3,5,4] => 1
[2,6,1,4,3,5] => 1
[2,6,1,4,5,3] => 2
[2,6,1,5,3,4] => 2
[2,6,1,5,4,3] => 2
[2,6,3,1,4,5] => 1
[2,6,3,4,1,5] => 2
[2,6,3,4,5,1] => 3
[2,6,3,5,1,4] => 3
[2,6,3,5,4,1] => 3
[2,6,4,1,3,5] => 2
[2,6,4,1,5,3] => 3
[2,6,4,3,5,1] => 3
[2,6,4,5,1,3] => 3
[2,6,4,5,3,1] => 4
[2,6,5,1,4,3] => 3
[2,6,5,3,1,4] => 3
[2,6,5,3,4,1] => 4
[2,6,5,4,1,3] => 4
[2,6,5,4,3,1] => 5
[3,1,2,4,5,6] => 0
[3,1,2,4,6,5] => 0
[3,1,2,5,4,6] => 0
[3,1,2,5,6,4] => 0
[3,1,2,6,4,5] => 0
[3,1,2,6,5,4] => 1
[3,1,4,2,5,6] => 0
[3,1,4,2,6,5] => 0
[3,1,4,5,2,6] => 0
[3,1,4,5,6,2] => 0
[3,1,4,6,2,5] => 0
[3,1,4,6,5,2] => 1
[3,1,5,2,4,6] => 0
[3,1,5,2,6,4] => 0
[3,1,5,4,2,6] => 1
[3,1,5,4,6,2] => 1
[3,1,5,6,2,4] => 1
[3,1,5,6,4,2] => 2
[3,1,6,2,4,5] => 0
[3,1,6,2,5,4] => 1
[3,1,6,4,2,5] => 1
[3,1,6,4,5,2] => 2
[3,1,6,5,2,4] => 2
[3,1,6,5,4,2] => 2
[3,2,1,4,5,6] => 1
[3,2,1,4,6,5] => 1
[3,2,1,5,4,6] => 1
[3,2,1,5,6,4] => 1
[3,2,1,6,4,5] => 1
[3,2,1,6,5,4] => 2
[3,2,4,1,5,6] => 1
[3,2,4,1,6,5] => 1
[3,2,4,5,1,6] => 1
[3,2,4,5,6,1] => 1
[3,2,4,6,1,5] => 1
[3,2,4,6,5,1] => 2
[3,2,5,1,4,6] => 1
[3,2,5,1,6,4] => 1
[3,2,5,4,1,6] => 2
[3,2,5,4,6,1] => 2
[3,2,5,6,1,4] => 2
[3,2,5,6,4,1] => 3
[3,2,6,1,4,5] => 1
[3,2,6,1,5,4] => 2
[3,2,6,4,1,5] => 2
[3,2,6,4,5,1] => 3
[3,2,6,5,1,4] => 3
[3,2,6,5,4,1] => 3
[3,4,1,2,5,6] => 1
[3,4,1,2,6,5] => 1
[3,4,1,5,2,6] => 1
[3,4,1,5,6,2] => 1
[3,4,1,6,2,5] => 1
[3,4,1,6,5,2] => 2
[3,4,2,1,5,6] => 2
[3,4,2,1,6,5] => 2
[3,4,2,5,1,6] => 2
[3,4,2,5,6,1] => 2
[3,4,2,6,1,5] => 2
[3,4,2,6,5,1] => 3
[3,4,5,1,2,6] => 1
[3,4,5,1,6,2] => 1
[3,4,5,2,1,6] => 2
[3,4,5,2,6,1] => 2
[3,4,5,6,1,2] => 2
[3,4,5,6,2,1] => 3
[3,4,6,1,2,5] => 1
[3,4,6,1,5,2] => 2
[3,4,6,2,1,5] => 2
[3,4,6,2,5,1] => 3
[3,4,6,5,1,2] => 3
[3,4,6,5,2,1] => 4
[3,5,1,2,4,6] => 1
[3,5,1,2,6,4] => 1
[3,5,1,4,2,6] => 2
[3,5,1,4,6,2] => 2
[3,5,1,6,2,4] => 2
[3,5,1,6,4,2] => 3
[3,5,2,1,4,6] => 2
[3,5,2,1,6,4] => 2
[3,5,2,4,1,6] => 3
[3,5,2,4,6,1] => 3
[3,5,2,6,1,4] => 3
[3,5,2,6,4,1] => 4
[3,5,4,1,2,6] => 2
[3,5,4,1,6,2] => 2
[3,5,4,2,1,6] => 3
[3,5,4,2,6,1] => 3
[3,5,4,6,1,2] => 3
[3,5,4,6,2,1] => 4
[3,5,6,1,2,4] => 2
[3,5,6,1,4,2] => 3
[3,5,6,2,1,4] => 3
[3,5,6,2,4,1] => 4
[3,5,6,4,1,2] => 4
[3,5,6,4,2,1] => 5
[3,6,1,2,4,5] => 1
[3,6,1,2,5,4] => 2
[3,6,1,4,2,5] => 2
[3,6,1,4,5,2] => 3
[3,6,1,5,2,4] => 3
[3,6,1,5,4,2] => 3
[3,6,2,1,4,5] => 2
[3,6,2,1,5,4] => 3
[3,6,2,4,1,5] => 3
[3,6,2,4,5,1] => 4
[3,6,2,5,1,4] => 4
[3,6,2,5,4,1] => 4
[3,6,4,1,2,5] => 2
[3,6,4,1,5,2] => 3
[3,6,4,2,1,5] => 3
[3,6,4,2,5,1] => 4
[3,6,4,5,1,2] => 4
[3,6,4,5,2,1] => 5
[3,6,5,1,2,4] => 3
[3,6,5,1,4,2] => 4
[3,6,5,2,1,4] => 4
[3,6,5,2,4,1] => 5
[3,6,5,4,1,2] => 5
[3,6,5,4,2,1] => 6
[4,1,2,3,5,6] => 0
[4,1,2,3,6,5] => 0
[4,1,2,5,3,6] => 0
[4,1,2,5,6,3] => 0
[4,1,2,6,3,5] => 0
[4,1,2,6,5,3] => 1
[4,1,3,2,5,6] => 1
[4,1,3,2,6,5] => 1
[4,1,3,5,2,6] => 1
[4,1,3,5,6,2] => 1
[4,1,3,6,2,5] => 1
[4,1,3,6,5,2] => 2
[4,1,5,2,3,6] => 1
[4,1,5,2,6,3] => 1
[4,1,5,3,2,6] => 2
[4,1,5,3,6,2] => 2
[4,1,5,6,2,3] => 1
[4,1,5,6,3,2] => 2
[4,1,6,2,3,5] => 1
[4,1,6,2,5,3] => 2
[4,1,6,3,2,5] => 2
[4,1,6,3,5,2] => 3
[4,1,6,5,2,3] => 2
[4,1,6,5,3,2] => 3
[4,2,1,3,5,6] => 1
[4,2,1,3,6,5] => 1
[4,2,1,5,3,6] => 1
[4,2,1,5,6,3] => 1
[4,2,1,6,3,5] => 1
[4,2,1,6,5,3] => 2
[4,2,3,1,5,6] => 2
[4,2,3,1,6,5] => 2
[4,2,3,5,1,6] => 2
[4,2,3,5,6,1] => 2
[4,2,3,6,1,5] => 2
[4,2,3,6,5,1] => 3
[4,2,5,1,3,6] => 2
[4,2,5,1,6,3] => 2
[4,2,5,3,1,6] => 3
[4,2,5,3,6,1] => 3
[4,2,5,6,1,3] => 2
[4,2,5,6,3,1] => 3
[4,2,6,1,3,5] => 2
[4,2,6,1,5,3] => 3
[4,2,6,3,1,5] => 3
[4,2,6,3,5,1] => 4
[4,2,6,5,1,3] => 3
[4,2,6,5,3,1] => 4
[4,3,1,2,5,6] => 2
[4,3,1,2,6,5] => 2
[4,3,1,5,2,6] => 2
[4,3,1,5,6,2] => 2
[4,3,1,6,2,5] => 2
[4,3,1,6,5,2] => 3
[4,3,2,1,5,6] => 2
[4,3,2,1,6,5] => 2
[4,3,2,5,1,6] => 2
[4,3,2,5,6,1] => 2
[4,3,2,6,1,5] => 2
[4,3,2,6,5,1] => 3
[4,3,5,1,2,6] => 2
[4,3,5,1,6,2] => 2
[4,3,5,2,1,6] => 3
[4,3,5,2,6,1] => 3
[4,3,5,6,1,2] => 3
[4,3,5,6,2,1] => 4
[4,3,6,1,2,5] => 2
[4,3,6,1,5,2] => 3
[4,3,6,2,1,5] => 3
[4,3,6,2,5,1] => 4
[4,3,6,5,1,2] => 4
[4,3,6,5,2,1] => 4
[4,5,1,2,3,6] => 1
[4,5,1,2,6,3] => 1
[4,5,1,3,2,6] => 2
[4,5,1,3,6,2] => 2
[4,5,1,6,2,3] => 2
[4,5,1,6,3,2] => 3
[4,5,2,1,3,6] => 2
[4,5,2,1,6,3] => 2
[4,5,2,3,1,6] => 3
[4,5,2,3,6,1] => 3
[4,5,2,6,1,3] => 3
[4,5,2,6,3,1] => 4
[4,5,3,1,2,6] => 3
[4,5,3,1,6,2] => 3
[4,5,3,2,1,6] => 4
[4,5,3,2,6,1] => 4
[4,5,3,6,1,2] => 4
[4,5,3,6,2,1] => 5
[4,5,6,1,2,3] => 3
[4,5,6,1,3,2] => 4
[4,5,6,2,1,3] => 4
[4,5,6,2,3,1] => 5
[4,5,6,3,1,2] => 4
[4,5,6,3,2,1] => 5
[4,6,1,2,3,5] => 1
[4,6,1,2,5,3] => 2
[4,6,1,3,5,2] => 3
[4,6,1,5,2,3] => 3
[4,6,1,5,3,2] => 4
[4,6,2,1,3,5] => 2
[4,6,2,1,5,3] => 3
[4,6,2,3,1,5] => 3
[4,6,2,3,5,1] => 4
[4,6,2,5,1,3] => 4
[4,6,2,5,3,1] => 4
[4,6,3,1,2,5] => 3
[4,6,3,1,5,2] => 4
[4,6,3,2,1,5] => 4
[4,6,3,2,5,1] => 5
[4,6,3,5,1,2] => 5
[4,6,3,5,2,1] => 5
[4,6,5,1,2,3] => 4
[4,6,5,1,3,2] => 4
[4,6,5,2,1,3] => 5
[4,6,5,2,3,1] => 5
[4,6,5,3,1,2] => 5
[4,6,5,3,2,1] => 6
[5,1,2,3,4,6] => 0
[5,1,2,3,6,4] => 0
[5,1,2,4,3,6] => 1
[5,1,2,4,6,3] => 1
[5,1,2,6,3,4] => 1
[5,1,2,6,4,3] => 2
[5,1,3,2,4,6] => 1
[5,1,3,2,6,4] => 1
[5,1,3,4,2,6] => 2
[5,1,3,4,6,2] => 2
[5,1,3,6,2,4] => 2
[5,1,3,6,4,2] => 3
[5,1,4,2,3,6] => 2
[5,1,4,2,6,3] => 2
[5,1,4,3,2,6] => 2
[5,1,4,6,3,2] => 3
[5,1,6,2,3,4] => 1
[5,1,6,2,4,3] => 2
[5,1,6,3,2,4] => 2
[5,1,6,3,4,2] => 3
[5,1,6,4,2,3] => 3
[5,1,6,4,3,2] => 4
[5,2,1,3,4,6] => 1
[5,2,1,3,6,4] => 1
[5,2,1,4,3,6] => 2
[5,2,1,4,6,3] => 2
[5,2,1,6,3,4] => 2
[5,2,1,6,4,3] => 3
[5,2,3,1,4,6] => 2
[5,2,3,1,6,4] => 2
[5,2,3,4,1,6] => 3
[5,2,3,4,6,1] => 3
[5,2,3,6,1,4] => 3
[5,2,3,6,4,1] => 4
[5,2,4,1,3,6] => 3
[5,2,4,1,6,3] => 3
[5,2,4,3,1,6] => 3
[5,2,4,3,6,1] => 3
[5,2,4,6,1,3] => 3
[5,2,4,6,3,1] => 4
[5,2,6,1,3,4] => 2
[5,2,6,1,4,3] => 3
[5,2,6,3,1,4] => 3
[5,2,6,3,4,1] => 4
[5,2,6,4,1,3] => 4
[5,2,6,4,3,1] => 5
[5,3,1,2,4,6] => 2
[5,3,1,2,6,4] => 2
[5,3,1,4,2,6] => 3
[5,3,1,4,6,2] => 3
[5,3,1,6,2,4] => 3
[5,3,1,6,4,2] => 4
[5,3,2,1,4,6] => 2
[5,3,2,1,6,4] => 2
[5,3,2,4,1,6] => 3
[5,3,2,4,6,1] => 3
[5,3,2,6,1,4] => 3
[5,3,2,6,4,1] => 4
[5,3,4,1,2,6] => 3
[5,3,4,1,6,2] => 3
[5,3,4,2,1,6] => 4
[5,3,4,2,6,1] => 4
[5,3,4,6,1,2] => 4
[5,3,4,6,2,1] => 5
[5,3,6,1,2,4] => 3
[5,3,6,1,4,2] => 4
[5,3,6,2,1,4] => 4
[5,3,6,2,4,1] => 4
[5,3,6,4,1,2] => 5
[5,3,6,4,2,1] => 5
[5,4,1,2,3,6] => 2
[5,4,1,2,6,3] => 2
[5,4,1,3,2,6] => 3
[5,4,1,6,2,3] => 3
[5,4,1,6,3,2] => 4
[5,4,2,1,3,6] => 3
[5,4,2,1,6,3] => 3
[5,4,2,3,1,6] => 4
[5,4,2,3,6,1] => 4
[5,4,2,6,1,3] => 4
[5,4,2,6,3,1] => 5
[5,4,3,1,2,6] => 4
[5,4,3,1,6,2] => 4
[5,4,3,2,1,6] => 5
[5,4,3,2,6,1] => 5
[5,4,3,6,1,2] => 5
[5,4,3,6,2,1] => 6
[5,4,6,1,2,3] => 4
[5,4,6,1,3,2] => 5
[5,4,6,2,1,3] => 4
[5,4,6,2,3,1] => 5
[5,4,6,3,1,2] => 5
[5,4,6,3,2,1] => 6
[5,6,1,2,3,4] => 2
[5,6,1,2,4,3] => 3
[5,6,1,3,2,4] => 3
[5,6,1,3,4,2] => 4
[5,6,1,4,2,3] => 4
[5,6,1,4,3,2] => 5
[5,6,2,1,3,4] => 3
[5,6,2,1,4,3] => 4
[5,6,2,3,1,4] => 4
[5,6,2,3,4,1] => 4
[5,6,2,4,1,3] => 5
[5,6,2,4,3,1] => 5
[5,6,3,1,2,4] => 4
[5,6,3,1,4,2] => 5
[5,6,3,2,1,4] => 5
[5,6,3,2,4,1] => 5
[5,6,3,4,1,2] => 6
[5,6,3,4,2,1] => 6
[5,6,4,1,2,3] => 4
[5,6,4,1,3,2] => 5
[5,6,4,2,1,3] => 5
[5,6,4,2,3,1] => 6
[5,6,4,3,1,2] => 6
[5,6,4,3,2,1] => 7
[6,1,2,3,4,5] => 0
[6,1,2,3,5,4] => 1
[6,1,2,4,3,5] => 1
[6,1,2,4,5,3] => 2
[6,1,2,5,3,4] => 2
[6,1,2,5,4,3] => 2
[6,1,3,2,4,5] => 1
[6,1,3,2,5,4] => 2
[6,1,3,4,2,5] => 2
[6,1,3,4,5,2] => 3
[6,1,3,5,2,4] => 3
[6,1,3,5,4,2] => 3
[6,1,4,2,3,5] => 2
[6,1,4,2,5,3] => 3
[6,1,4,3,2,5] => 2
[6,1,4,3,5,2] => 3
[6,1,4,5,2,3] => 3
[6,1,4,5,3,2] => 4
[6,1,5,2,3,4] => 2
[6,1,5,2,4,3] => 3
[6,1,5,3,2,4] => 3
[6,1,5,3,4,2] => 4
[6,1,5,4,2,3] => 4
[6,1,5,4,3,2] => 5
[6,2,1,3,4,5] => 1
[6,2,1,3,5,4] => 2
[6,2,1,4,3,5] => 2
[6,2,1,4,5,3] => 3
[6,2,1,5,3,4] => 3
[6,2,1,5,4,3] => 3
[6,2,3,1,4,5] => 2
[6,2,3,1,5,4] => 3
[6,2,3,4,1,5] => 3
[6,2,3,4,5,1] => 4
[6,2,3,5,1,4] => 4
[6,2,3,5,4,1] => 4
[6,2,4,1,3,5] => 3
[6,2,4,1,5,3] => 4
[6,2,4,3,1,5] => 3
[6,2,4,3,5,1] => 4
[6,2,4,5,1,3] => 4
[6,2,4,5,3,1] => 5
[6,2,5,1,3,4] => 3
[6,2,5,1,4,3] => 4
[6,2,5,3,1,4] => 4
[6,2,5,3,4,1] => 5
[6,2,5,4,1,3] => 5
[6,2,5,4,3,1] => 6
[6,3,1,2,4,5] => 2
[6,3,1,2,5,4] => 3
[6,3,1,4,2,5] => 3
[6,3,1,4,5,2] => 4
[6,3,1,5,2,4] => 4
[6,3,1,5,4,2] => 4
[6,3,2,1,4,5] => 2
[6,3,2,1,5,4] => 3
[6,3,2,4,1,5] => 3
[6,3,2,4,5,1] => 4
[6,3,2,5,1,4] => 4
[6,3,2,5,4,1] => 4
[6,3,4,1,2,5] => 3
[6,3,4,1,5,2] => 4
[6,3,4,2,1,5] => 4
[6,3,4,2,5,1] => 5
[6,3,4,5,1,2] => 4
[6,3,4,5,2,1] => 5
[6,3,5,1,2,4] => 4
[6,3,5,1,4,2] => 4
[6,3,5,2,1,4] => 5
[6,3,5,2,4,1] => 5
[6,3,5,4,1,2] => 5
[6,3,5,4,2,1] => 6
[6,4,1,2,3,5] => 2
[6,4,1,2,5,3] => 3
[6,4,1,3,2,5] => 3
[6,4,1,3,5,2] => 4
[6,4,1,5,2,3] => 4
[6,4,1,5,3,2] => 5
[6,4,2,1,3,5] => 3
[6,4,2,1,5,3] => 4
[6,4,2,3,1,5] => 4
[6,4,2,3,5,1] => 5
[6,4,2,5,1,3] => 4
[6,4,2,5,3,1] => 5
[6,4,3,1,2,5] => 4
[6,4,3,1,5,2] => 5
[6,4,3,2,1,5] => 5
[6,4,3,2,5,1] => 6
[6,4,3,5,1,2] => 5
[6,4,3,5,2,1] => 6
[6,4,5,1,2,3] => 5
[6,4,5,1,3,2] => 5
[6,4,5,2,1,3] => 5
[6,4,5,2,3,1] => 6
[6,4,5,3,1,2] => 6
[6,4,5,3,2,1] => 7
[6,5,1,2,3,4] => 3
[6,5,1,2,4,3] => 4
[6,5,1,3,2,4] => 4
[6,5,1,3,4,2] => 5
[6,5,1,4,2,3] => 5
[6,5,1,4,3,2] => 6
[6,5,2,1,3,4] => 4
[6,5,2,1,4,3] => 4
[6,5,2,3,1,4] => 5
[6,5,2,3,4,1] => 5
[6,5,2,4,1,3] => 5
[6,5,2,4,3,1] => 6
[6,5,3,1,2,4] => 5
[6,5,3,1,4,2] => 5
[6,5,3,2,1,4] => 6
click to show generating function       
Description
The maximum defect over any reduced expression for a permutation and any subexpression.
References
[1] Deodhar, V. V. A combinatorial setting for questions in Kazhdan-Lusztig theory MathSciNet:1065215
[2] Billey, S. C., Warrington, G. S. Kazhdan-Lusztig polynomials for 321-hexagon-avoiding permutations MathSciNet:1826948
[3] Jones, B., Woo, A. Mask formulas for cograssmannian Kazhdan-Lusztig polynomials arXiv:1011.1110
Code
# WARNING: takes a long time even for permutations of 5.

def defect_set(sigma, w):
    """
    INPUT:

    - w is a reduced word for a permutation
    - sigma is the mask, given as a binary word of length l(w)

    OUTPUT:
    
    - the defect set, that is the set of positions j such that
    l(w^{\sigma[j-1]} w_j) < l(w^{\sigma[j-1]}) 

    """
    res = []
    S = Permutations(max(w)+1)
    w_S = [S.simple_reflection(e) for e in w]
    w_up_to_j = S([])
    for j in range(len(w)-1):
        if sigma[j] == 1:
            w_up_to_j = w_up_to_j.left_action_product(w_S[j])

        if (w_up_to_j.left_action_product(w_S[j+1])).length() < w_up_to_j.length():
            res += [j+2]
    return res

def statistic(pi):
    """
    sage: statistic(Permutation([4,3,5,2,1]))
    3
    sage: statistic(Permutation([5,4,2,1,3]))
    3
    """
    k = pi.length()
    if not k:
        return 0
    masks = cartesian_product([[0,1]]*k)
    return max([len(defect_set(m, w)) 
                for m in masks
                for w in pi.reduced_words()])

Created
Feb 13, 2013 at 23:53 by Sara Billey
Updated
Mar 31, 2019 at 21:08 by Martin Rubey