Identifier
- St000308: Permutations ⟶ ℤ
Values
[1] => 1
[1,2] => 2
[2,1] => 1
[1,2,3] => 3
[1,3,2] => 2
[2,1,3] => 2
[2,3,1] => 2
[3,1,2] => 2
[3,2,1] => 1
[1,2,3,4] => 4
[1,2,4,3] => 3
[1,3,2,4] => 3
[1,3,4,2] => 3
[1,4,2,3] => 3
[1,4,3,2] => 2
[2,1,3,4] => 3
[2,1,4,3] => 2
[2,3,1,4] => 2
[2,3,4,1] => 3
[2,4,1,3] => 2
[2,4,3,1] => 2
[3,1,2,4] => 3
[3,1,4,2] => 2
[3,2,1,4] => 2
[3,2,4,1] => 2
[3,4,1,2] => 2
[3,4,2,1] => 2
[4,1,2,3] => 3
[4,1,3,2] => 2
[4,2,1,3] => 2
[4,2,3,1] => 2
[4,3,1,2] => 2
[4,3,2,1] => 1
[1,2,3,4,5] => 5
[1,2,3,5,4] => 4
[1,2,4,3,5] => 4
[1,2,4,5,3] => 4
[1,2,5,3,4] => 4
[1,2,5,4,3] => 3
[1,3,2,4,5] => 4
[1,3,2,5,4] => 3
[1,3,4,2,5] => 3
[1,3,4,5,2] => 4
[1,3,5,2,4] => 3
[1,3,5,4,2] => 3
[1,4,2,3,5] => 4
[1,4,2,5,3] => 3
[1,4,3,2,5] => 3
[1,4,3,5,2] => 3
[1,4,5,2,3] => 3
[1,4,5,3,2] => 3
[1,5,2,3,4] => 4
[1,5,2,4,3] => 3
[1,5,3,2,4] => 3
[1,5,3,4,2] => 3
[1,5,4,2,3] => 3
[1,5,4,3,2] => 2
[2,1,3,4,5] => 4
[2,1,3,5,4] => 3
[2,1,4,3,5] => 3
[2,1,4,5,3] => 3
[2,1,5,3,4] => 3
[2,1,5,4,3] => 2
[2,3,1,4,5] => 3
[2,3,1,5,4] => 2
[2,3,4,1,5] => 3
[2,3,4,5,1] => 4
[2,3,5,1,4] => 3
[2,3,5,4,1] => 3
[2,4,1,3,5] => 3
[2,4,1,5,3] => 2
[2,4,3,1,5] => 2
[2,4,3,5,1] => 3
[2,4,5,1,3] => 3
[2,4,5,3,1] => 3
[2,5,1,3,4] => 3
[2,5,1,4,3] => 2
[2,5,3,1,4] => 2
[2,5,3,4,1] => 3
[2,5,4,1,3] => 2
[2,5,4,3,1] => 2
[3,1,2,4,5] => 4
[3,1,2,5,4] => 3
[3,1,4,2,5] => 3
[3,1,4,5,2] => 3
[3,1,5,2,4] => 3
[3,1,5,4,2] => 2
[3,2,1,4,5] => 3
[3,2,1,5,4] => 2
[3,2,4,1,5] => 2
[3,2,4,5,1] => 3
[3,2,5,1,4] => 2
[3,2,5,4,1] => 2
[3,4,1,2,5] => 3
[3,4,1,5,2] => 2
[3,4,2,1,5] => 2
[3,4,2,5,1] => 2
[3,4,5,1,2] => 3
[3,4,5,2,1] => 3
[3,5,1,2,4] => 3
[3,5,1,4,2] => 2
>>> Load all 1176 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 height of the tree associated to a permutation.
A permutation can be mapped to a rooted tree with vertices $\{0,1,2,\ldots,n\}$ and root $0$ in the following way. Entries of the permutations are inserted one after the other, each child is larger than its parent and the children are in strict order from left to right. Details of the construction are found in [1].
The statistic is given by the height of this tree.
See also St000325The width of the tree associated to a permutation. for the width of this tree.
A permutation can be mapped to a rooted tree with vertices $\{0,1,2,\ldots,n\}$ and root $0$ in the following way. Entries of the permutations are inserted one after the other, each child is larger than its parent and the children are in strict order from left to right. Details of the construction are found in [1].
The statistic is given by the height of this tree.
See also St000325The width of the tree associated to a permutation. for the width of this tree.
References
[1] Permutation trees of power n and height k. OEIS:A179454
[2] http://oeis.org/wiki/User:Peter_Luschny/PermutationTrees
[2] http://oeis.org/wiki/User:Peter_Luschny/PermutationTrees
Code
def statistic(pi):
if pi == []: return 0
root, i, h = 0, 0, 0
branch, next = [root], pi[0]
while true:
while next < branch[len(branch)-1]:
del(branch[len(branch)-1])
current = root
while next > current:
i += 1
branch.append(next)
h = max(h, len(branch))
if i >= len(pi): return h-1
current, next = next, pi[i]
Created
Dec 08, 2015 at 08:43 by Peter Luschny
Updated
Feb 25, 2022 at 16:58 by Nadia Lafreniere
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!