Stirling permutation

In combinatorial mathematics, a Stirling permutation of order k is a permutation of the multiset 1, 1, 2, 2, ..., k, k (with two copies of each value from 1 to k) with the additional property that, for each value i appearing in the permutation, the values between the two copies of i are larger than i. For instance, the 15 Stirling permutations of order three are
 * 1,1,2,2,3,3;  1,2,2,1,3,3;   2,2,1,1,3,3;
 * 1,1,2,3,3,2;  1,2,2,3,3,1;   2,2,1,3,3,1;
 * 1,1,3,3,2,2;  1,2,3,3,2,1;   2,2,3,3,1,1;
 * 1,3,3,1,2,2;  1,3,3,2,2,1;   2,3,3,2,1,1;
 * 3,3,1,1,2,2;  3,3,1,2,2,1;   3,3,2,2,1,1.

The number of Stirling permutations of order k is given by the double factorial (2k &minus; 1)!!. Stirling permutations were introduced by in order to show that certain numbers (the numbers of Stirling permutations with a fixed number of descents) are non-negative. They chose the name because of a connection to certain polynomials defined from the Stirling numbers, which are in turn named after 18th-century Scottish mathematician James Stirling.

Stirling permutations may be used to describe the sequences by which it is possible to construct a rooted plane tree with k edges by adding leaves one by one to the tree. For, if the edges are numbered by the order in which they were inserted, then the sequence of numbers in an Euler tour of the tree (formed by doubling the edges of the tree and traversing the children of each node in left to right order) is a Stirling permutation. Conversely every Stirling permutation describes a tree construction sequence, in which the next edge closer to the root from an edge labeled i is the one whose pair of values most closely surrounds the pair of i values in the permutation.

Stirling permutations have been generalized to the permutations of a multiset with more than two copies of each value. Researchers have also studied the number of Stirling permutations that avoid certain patterns.