1 Introduction

Let n and \(m_1,m_2,\ldots ,m_n\) be positive integers and let \(\{1,2,\ldots ,n\}^{\times (m_1,m_2,\ldots ,m_n)}\) denote the multiset \(\{m_1\cdot 1, m_2\cdot 2,\ldots , m_n\cdot n\}\) consisting of \(m_i\) integers equal to i \((1\le i\le n)\). If \(m_1=m_2=\cdots =m_n=k\) for some integer k, then we abbreviate this to \(\{1,2,\ldots ,n\}^{\times k}\). The permutations of \(\{1,2,\ldots ,n\}^{\times (m_1,m_2,\ldots ,m_n)}\), written as a p-tuple with \(p=m_1+m_2+\cdots +m_n\), are certain multipermutations of \(\{1,2,\ldots ,n\}\). The set of multipermutations \(\sigma _n^{\times (m_1,m_2,\ldots ,m_n)}\) of the multiset \(\{m_1\cdot 1, m_2\cdot 2,\ldots , m_n\cdot n\}\) is denoted by \({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n)}\). In the special case mentioned above this is abbreviated to \(\sigma _n^{\times k}\) and \(\mathcal {S}_n^{\times k}\), respectively, and we call the resulting multipermutations k-permutations of \(\{1,2,\ldots ,n\}\). If \(k=1\), we write simply \({\mathcal S}_n\), the set of permutations of \(\{1,2,\ldots ,n\}\).

For a permutation \(\sigma _n^{\times (m_1,m_2,\ldots ,m_n)}\), let (it) denote the tth occurrence (position) of the integer i in \(\sigma _n^{\times (m_1,m_2,\ldots ,m_m)}\) (\(1\le i\le n, \,1\le t\le m_i\)). An (ordinary)inversion of \(\sigma _n^{\times (m_1,m_2,\ldots ,m_m)}\) is defined to be any occurrence (ji) of a larger integer j preceding a smaller integer i in \(\sigma _n^{\times (m_1,m_2,\ldots ,m_m)}\). In contrast, a strong inversion is an ordered pair: ((jt), (is)) where the tth occurrence of j precedes the sth occurrence of i, and \(j>i\). If \(k=1\), that is, we have \({\mathcal S}_n\), this is equivalent to the usual inversion \(j>i\) where j precedes i in the permutation. In general, numerical information on the order of occurrences of the integers involved is taken into account in a strong inversion. The multiset of ordinary inversions of \(\sigma _n^{\times (m_1,m_2,\ldots ,m_n)}\) is denoted by \({{\mathcal {I}}}(\sigma _n^{\times (m_1,m_2,\ldots ,m_n)})\). The set of strong inversions of \(\sigma _n^{\times (m_1,m_2,\ldots ,m_m)}\) is denoted by \(\mathcal {I}^*(\sigma _n^{\times (m_1,m_2,\ldots ,m_n)})\). For a k-permutation \(\sigma _n^{\times k}\) of \(\{1,2,\ldots ,n\}\) these are denoted, respectively, by \({\mathcal I}(\sigma _n^{\times k})\) and \({\mathcal I}^*(\sigma _n^{\times k})\).

It follows that every strong inversion gives an ordinary inversion (use the projection of the first coordinates of the strong inversion pair). For instance, in (2, 1, 2, 1), there are three strong inversions, namely, ((2, 1), (1, 1)), ((2, 1), (1, 2)), and ((2, 2), (1, 2)) and the multiplicity of the weak inversion (2, 1) is three. So \({\mathcal I}^*(\sigma )\subseteq {\mathcal I}^*(\tau )\) implies that \({\mathcal I}(\sigma )\subseteq {\mathcal I}(\tau )\) (as a multiset inclusion). But the converse does not hold. For example, consider \(n=2\) and the multipermutations (a) (2, 1, 1, 2) and (b) (1, 2, 2, 1). The multiset of ordinary inversions in both cases is \(\{(2,1),(2,1)\}\). The sets of strong inversions are (a) \( \{((2,1), (1,1)), ((2,1), (1,2))\}\) and (b) \( \{((2,1), (1,2)), ((2,2), (1,2))\}\).

The identity multipermutation in \({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n)}\) is the multipermutation \(\iota _n^{(m_1,m_2,\ldots ,m_n)}\) with no decrease; in case that \(m_1=m_2=\cdots = m_n=k\), this is abbreviated to \(\iota _n^{\times k}\). The anti-identity multipermutation is the reverse of \(\iota _n^{(m_1,m_2,\ldots ,m_n)}\) and so has no increase.

Example 1

Let \(n=k=3\) and consider the multipermutation

$$\begin{aligned} \sigma _3^{\times 3}=(1,1,2,3,2,2,1,3,3). \end{aligned}$$

Then \({{\mathcal {I}}}(\sigma _3^{\times 3})\) equals the multiset

$$\begin{aligned} \{(2,1), (2,1),(2,1), (3,2), (3,2),(3,1)\}, \end{aligned}$$

and \({\mathcal I}^*(\sigma _3^{\times 3})\) equals the set

$$\begin{aligned}{} & {} \{((3,1),(2,2)), ((3,1), (2,3)), ((3,1),(1,3)),((2,1),(1,3)),\\ {}{} & {} \quad ((2,2),(1,3)), ((2,3),(1,3))\}. \end{aligned}$$

For the \(identity 3-permutation\) \({\iota _3^{\times 3}} =(1,1,1,2,2,2,3,3,3)\) of \(\{1,2,3\}^{\times 3}\), we have \({\mathcal I}^*(\sigma _3^{\times 3})=\emptyset \); for the anti-identity 3-permutation \({\mathop {\iota _3^{\times 3}}\limits ^{\leftarrow }}=(3,3,3,2,2,2,1,1,1)\) we have

\({\mathcal I}^*( {\mathop {\iota _3^{\times 3}}\limits ^{\leftarrow }})= \{(j,t),(i,s)):1\le i<j\le 3, \; 1\le s, \, t\le 3\}\).

In [18] the weak Bruhat order \(\preceq _b\) on \({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n)}\) is defined as follows :

$$\begin{aligned} \sigma _n^{\times (m_1,m_2,\ldots ,m_n)}\preceq _b \tau _n^{\times (m_1,m_2,\ldots ,m_n)} \end{aligned}$$

provided that

$$\begin{aligned} {\mathcal I}^*( \sigma _n^{\times (m_1,m_2,\ldots ,m_n)})\subseteq {\mathcal I}^*(\tau _n^{\times (m_1,m_2,\ldots ,m_n)}). \end{aligned}$$

For \({{\mathcal {S}}}_n^{\times k}\) with \(k=1\), this reduces to the weak Bruhat order on \({{\mathcal {S}}}_n\), that is, \({\mathcal I}(\sigma _n)\subseteq {\mathcal I}(\tau _n)\). The weak Bruhat order \(\preceq _b\) on \({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n)}\) is proved to be the reflexive and transitive closure of the relation obtained by using adjacent transpositions on \({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n)}\) as specified by

$$\begin{aligned} \ldots , j,i,\ldots \rightarrow \ldots , i,j,\ldots \text{ where } j>i. \end{aligned}$$

Thus the strong inversion ((jt), (is)) for some t and s (only this strong inversion) is deleted from the set of strong inversions of the multipermutation under such an adjacent transposition. The partially ordered set \(({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n)},\preceq _b)\) is also proved to be a lattice, a generalization of the corresponding fact for the weak Bruhat order \(({{\mathcal {S}}}_n,\preceq _b)\) on permutations to the set of multipermutations of an arbitrary finite multiset. The lattice \(({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n)},\preceq _b)\) is graded by the number of strong inversions. The minimal element is the identity multipermutation with no strong inversions; the maximal element is the anti-identity multipermutation, and so \(\sum _{1\le i <j\le n}m_i m_j\) strong inversions.

We now briefly summarize the remaining contents of this paper. Section 2 treats the weak Bruhat order for multipermutations, and contains characterizations of this partially ordered set. One such characterization is in terms of so-called sum matrices. Next, in Sect. 6, we consider 2-permutations and how they give rise to two permutations, called order projections. Construction of 2-permutations from such order projections is presented. Sections 4 and 5 are devoted to Stirling multipermutations, their inversions and characterizations in terms of other combinatorial objects. In Sect. 6 we make some final comments including a brief discussion of a generalization of Stirling permutations called quasi-Stirling permutations.

Notation: In the display of matrices we sometimes omit zeros leaving their positions empty.

2 Weak Bruhat Order and Multipermutations

We now show that a multipermutation of \(\{1,2,\ldots ,n\}\) with its set of strong inversions is equivalent to a permutation with its set of inversions where the partial orders agree; a consequence is that the partially ordered sets of the types \(({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n)},\preceq _b)\) can be regarded as sublattices of the partially ordered sets of the types \(({{\mathcal {S}}}_p,\preceq _b)\).

First we give an example of the process which can be generalized.

Example 2

Consider the 2-permutation of \(\{1,2,3,4\}\):

$$\begin{aligned} \sigma =(2,1,2,3,4,3,4,1). \end{aligned}$$

Its strong inversions are:

$$\begin{aligned}{} & {} ((2,1),(1,1)), ((2,1),(1,2)), ((2,2), (1,2)), (( 3,1),(1,2)),\\{} & {} \quad ((3,2),(1,2)), ((4,1),(3,2), ((4,1),(1,2)), ((4,2),(1,2)). \end{aligned}$$

Now from the 2-permutation (2, 1, 2, 3, 4, 3, 4, 1) we construct a permutation in \(\mathcal {S}_8\) by replacing the 1’s by 1 and 2, ordered increasingly, and next replace the two 2’s by 3 and 4 in that order, etc. This gives the permutation

$$\begin{aligned} {\hat{\sigma }}=(3,1,4,5,7,6,8,2), \end{aligned}$$

whose inversions are:

$$\begin{aligned} (3,1),(3,2),(4,2),(5,2),(6,2),(7,6),(7,2), (8,2). \end{aligned}$$

We have an injection between the 2-permutations in \({{\mathcal {S}}}_4^{\times 2}\) and the permutations in \({\mathcal S}_8\) which preserves weak Bruhat order, that is, \(({{\mathcal {S}}}_4^{\times 2},\preceq _b)\) is isomorphic to a partially ordered subset of \(({\mathcal S}_8,\preceq _b)\). This works in general giving that \(({{\mathcal {S}}}_n^{\times k},\preceq _b)\) is isomorphic to a partially ordered subset of \(({\mathcal S}_{kn},\preceq _b)\). This is made more precise in Theorem 1. \(\square \)

Let \({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n) \uparrow }\) be the subset of \({\mathcal S}_p\), where \(p=m_1+m_2+ \cdots + m_n\), in which each of the sets of integers

$$\begin{aligned}{} & {} Y_1=\{1,2,\ldots ,m_1\}, Y_2=\{m_1+1,m_1+2, \ldots ,m_1+m_2\},\ldots ,\\{} & {} Y_n= \{ m_1+m_2+\cdots +m_{n-1}+1, m_1+m_2+\cdots \\{} & {} \qquad \quad +m_{n-1}+2, \ldots , m_1+m_2+\cdots +m_{n}\} \end{aligned}$$

occur in increasing order. A multipermutation \(\sigma _n^{\times (m_1,m_2,\ldots ,m_n)} \in \mathcal {S}_n^{\times (m_1,m_2,\ldots ,m_n)}\) thus corresponds to a permutation in \({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n) \uparrow }\) in the way explained in Example 2, i.e., replacing the \(m_1\) 1’s by the numbers in \(Y_1\), ordered increasingly, and next replacing the \(m_2\) 2’s by the numbers in \(Y_2\), ordered increasingly, etc. This gives a bijection between \({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n)}\) and \({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n) \uparrow }\).

Then \(({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n) \uparrow },\preceq _b)\) is a partially ordered subset of \(( {\mathcal S}_p,\preceq _b)\). Notice that all the inversions \(a>b\) in a multipermutation in \({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n)\uparrow }\) have a and b in different \(Y_i\)’s where the integers in each \(Y_i\)’s are in increasing order. It follows that successive adjacent transpositions applied to a multipermutation in \({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n) \uparrow }\) give a multipermutation that is also in \({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n) \uparrow }\). Hence the inversions in \({\mathcal I}(\sigma _n^{\times (m_1,m_2,\ldots ,m_n)\uparrow } )\) are identical with the inversions of \({\mathcal I}(\sigma _n^{\times (m_1,m_2,\ldots ,m_n)} )\) involving \({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n) \uparrow }\). Thus the partial order of \(\mathcal {S}_p\) when restricted to \({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n) \uparrow }\) gives the partially ordered set \(({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n) \uparrow },\preceq _b)\). Hence we have the following consequence.

Theorem 1

\((\mathcal {S}_n^{\times (m_1,m_2,\ldots ,m_n)},\preceq _b)\) is isomorphic to \(({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n) \uparrow },\preceq _b)\), and the partially ordered set \(({\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n) \uparrow },\preceq _b)\) is a sublattice of \((\mathcal {S}_p,\preceq _b)\) where \(p=m_1+m_2+ \cdots + m_n\).

Consider a multipermutation \(\sigma =(a_1, a_2, \ldots , a_N) \in {\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n)}\) where \(N=m_1+m_2+ \cdots + m_n\) and \(1\le a_i\le n\) (\(i \le N\)). We denote by \({\widehat{\sigma }}\) the permutation in \({\mathcal S}_N\) obtained from \(\sigma \) as defined in the discussion preceding Theorem 1; \({\widehat{\sigma }}\) is called the associated permutation of the multipermutation \(\sigma \). Corresponding to this \(\sigma \) is the \(N \times n\) (0, 1)-matrix \(A_{\sigma }\) whose ith row contains a 1 in column \(a_i\) (\(i \le N\)) and otherwise contains only zeros. We call \(A_{\sigma }\) the incidence matrix of \(\sigma \). Note that when \(\sigma \) is a permutation, \(A_{\sigma }\) is the usual permutation matrix associated with \(\sigma \).

The sum matrix \(\varSigma (A)=[s_{ij}]\) of any \(m \times n\) matrix \(A=[a_{ij}]\) is the \(m\times n\) matrix defined by \(s_{ij}=\sum _{k\le i, \, l \le j} a_{kl}\) (\(i \le m, \, j \le n\)); thus \(s_{ij}\) is the sum of the entries in the leading \(i\times j\) submatrix of A. A well-known characterization of the weak Bruhat order on \(n\times n\) permutation matrices is provided by the sum matrix: \(P\le _b Q\) if and only if \(\varSigma (P)\ge \varSigma (Q)\) (entrywise). The next theorem includes a characterization of the weak Bruhat order for multipermutations in terms of sum matrices.

Theorem 2

(i) Let \(\sigma \in {\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n)}\). Then the kth column of \(\varSigma (A_{\sigma })\) equals the \({\widehat{k}}\)th column of \(\varSigma (A_{{\widehat{\sigma }}})\) where \({\widehat{k}}=m_1+m_2+ \cdots + m_k\) \((k \le n)\).

(ii) Let \(\sigma , \tau \in {\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n)}\). Then \(\varSigma (A_{\sigma }) \ge \varSigma (A_{\tau })\) if and only if \(\varSigma (A_{{\widehat{\sigma }}}) \ge \varSigma (A_{{\widehat{\tau }}})\).

(iii) Let \(\sigma , \tau \in {\mathcal S}_n^{\times (m_1,m_2,\ldots ,m_n)}\). Then \(\sigma \preceq _b \tau \) if and only if \(\varSigma (A_{\sigma }) \ge \varSigma (A_{\tau })\).

Proof

(i) The kth column of \(\varSigma (A_{\sigma })\) is the row sum vector of the submatrix consisting of the k first columns of \(A_{\sigma }\), and this vector coincides with the row sum vector of the submatrix consisting of the \({\widehat{k}}\) first columns in \(A_{{\widehat{\sigma }}}\).

(ii) If \(\varSigma (A_{{\widehat{\sigma }}}) \ge \varSigma (A_{{\widehat{\tau }}})\), then, by (i), \(\varSigma (A_{\sigma }) \ge \varSigma (A_{\tau })\).

Conversely, assume \(\varSigma (A_{\sigma }) \ge \varSigma (A_{\tau })\) holds. Let \(k<n\) and \({\widehat{k}}=m_1+m_2+ \cdots + m_k\) and define \(k'={\widehat{k}}+m_{k+1}\). Let x and \(x'\) denote columns \({\widehat{k}}\) and \(k'\) of \(\varSigma (A_{{\widehat{\tau }}})\), and let y and \(y'\) denote columns \({\widehat{k}}\) and \(k'\) of \(\varSigma (A_{{\widehat{\sigma }}})\). The components of these vectors are denoted \(x_i\), \(x'_i\) etc. Then, by assumption,

$$\begin{aligned} x \le y \;\; \text{ and } \;\; x' \le y'. \end{aligned}$$

Let \(x^*\) and \(y^*\) denote the column \({\widehat{k}}+1\), i.e., right after column x and y in, respectively, \(\varSigma (A_{{\widehat{\tau }}})\) and \(\varSigma (A_{{\widehat{\sigma }}})\). Then there exists \(p \le n\) and \(q \le n\) such that

$$\begin{aligned} x^*=x+e^{(p)} \;\; \text{ and } \;\; y^*=y+e^{(q)} \end{aligned}$$

where \(e^{(p)}\) (resp. \(e^{(q)}\)) is the (0, 1)-vector with a 1 in each position \(j \ge p\) (resp. \(j \ge q\)) and otherwise contains zeros. We now show that \(x^*\le y^*\).

If \(p\ge q\), then \(e^{(p)} \le e^{(q)}\), so \(x^* =x+e^{(p)} \le y+e^{(q)}=y^*\) holds. Next, assume that \(p< q\) and let \(p \le i <q\). Observe that we cannot have \(x_i=y_i\), because that would give \(x'_i=x_i+1>y_i=y'_i\), contradicting \(x' \le y'\). Thus, \(x_i<y_i\) holds, and then \(x^*_i=x_i+1\le y_i=y^*_i\). This implies \(x^* \le y^*\), and the Claim holds.

We can now repeat this argument, column by column, and by induction, it follows that every column in \(\varSigma (A_{{\widehat{\tau }}})\) is componentwise \(\le \) the corresponding column in \(\varSigma (A_{{\widehat{\sigma }}})\). So, \(\varSigma (A_{{\widehat{\sigma }}}) \ge \varSigma (A_{{\widehat{\tau }}})\), as desired.

(iii) This follows by combining statement (ii) of this theorem and Theorem 1. \(\square \)

Example 3

Let \(n=3\) and \((m_1,m_2,m_3)=(3,4,2)\), so \(N=9\). Consider the following multipermutation \(\sigma =(2,1,3,1,2,2,3,2,1)\) and its corresponding permutation \({\widehat{\sigma }}= (4,1,8,2,5,6,9,7,3)\). With \(\sigma \) we associate the incidence matrix \(A_{\sigma }\) and its sum matrix

$$\begin{aligned} A_{\sigma }= \left[ \begin{array}{c|c|c} &{}1&{}\\ \hline 1&{}&{}\\ \hline &{}&{}1\\ \hline 1&{}&{}\\ \hline &{}1&{}\\ \hline &{}1&{}\\ \hline &{}&{}1\\ \hline &{}1&{}\\ \hline 1 &{}&{} \end{array} \right] \; \text{ where } \; \ \varSigma (A_{\sigma })= \left[ \begin{array}{c|c|c} 0&{}1&{}1\\ \hline 1&{}2&{}2\\ \hline 1&{}2&{}3\\ \hline 2&{}3&{}4\\ \hline 2&{}4&{}5\\ \hline 2&{}5&{}6\\ \hline 2&{}5&{}7\\ \hline 2&{}6&{}8\\ \hline 3&{}7&{}9 \end{array} \right] . \end{aligned}$$

With \({\widehat{\sigma }}\) we have

$$\begin{aligned}A_{{\hat{\sigma }}}= \left[ \begin{array}{c|c|c|c|c|c|c|c|c} &{}&{}&{}1&{}&{}&{}&{}&{}\\ \hline 1&{}&{}&{}&{}&{}&{}&{}&{}\\ \hline &{}&{}&{}&{}&{}&{}&{}1&{}\\ \hline &{}1&{}&{}&{}&{}&{}&{}&{}\\ \hline &{}&{}&{}&{}1&{}&{}&{}&{}\\ \hline &{}&{}&{}&{}&{}1&{}&{}&{}\\ \hline &{}&{}&{}&{}&{}&{}&{}&{}1\\ \hline &{}&{}&{}&{}&{}&{}1&{}&{}\\ \hline &{}&{}1&{}&{}&{}&{}&{}&{}\end{array}\right] \; \text{ where } \varSigma (A_{{\hat{\sigma }}})=\left[ \begin{array}{c|c|c|c|c|c|c|c|c} 0&{}0&{}0&{}1&{}1&{}1&{}1&{}1&{}1\\ \hline 1&{}1&{}1&{}2&{}2&{}2&{}2&{}2&{}2\\ \hline 1&{}1&{}1&{}2&{}2&{}2&{}2&{}3&{}3\\ \hline 1&{}2&{}2&{}3&{}3&{}3&{}3&{}3&{}4\\ \hline 1&{}2&{}2&{}3&{}4&{}4&{}4&{}4&{}5\\ \hline 1&{}2&{}2&{}3&{}4&{}5&{}5&{}6&{}6\\ \hline 1&{}2&{}2&{}3&{}4&{}5&{}5&{}6&{}7\\ \hline 1&{}2&{}2&{}3&{}4&{}5&{}6&{}7&{}8\\ \hline 1&{}2&{}3&{}4&{}5&{}6&{}7&{}8&{}9\end{array}\right] . \end{aligned}$$

Note that columns ending in 3,7,9, respectively, are identical in \(\varSigma (A_{\sigma })\) and \(\varSigma (A_{{\hat{\sigma }}})\). Next, consider the following multipermutation \(\sigma =(2,2,3,1,3,2,1,2,1)\). Then

$$\begin{aligned} A_{\sigma }= \left[ \begin{array}{c|c|c} &{}1&{}\\ \hline &{}1&{}\\ \hline &{}&{}1\\ \hline 1&{}&{}\\ \hline &{}&{}1\\ \hline &{}1&{}\\ \hline 1&{}&{}\\ \hline &{}1&{}\\ \hline 1&{}&{} \end{array} \right] \; \text{ where } \; \ \varSigma (A_{\sigma })= \left[ \begin{array}{c|c|c} 0&{}1&{}1\\ \hline 0&{}2&{}2\\ \hline 0&{}2&{}3\\ \hline 1&{}3&{}4\\ \hline 1&{}3&{}5\\ \hline 1&{}4&{}6\\ \hline 2&{}5&{}7\\ \hline 2&{}6&{}8\\ \hline 3&{}7&{}9 \end{array} \right] . \end{aligned}$$

Then \(\varSigma (A_{\sigma }) \ge \varSigma (A_{\tau })\), so \(\sigma \preceq _b \tau \) by Theorem 2. \(\square \)

3 Order Projections

In this section we consider some questions for 2-permutations and start with some motivation.

Example 4

Consider the permutations \(\pi _1=(1,2,5,3,4)\) and \(\pi _2=(3,5,4,1,2)\). Consider all 2-permutations \(\sigma _n^2\) where \(\pi _1\) corresponds to the first occurrences and \(\pi _2\) corresponds to the second occurrences of the integers 1, 2, 3, 4, 5. We can simply follow \(\pi _1\) by \(\pi _2\) to get such a 2-permutation: (1, 2, 5, 3, 4, 3, 5, 4, 1, 2). But there are other possibilities, e.g., (1, 2, 5, 3, 3, 5, 4, 4, 1, 2). How can such compatible 2-permutations be found and how many are there? \(\square \)

A motivation for this notion is from the area of scheduling, as described next. Two machines each perform n jobs, in some given order represented by the permutations \(\pi _1\) and \(\pi _2\). Assume that for each \(i \le n\) job i must be done on machine 1 before job i is done on machine 2. A \((\pi _1,\pi _2)\)-compatible 2-permutation then specifies a possible job sequence for the 2n jobs that is consistent with these restrictions. In [14] one considers job scheduling on two machines with the constraint mentioned above (each job is first performed on machine 1 and later on machine 2) along with certain other constraints on the order of some strings of jobs. We return to this motivating example below.

Let \(\sigma _n^2 \in \mathcal {S}_n^{\times 2}\) be a 2-permutation, and let \(\pi _1\) (resp. \(\pi _2\)) be the permutation in \(\mathcal {S}_n\) obtained from the first (resp. last) occurrence of each integer \(i \le n\). We call \(\pi _1\) and \(\pi _2\) the order projections of \(\sigma \). For instance, \(\sigma = (1,2,5,3,3,5,4,4,1,2)\) has order projections \(\pi _1=(1,2,5,3,4)\) and \(\pi _2=(3,5,4,1,2)\). Another 2-permutation with the same order projections is clearly (1, 2, 5, 3, 4, 3, 5, 4, 1, 2). Thus, in general, there are many such \((\pi _1,\pi _2)\)-compatible 2-permutations associated with a given pair \(\pi _1\), \(\pi _2\) of permutations. We now investigate such 2-permutations.

In Sect. 4 we give an interpretation of the order projections in terms of certain walks in a tree.

Let \(\pi _1\) and \(\pi _2\) be two permutations in \(\mathcal {S}_n\). Define \(\mathcal {S}_2(\pi _1,\pi _2)\) as the set of \((\pi _1,\pi _2)\)-compatible 2-permutations. This set is always nonempty as it contains the concatenation \(\sigma =(\pi _1,\pi _2)\). We define an \(n \times n\) (0, 1)-matrix \(D=[d_{ij}]\) as follows: the ith row consists of 0’s followed by 1’s, and the first 1 is in column \(\pi _1^{-1}(k)\) where \(k=\pi _2(i)\) (\(i \le n\)). So, for instance, as in Example 5 below, if \(\pi _2(1)=5\), the first row contains its first 1 in column j where j is the position of 5 in \(\pi _1\); here \(j=3\). Note that the last column of D only contains 1 s. We call D an order matrix, and to indicate the dependence on the permutations we write \(D=D(\pi _1,\pi _2)\). Define an increasing path in \(D(\pi _1,\pi _2)\) as a set of positions \((i,j_i)\) such that \(d_{ij_i}=1\) (\(i \le n\)) and

$$\begin{aligned} j_1 \le j_2 \le \cdots \le j_n. \end{aligned}$$

Theorem 3

Let \(\pi _1\) and \(\pi _2\) be two permutations in \(\mathcal {S}_n\). There is a bijection between \(\mathcal {S}_2(\pi _1,\pi _2)\) and the set of increasing paths in the order matrix \(D(\pi _1,\pi _2)\).

Proof

Note that any 2-permutation \(\sigma \in \mathcal {S}_2(\pi _1,\pi _2)\) may be constructed by starting with \(\pi _1\) and then inserting the elements in \(\pi _2\) in that sequence between some of the positions in \(\pi _1\). This must be done so that each entry in \(\pi _2\) occurs after the same entry in \(\pi _1\); this assures the desired order projections. This condition is precisely what the entries in \(D=D(\pi _1,\pi _2)=[d_{ij}]\) indicate. In fact, let \(i \le n\) and assume \(d_{ij}=1\) with j minimal, and let \(k=\pi _1(i)\). This means that the integer k is in position j in \(\pi _1\) and therefore the integer k from \(\pi _2\) can be inserted after this position, and not before. As a result, the insertion of the n entries of \(\pi _2\) may be indicated by selecting an entry which is 1 in each row in D. The additional requirement in this choice is that the column index must be weakly increasing; this is to assure that we do not alter the order of the entries in \(\pi _2\). This discussion verifies the desired bijection. \(\square \)

As a referee pointed out, the problem treated here is equivalent to a previously studied problem of determining the linear extensions of a poset derived from the permutations \(\pi _1\) and \(\pi _2\) as follows. Its elements are (1, i) (corresponding to \(\pi _1\)) and (2, i) (corresponding to \(\pi _2\)) for \(i=1,2,\ldots ,n\) with two chains as given by the elements in the orders given by \(\pi _1\) and \(\pi _2\), and with \((1,i)<(2,i)\) for each i followed by the transitive closure to get a poset. The elements of \(\mathcal {S}_2(\pi _1,\pi _2)\) correspond to the linear extensions of this poset. For additional details on this perspective, see the references [6, 20] supplied by a referee.

Example 5

Consider \(\pi _1=(3,1,5,2,4)\) and \(\pi _2=(5,1,3,2,4)\). The order matrix \(D(\pi _1,\pi _2)\) is then

$$\begin{aligned} \left[ \begin{array}{r|r|r|r|r} &{} &{} \textbf{1} &{} 1 &{}1 \\ \hline &{} 1 &{} \textbf{1} &{} 1 &{}1 \\ \hline 1 &{} 1 &{} 1 &{} \textbf{1} &{}1 \\ \hline &{} &{} &{} 1 &{}\textbf{1} \\ \hline &{} &{} &{} &{}\textbf{1} \\ \end{array} \right] . \end{aligned}$$

An increasing path is indicated in boldface and the corresponding 2-permutation is \((3,1,5,\textbf{5}, \textbf{1}, 2,\textbf{3}, 4, \textbf{2}, \textbf{4})\) where the inserted elements are in boldface (and they determine \(\pi _2\)). \(\square \)

Theorem  3 also makes it possible to compute the cardinality of \(\mathcal {S}_2(\pi _1,\pi _2)\). Let \(D=D(\pi _1,\pi _2)=[d_{ij}]\). Let \({\tilde{D}}={\tilde{D}}(\pi _1,\pi _2)\) be obtained from D by replacing every 1 with a zero above by 0, repeatedly, row by row. In the example above the entries in positions (2, 2), (3, 1) and (3, 3) are replaced by 0 and we obtain

$$\begin{aligned} {\tilde{D}}= \left[ \begin{array}{r|r|r|r|r} &{} &{} \textbf{1} &{} 1 &{}1 \\ \hline &{} &{} \textbf{1} &{} 1 &{}1 \\ \hline &{} &{} 1 &{} \textbf{1} &{}1 \\ \hline &{} &{} &{} 1 &{}\textbf{1} \\ \hline &{} &{} &{} &{}\textbf{1} \\ \end{array} \right] . \end{aligned}$$

Then \({\tilde{D}}\) has a support in a Ferrers pattern (justified to the right) with monotone decreasing row sums. Introduce an \(n \times n\) matrix \(V=[v_{ij}]\) where \(v_{ij}\) equals the number of increasing paths, as previously used, from row 1 until position (ij). Then we must have

$$\begin{aligned} \begin{array}{ll} v_{1j}=d_{1j} &{}(j\le n) \\ v_{ij}=\sum _{k \le j, \, d_{i-1,k}=1} v_{i-1,k} &{}(2 \le i \le n, \; j\le n, \; d_{ij}=1). \\ \end{array} \end{aligned}$$
(1)

where an empty sum is defined to be zero. Then

$$\begin{aligned} |\mathcal {S}_2(\pi _1,\pi _2)|=\sum _{j} v_{nj}. \end{aligned}$$
(2)

For the permutations in Example 5 we compute

$$\begin{aligned} V= \left[ \begin{array}{rrrrrr} 0 &{} 0 &{} 1 &{} 1 &{} 1 \\ 0 &{} 0 &{} 1 &{} 2 &{} 3 \\ 0 &{} 0 &{} 1 &{} 3 &{} 6 \\ 0 &{} 0 &{} 0 &{} 4 &{} 10 \\ 0 &{} 0 &{} 0 &{} 0 &{} 14 \\ \end{array} \right] . \end{aligned}$$

so \(|\mathcal {S}_2(\pi _1,\pi _2)|=14\).

Finally, we note that \(\mathcal {S}_2(\pi _1,\pi _2)\) contains a unique 2-permutation if and only if \(\pi _1(n)=\pi _2(1)\) (and then this 2-permutation is \((\pi _1,\pi _2)\)). Moreover, \(|\mathcal {S}_2(\pi _1,\pi _2)|\) is maximal when \(\pi _1=\pi _2\).

We now return to the scheduling problem we briefly discussed above. Let \(\sigma _n\) be a 2-permutation of \(\{1,2,\ldots ,n\}\) with order projections \(\pi _1\) and \(\pi _2\). Then \(\sigma _n\) represents a job sequence for performing n jobs subject to the requirements on two machines to do their part. Let us assume for simplicity that each job takes the same time. Then the two machines might be able to work simultaneously. So (1, 2, 5, 3, 3, 5, 4, 4, 1, 2) with \(\pi _1=(1,2,5,3,4)\) and \(\pi _2=(3,5,4,1,2)\) could progress as in the following activity table (where the top line indicates time)

$$\begin{aligned} \begin{array}{c|cccccccccc|} &{} 1 &{} 2 &{} 3 &{} 4 &{} 5 &{} 6 &{} 7 &{} 8 &{} 9 &{} 10 \\ \hline { I} &{} 1 &{} 2 &{} 5 &{} 3 &{} 4 &{}&{}&{}&{}&{} \\ { II} &{} &{} &{} &{} &{} 3 &{} 5 &{} 4 &{} 1 &{} 2 &{}\\ \hline \end{array} \end{aligned}$$

with 9 time units as opposed to

$$\begin{aligned} \begin{array}{c|cccccccccc|} &{} 1 &{} 2 &{} 3 &{} 4 &{} 5 &{} 6 &{} 7 &{} 8 &{} 9 &{} 10 \\ \hline { I} &{} 1 &{} 2 &{} 5 &{} 3 &{} 4 &{}&{}&{}&{}&{} \\ { II} &{} &{} &{} &{} &{} &{} 3 &{} 5 &{} 4 &{} 1 &{} 2 \\ \hline \end{array} \end{aligned}$$

with 10 time units. For a given \(\pi _1\) and \(\pi _2\) how does one determine the minimum number of time units possible? Let \(t^*(\pi _1,\pi _2)\) denote the minimum total time for a 2-permutation with order projections \(\pi _1, \pi _2\). Here the total time is defined as the position j of the final entry in \(\pi _2\) in the activity table. Then, in general, the minimal total time satisfies

$$\begin{aligned} n+1 \le t^*(\pi _1,\pi _2) \le 2n. \end{aligned}$$

The lower bound is attained when \(\pi _1=\pi _2\), and the activity plan just shifts \(\pi _2\) one column to the right compared to \(\pi _1\). The upper bound is attained when \(\pi _1(n)=\pi _2(1)\), where \(\pi _2\) is put right after \(\pi _1\).

Consider the following recursive computation of integers \(T_1, T_2, \ldots , T_n\) based on \(\pi _1\) and \(\pi _2\): Let \(T_0=0\) and

$$\begin{aligned} T_j=\max \{T_{j-1}, \pi _1^{-1}(\pi _2(j))\}+1 \;\;(j=1, 2\ldots , n). \end{aligned}$$
(3)

Proposition 1

Let \(\pi _1\) and \(\pi _2\) be two permutations in \(\mathcal {S}_n\). Then \(t^*(\pi _1,\pi _2)=T_n\).

Proof

In the activity table the first row contains \(\pi _1\) followed by blanks. Consider the second row. Let \(k=\pi _2(1)\) be the first component of \(\pi _1\). The first possible column j for k is right after the position of k in the first row, so \(j=\pi _1^{-1}(k)+1\). Similarly, for each \(j\le n\), \(\pi _1(j)\) must be placed after column \(\pi _1^{-1}(\pi _2(j))\) and also after the position of the previous entry in \(\pi _2\). Then, by induction on j, the first possible column for the jth entry of \(\pi _2\) is given by the expression in (3), and the result follows. \(\square \)

Finally we note that for this scheduling problem, there is no loss in generality in assuming \(\pi _1=(1,2,\ldots ,n)\) (unless some property of the permutations is considered) by replacing \(\pi _2\) with \(\pi _1^{-1}\pi _2\).

4 Stirling Multipermutations

Stirling permutations were introduced by Gessel and Stanley [11] and have many interesting properties (see e.g., [1, 5, 8, 13, 17, 21]). A permutation \(\sigma _{n}\) in \({{\mathcal {S}}}_n^{\times 2}\) is a Stirling permutation provided

$$\begin{aligned} \sigma _{n} =(\ldots ,i,\ldots ,j \ldots ,i,\ldots ) \text{ implies } \text{ that } j>i. \end{aligned}$$

Thus Stirling permutations are 2-permutations of \(\{1,2,\ldots ,n\}\) that avoid the pattern 212; between the two occurrences of an integer there can only be larger integers. The set of Stirling permutations of \(\{2\cdot 1, 2\cdot 2,\ldots , 2\cdot n\}\) is denoted by \(\widehat{{\mathcal {S}}}_n^{\times 2}\). The identity Stirling permutation in \(\widehat{{\mathcal {S}}}_n^{\times 2}\) is the ordinary identity 2-permutation \((1,1,2,2,\ldots ,n,n)\) and its reversal is the anti-identity Stirling permutation \((n,n,\ldots ,2,2,1,1)\). As used above, we usually let the subscript on a multipermutation denote the size of its underlying set.

Example 6

Consider the Stirling permutation \(\sigma _4=(2,4,4,2,1,3,3,1)\in \widehat{{\mathcal {S}}}_4^{\times 2}\). Using our construction from the previous section, we consider the associated permutation \((3,7,8,4,1,5,6,2)\in {\mathcal S}_8\). The Stirling property in terms of this associated permutation is that between two integers \(a,a+1\) (in that order) where a is odd, only larger integers occur. More generally, we have the next theorem. \(\square \)

Theorem 4

Let n be a positive integer. There is a bijection between the set of Stirling permutations in \(\widehat{{\mathcal {S}}}_n^{\times 2}\) and the set \(\widehat{\mathcal S}_{2n}\) of permutations in \({\mathcal S}_{2n}\) with the property that between two integers a and \(a+1\) in that order with a odd, only larger integers occur.

Proof

This is an immediate consequence of our correspondence and the definition of a Stirling permutation.\(\square \)

The defining property for Stirling permutations can be carried over to multipermutations of \(\{1,2,\ldots ,n\}\) [7, 15]. Consider a multipermutation \(\sigma _n\) of \(\{a_1\cdot 1,a_2\cdot 2,\ldots ,a_n\cdot n\}\) where \(a_1,a_2,\ldots ,a_n\) are positive integers. Then \(\sigma _n\) is called a Stirling multipermutation provided that between two equal integers in \(\sigma _n\) only larger integers occur, equivalently, between the first and last instance of each integer k in \(\sigma _n\) only larger integers occur. Let \(\widehat{{\mathcal {S}}}_n(a_1\cdot 1,a_2\cdot 2,\ldots ,a_n\cdot n)\) be the set of Stirling multipermutations of \(\{a_1\cdot 1,a_2\cdot 2,\ldots ,a_n\cdot n\}\). (If \(a_n=1\), then n can be deleted from \(\sigma _n\) leaving a Stirling permutation \(\sigma _{n-1}\) of \(\{a_1\cdot 1,a_2\cdot 2,\ldots ,a_{n-1}\cdot (n-1)\}\); thus one could assume that \(a_n\ge 2\).) If \(a_1=a_2=\cdots = a_n =k\), then we denote the corresponding set of Stirling multipermutations by \(\widehat{{\mathcal {S}}}_n^{\times k}\) and call these Stirling k-permutations of \(\{1,2,\ldots ,n\}\). Thus if \(k=1\), then \(\widehat{{\mathcal {S}}}_n^{\times 1}= {{\mathcal {S}}}_n\). If \(k\ge 2\) then, deleting one instance of each integer j with \(1\le j\le n\) in a Stirling k-permutation in \(\widehat{{\mathcal {S}}}_n^{\times k}\), results in a Stirling \((k-1)\)-permutation in \(\widehat{{\mathcal {S}}}_n^{\times (k-1)}\). Conversely, if \(k\ge 2\) and \(\sigma _n\) is a Stirling k-permutation in \(\widehat{{\mathcal {S}}}_n^{\times k}\), then inserting a new copy of each integer j with \(1\le j\le n\) between the first and kth instances of j results in a Stirling \((k+1)\)-permutation in \(\widehat{{\mathcal {S}}}_n^{\times (k+1)}\). Thus, if \(k\ge 3\), every Stirling k-permutation of \(\{1,2,\ldots ,n\}\) can be constructed by starting with a Stirling 2-permutation of \(\{1,2,\ldots ,n\}\) and, for each j between 1 and n, inserting anywhere between its two j’s, \((k-2)\) more j’s.

As for permutations, and unlike multipermutations in general, a Stirling multipermutation is determined by its multiset of (ordinary) inversions.

Theorem 5

The function sending a Stirling multipermutation \(\sigma _n\) of \(\{a_1\cdot 1,a_2\cdot 2,\ldots ,a_n\cdot n\}\) into its multiset \({{\mathcal {I}}}(\sigma _n)\) of ordinary inversions is an injective function on \(\widehat{{\mathcal {S}}}_n(a_1\cdot 1,a_2\cdot 2,\ldots ,a_n\cdot n)\).

Proof

Let \(m=a_1+a_2+\cdots +a_n\). Let \(\sigma _n=(i_1, i_2, \ldots , i_{m})\) and \(\pi _n=(j_1, j_2, \ldots , j_{m})\) be two Stirling multipermutations of \(\{1,2,\ldots ,n\}\) in \(\widehat{{\mathcal {S}}}_n(a_1\cdot 1,a_2\cdot 2,\ldots ,a_n\cdot n)\) . Since the \(a_n\) n’s must be adjacent in both multipermutations, there must be an s and t such that the \(a_n\) n’s in \(\sigma _n\) and those in \(\pi _n\) are given by

$$\begin{aligned} i_s=\cdots =i_{s+a_n-1}=n \text{ and } j_t=\cdots =j_{t+a_n-1}=n. \end{aligned}$$

If \(s\not = t\), there must exist some \(p<n\) which occurs less often in exactly one of the subsequences

$$\begin{aligned} i_{s+a_n}, i_{s+a_n+1}, \ldots , i_{m} \;\text{ and } \; j_{t+a_n}, j_{t+a_n+1}, \ldots , j_{m}, \end{aligned}$$

and that implies that an inversion (np) occurs a different number of times in the inversion sets \(\mathcal {I}(\sigma _n)\) and \(\mathcal {I}(\pi _n)\), a contradiction. Thus \(s=t\) (and the two subsequences must be the same).

Now, delete all the n’s in both \(\sigma _n\) and \(\pi _n\) giving \(\sigma _{n-1}\) and \(\pi _{n-1}\), respectively. Then \(\sigma _{n-1}\) and \(\pi _{n-1}\) are multipermutations of an identical multiset. Thus, we can repeat the argument for \(\sigma _{n-1}\) and \(\pi _{n-1}\), and it follows by induction that \(\sigma _n=\pi _n\), proving the desired injectivity. \(\square \)

As in Sect. 3, with a Stirling permutation \(\sigma _{n}\) there is naturally associated [5] the pair of order projection \((\pi _n^1,\pi _n^2)\) of permutations of \(\{1,2,\ldots ,n\}\) where \(\pi _n^1\) is given by the first occurrences of each integer in \(\sigma _n\), and \(\pi _n^2\) is given by the second occurrences of each such integer. The pair of permutations \((\pi _n^1,\pi _n^2)\) is called a Stirling permutation pair. For example,

$$\begin{aligned} \sigma _4=(1,3,3,1,2,4,4,2)\rightarrow \pi _4^1 =(1,3,2,4),\pi _4^2=(3,1,4,2). \end{aligned}$$

In terms of the correspondence given in Theorem 4, given an odd integer a in \(\sigma _n^1\) and the even integer \(a+1\) in \(\sigma _n^2\), then only larger integers occur between this a and \(a+1\) in \(\sigma _{2n}\). Then \(\pi _4^1\) corresponds to a permutation of \(\{1,3,5,7\}\) and \(\pi _4^2\) corresponds to a permutation of \(\{2,4,6,8\}\). In general, we have the following lemma.

Lemma 1

If \(\sigma _{2n}\) is the permutation in \(\widehat{\mathcal S}_{2n}\) corresponding to a Stirling permutation \(\sigma _n\) in \(\widehat{\mathcal S}_n^{\times 2}\), then its \(\sigma _n^1\) corresponds to the permutation of the odd integers \(\{1,3,\ldots , 2n-1\}\) in \(\sigma _{2n}\) and its \(\sigma _n^2\) corresponds to the permutation of the even integers \(\{2,4,\ldots ,2n\}\) in \(\sigma _{2n}\).

Stirling permutations in \(\widehat{{\mathcal {S}}}_n^{\times 2}\) are characterized [5] in terms of its corresponding Stirling permutation pair of permutations in \({\mathcal S}_n\) as we review below.

First we recall that a permutation of \(\{1,2,\ldots ,n\}\) is 312-avoiding provided that it does not contain a subsequence of length 3 in the same relative order as 3,1,2. Being a 312-avoiding permutation places restrictions on the inversions of the permutation. In fact, the permutation \(\sigma =(j_1,j_2,\ldots ,j_n)\) is 312-avoiding is equivalent to the following property (312) of its set of inversions:

(312) If \(1\le k<l<p\le n\) and \((j_k,j_l)\) and \((j_k,j_p)\) are inversions, then \((j_l,j_p)\) is also an inversion, that is, \(j_k,j_l,j_p\) is a decreasing subsequence of \(\sigma \).

Now let \(\pi _1=(i_1,i_2,\ldots ,i_n)\) and \(\pi _2=(j_1,j_2,\ldots ,j_n)\) be two permutations of \(\{1,2,\ldots ,n\}\). Then \(\pi _2\) is a 312-avoiding permutation relative to \(\pi _1\) (or, \((\pi _1,\pi _2)\) is a 312-avoiding permutation pair) provided the following two properties (312-i) and (312-ii) hold:

(312-i):

\({{\mathcal {I}}}(\pi _1)\subseteq {{\mathcal {I}}}(\pi _2)\), and

(312-ii):

If \(1\le k<l<p\le n\) and \((j_k,j_l)\) and \((j_k,j_p)\) are inversions in \({{\mathcal {I}}}(\pi _2){\setminus } {{\mathcal {I}}}(\pi _1)\), then \((j_l,j_p)\) is also an inversion in \({{\mathcal {I}}}(\pi _2)\setminus {{\mathcal {I}}}(\pi _1)\).

If (312-i) and (312-ii) hold, then the following property (312-iii) also holds:

(312-iii):

\(j_k,j_l,j_p\) is a decreasing subsequence of \(\pi _2\) and \(j_p,j_l,j_k\) is an increasing subsequence of \(\pi _1\).

We have the following theorem [5].

Theorem 6

Let \(\pi _1\) and \(\pi _2\) be two permutations of \(\{1,2,\ldots ,n\}\). Then \((\pi _1,\pi _2)\) is a Stirling permutation pair if and only if \((\pi _1,\pi _2)\) is a 312-avoiding pair of permutations, that is, \({{\mathcal {I}}}(\pi _1)\subseteq {\mathcal I}(\pi _2)\) and \(\pi _1^{-1}\pi _2\) is 312-avoiding.

We now show that the weak Bruhat order on \(\widehat{{\mathcal {S}}}_n^{\times 2}\) is determined by ordinary inversions.

Theorem 7

Let \(\sigma _n\) and \(\pi _n\) be Stirling permutations in \(\widehat{{\mathcal {S}}}_n^{\times 2}\). The \(\sigma _n\preceq _b \pi _n\) if and only if the multiset \({\mathcal I}(\sigma _n)\) of ordinary inversions of \(\sigma _n\) is contained in the multiset of ordinary inversions of \(\pi _n\).

Proof

If \(\sigma _n\preceq _b \pi _n\), then the set of strong inversions of \(\sigma _n\) is contained in the set of strong inversions of \(\pi _n\). Hence the multiset of ordinary inversions of \(\sigma _n\) is contained in the multiset of ordinary inversions of \(\pi _n\).

Now suppose that the multiset of ordinary inversions of \(\sigma _n\) is contained in the multiset of ordinary inversions of \(\pi _n\). Consider an ordinary inversion \(a>b\) in \(\sigma _n\). Since \(\sigma _n\) is a Stirling permutation, \(\sigma _n\) is of the form

$$\begin{aligned} (i)\; \sigma _n = (\ldots , a,\ldots ,a,\ldots ,b,\ldots ,b,\ldots ) \text{ or } \sigma _n =(\ldots , b,\ldots ,a,\ldots ,a,\ldots ,b,\ldots ), \end{aligned}$$

so the inversion \(a>b\) has multiplicity (i) 4 or (ii) 2. Since \(\pi _n\) is a Stirling permutation, and since the multiset of ordinary inversions of \(\sigma _n\) is contained in the multiset of ordinary inversions of \(\pi _n\), \(\pi _n\) has the corresponding forms

$$\begin{aligned}{} & {} (i)\; \pi _n= \sigma =(\ldots , a,\ldots ,a,\ldots ,b,\ldots ,b,\ldots ), \text{ or } \\{} & {} (ii_1)\; \pi _n=(\ldots , b,\ldots ,a,\ldots ,a,\ldots ,b,\ldots ).\ \text{ or } \\{} & {} (ii_2)\; \pi =( \ldots , a,\ldots ,a,\ldots ,b,\ldots ,b,\ldots ). \end{aligned}$$

In case (i), we have that the subset of strong inversions of \(\sigma _n\) involving a and b equals the subset of strong inversions of \(\pi _n\) involving a and b. In case (ii) with case \((ii_1)\) holding, we have a similar equality. In case (ii) with case \((ii_2)\), the subset of strong inversions of \(\sigma _n\) involving a and b is a proper subset of the strong inversions of \(\pi _n\). The theorem now follows. \(\square \)

Corollary 1

The set \(\widehat{{\mathcal {S}}}_n^{\times 2}\) of Stirling permutations partially ordered by its multiset of ordinary inversions (the weak Bruhat order on \(\widehat{{\mathcal {S}}}_n^{\times 2})\) is a lattice, the weak Bruhat order on \(\widehat{{\mathcal {S}}}_n^{\times 2}\).

A Stirling permutation in \(\widehat{{\mathcal {S}}}_n^{\times 2}\) where the two occurrences of j are adjacent for every \(j \le n\) will be called a double-permutation. They are clearly in one-to-one correspondence with the set \(\mathcal {S}_n\) of permutations of \(\{1,2,\ldots ,n\}\).

Let \(\sigma _n\) be a Stirling permutation in \(\widehat{{\mathcal {S}}}_n^{\times 2}\). Define \(\delta _2(\sigma _n)\) as the number of j’s such that the two occurrences of j are adjacent in \(\sigma _n\). So, \(\delta _2(\sigma _n)=n\) means that \(\sigma _n\) is a double-permutation. Let \(j \le n\) and assume the two occurrences of j in \(\sigma _n\) are not adjacent. Let \(\sigma '_n\) be the 2-permutation obtained from \(\sigma _n\) by moving the right-most j in \(\sigma _n\) to the position after the left-most j; we call this operation a left-join. A right-join is defined similarly, but then we move the left-most j to the position after the right-most j.

Theorem 8

(i) Let \(\sigma _n\) be a Stirling permutation in \(\widehat{{\mathcal {S}}}_n^{\times 2}\). Then we can find a sequence \(\sigma _n^{(k)} \in \widehat{{\mathcal {S}}}_n^{\times 2}\) \((0 \le k \le N)\) of Stirling permutations such that \(\sigma _n^{(0)}=\sigma _n\), \(\sigma _n^{(k)}\) is obtained by a left-join of \(\sigma _n^{(k-1)}\) \((1 \le k \le N)\), and \(\sigma _n^{(N)}\) is a double-permutation. In addition, \(\sigma _n^{(k)} \preceq _b \sigma _n^{(k-1)}\) for each k. Moreover, \(N \le n-1\), \(\delta _2(\sigma _n^{(k)}) > \delta _2(\sigma _n^{(k-1)})\) \((1 \le k \le N)\), and, for the Stirling permutation pair (order projections) \((\pi _1,\pi _2)\) of \(\sigma _n^{(N)}\), \(\pi _1=\pi _2\).

(ii) \(\widehat{{\mathcal {S}}}_n^{\times 2}\) is connected using the operations (a) left-join or its inverse, and (b) permutations in which two consecutive kk are interchanged with two consecutive jj.

Proof

(i) Let \(i_1\) and \(i_2\), where \(i_1<i_2\), be the two positions of j in \(\sigma _n\). By assumption \(i_1<i_2-1\). Let \(\sigma _n'\) be obtained from \(\sigma _n\) by a left-join of j, so the right-most j in \(\sigma _n\) is moved to the position after the left-most j. Then \(\sigma _n'\) is also a Stirling permutation. In fact, in \(\sigma _n\), if j is between two occurences of some l, then \(j>l\), and the two consecutive j’s in \(\sigma _n'\) also satisfy the Stirling property. Moreover, the removal of the original j does not violate the Stirling property. Thus, \(\sigma _n^{(1)}:=\sigma _n'\) is a Stirling permutation, and clearly \(\delta _2(\sigma _n^{(1)}) < \delta _2(\sigma _n)\), as the two j’s are now adjacent and any other pair of adjacent p’s are unchanged. Then \(\delta _2(\sigma _n)-\delta _2(\sigma _n^{(1)}) \in \{1,2\}\). Thus, we repeat the process, and after at most \(n-1\) steps we have reached a double-permutation \(\sigma _n^{(N)}\), and its Stirling pair must consist of two equal permutations. That \(\sigma _n^{(k)} \preceq _b \sigma _n^{(k-1)}\) for each k follows from the fact that we move the integer j to the left and interchange only with larger numbers, so certain inversions are removed.

(ii) This follows from (i) as each of two Stirling permutations may be transformed double-permutations. We can move between these double-permutations as for n-permutations, as described in the statement in (ii). \(\square \)

5 Stirling Characterization

There is an interesting connection between Stirling permutations and certain walks in plane trees given in [13], as we describe next. Consider a plane tree T which is an embedding of a tree in the plane: the root vertex is placed on top, each of its neighbors are put on the level below, with corresponding edges attached. This is repeated so that successive levels correspond to vertices with the same distance from the root. Let n be the number of edges in T, and label the edges according to the order in which they are added in the construction of the tree (so first we add edges adjacent to the root, then the new edges adjacent to vertices of distance 1, etc.). An example with \(n=5\) is shown in Fig. 1.

Consider depth-first-search (DFS) in T, starting from the root. Thus, one moves down in the tree to a pendant vertex, then backtrack to vertex with an untraversed edge e. Then one moves along e and further down to a pendant vertex, etc. Due to the backtracking, this DFS constructs an “Euler 2-walk” in T in which every edge is traversed exactly twice, once in a downward direction and once in an upward direction. It corresponds to an ordinary Euler walk in the graph obtained from T by doubling each edge. In this Euler 2-walk, the sequence of edges, in the order they are traversed, defines a Stirling permutation. This is because each number \(j\le n\) occurs twice, and between the two occurences of edge j we only traverse edges below j, and they have higher numbers. Moreover, any Stirling permutation can be constructed in this way from some plane tree.

As an example consider the Stirling permutation \(\sigma _5=(1,3,5,5,3,4,4,1,2,2)\). The left plane tree T in Fig. 1 gives \(\sigma _5\) when we use the Euler 2-walk obtained by choosing the left-most alternative in DFS search.

Fig. 1
figure 1

Stirling permutations and plane trees

We now observe the following:

  • For a given tree T there may be different labelings of the edges, i.e., different sequences of edge additions may result in the same tree T. Therefore different Stirling permutations may correspond to the same tree (but different labelings). See the right plane tree in Fig. 1 which corresponds to the permutation (1, 4, 5, 5, 4, 3, 1, 2, 2).

  • Every double-permutation corresponds to a plane tree which is a star (i.e., the root and neighbor vertices). The Stirling permutation \(12 \cdots nn \cdots 21\) corresponds to a path.

  • Let \(\sigma _n\) be a Stirling permutation and let \(\pi _1\) and \(\pi _2\) be the corresponding order projections. Let T be a plane tree and W an Euler 2-walk corresponding to \(\sigma _n\). We then note that \(\pi _1\) corresponds to the sequence of edges in W that are traversed downward, while \(\pi _2\) corresponds to the sequence of edges in W that are traversed upward. In the left example in Fig. 1 we get \(\pi _1=(1,3,4,5,2)\) (downward) and \(\pi _2=(4,3,5,1,2)\) (upward).

  • The operation used in Theorem 8 to go from \(\sigma _n^{(k-1)}\) to \(\sigma _n^{(k)}\) where, say, a j is moved to the left, corresponds to a simple modification of the underlying plane tree: shrink the edge uv with label j and replace it by a new pendant edge attached to u, where u is the vertex closer to the root.

  • The operation used later in Theorem 9 (denoted s) corresponds to deleting in the plane tree T the edge corresponding to the largest label, and this is a pendant edge.

In order to give a characterization of Stirling permutations we introduce some concepts. We say that a vector \(x=(x_1,x_2, \ldots , x_m)\in \mathbb {R}^m\) is an AM-vector (Adjacent Max), or simply x is AM, if there is a \(k<m\) such that

$$\begin{aligned} x_k=x_{k+1}>x_j \;\;(j \not = k,k+1). \end{aligned}$$

Thus a maximum component occurs precisely twice and in adjacent positions. If \(x \in \mathbb {R}^m\) is AM, we define a mapping \(\rho \) by \(\rho (x) \in \mathbb {R}^{m-2}\) is the subvector of x obtained by deleting the two (adjacent) largest components in x. We say that x is AM-closed if \(x^{(1)}:=\rho (x)\) is AM, \(x^{(2)}:=\rho (x^{(1)})\) is AM etc., i.e., repeated applications of the deleting the largest pair gives only AM vectors until we, finally, have a vector in \(\mathbb {R}^2\) with two equal components. Next, let \(\sigma _n=(i_1, i_2, \ldots , i_{2n})\) be a 2-permutation of \(\{1,2,\ldots ,n\}\) . Let \(j \le n\) and define the interval

$$\begin{aligned} I_j(\sigma _n)=\{p, p+1, \ldots , q\} \end{aligned}$$
(4)

where \(p<q\) and \(i_p=i_q=j\). (Note that p and q are uniquely defined by the 2-permutation and j.) The interval family (4) clearly uniquely determines the 2-permutation. We say that a family \(I'_1, I'_2, \ldots , I'_n\) of intervals is decreasing cross-free if

$$\begin{aligned} I'_i \cap I'_j= \emptyset \;\; \text{ or } \;\; I'_j \subset I'_i \;\;(1\le i <j \le n). \end{aligned}$$

Here \(\subset \) denotes strict inclusion.

The next theorem characterizes Stirling permutations.

Theorem 9

Let \(\sigma _n\) be a 2-permutation of \(\{1,2,\ldots ,n\}\). Then the following statements are equivalent:

(i) \(\sigma _n\) is a Stirling permutation.

(ii) \(\sigma _n\) is AM-closed.

(iii) The interval family \(I_j(\sigma _n)\) \((j \le n)\) is decreasing cross-free.

Proof

(i) \(\Leftrightarrow \) (ii): Let \(\sigma _n=(i_1,i_2,\ldots ,i_{2n})\) be a Stirling permutation. Then \(\sigma _n\) is AM as \(\max _k i_k=n\), and n cannot occur in two nonadjacent positions in \(\sigma _n\). Let \(\rho (\sigma _n)=(x_1,x_2, \ldots , x_{2n-2})\). Then \(\max _i x_i=n-1\), and \(n-1\) cannot occur in two nonadjacent positions in x, because then some smaller number would be between, and this violates that \(\sigma _n\) is a Stirling permutation. By repeating this argument we conclude that \(\sigma _n\) is AM-closed. The converse implication is shown by induction on n. In fact, assume \(\sigma _n\) is AM-closed, and let \(x=\rho (\sigma _n)\). Then x is also AM-closed, so, by induction, x is a Stirling permutation in \(\widehat{{\mathcal {S}}}_{n-1}^{\times 2}\). By adding in the two adjacent n’s we obtain \(\sigma _n\) which is then a Stirling permutation.

(i) \(\Leftrightarrow \) (iii): Let \(\sigma _n\) be a Stirling permutation. Consider its intervals in (4) \(I_j=I_j(\sigma _n)\) for \(j=1, 2, \ldots , n\). If (ii) does not hold, then there are two possibilities. Either, for some \(i<j\), \(I_i \subset I_j\), or, alternatively, \(I_i\) and \(I_j\) intersect, but neither set is contained in the other. In each of these two cases, \(\sigma \) contains an i between two j’s, contradicting the Stirling property. This proves that (i) implies (ii). The converse follows by induction on n by observing that (iii) implies that \(I_n=\{k,k+1\}\) for some k. Then we “remove” k and \(k+1\), and apply the induction hypothesis. \(\square \)

Define the iterated mapping \(\rho ^k(\sigma )\) by applying the mapping \(\rho \) k times to a Stirling permutation \(\sigma _n\) (\(k=1, 2, \ldots , n-1\)). Thus, \(\rho (\sigma )=\rho ^1(\sigma )\) where \(\rho ^{n-1}(\sigma )=(1,1)\). We also write [pq] to indicate the integer interval \(\{p, p+1, \ldots , q\}\) where \(p<q\).

Example 7

For instance, let \(n=4\) and consider the Stirling permutation \(\sigma _4=12443321\). Then

$$\begin{aligned} \rho (\sigma _4)=123321, \; \rho ^2(\sigma _4)=1221, \; \rho ^3(\sigma _4)=11. \end{aligned}$$

Moreover,

$$\begin{aligned} I_1(\sigma _4)=[1,8], \; I_2(\sigma _4)=[2,7], \; I_3(\sigma _4)=[5,6], \; I_4(\sigma _4)=[3,4]. \end{aligned}$$

\(\square \)

We now consider how Stirling permutations may be constructed, essentially by using the inverse of the operator \(\rho \) defined above.

Algorithm 2:

Input: natural number n

1.Initialize v:  let \(v=(n,n)\).

2.for =\(j=n-1, n-2, \ldots , 1\)do

         -insert two js in vsuch that none of these is between any

         two ks (\(k>j\))

Output: vector vof length 2n.

Corollary 2

Algorithm 2 produces a Stirling permutation, and any Stirling permutation may be produced in this way.

Proof

The output vector v contains each integer \(1 \le j \le n\) two times. Step 2 assures that the Stirling property holds in each iteration, and, by induction, the output v is a Stirling permutation.

Next, let \(\sigma _n\) be a Stirling permutation in \(\widehat{{\mathcal {S}}}_n^{\times 2}\). By Theorem 9, \(\sigma _n\) is AM-closed. Thus, in Algorithm 1 we can start by putting the two n’s in positions as in \(\sigma _n\), then delete these and repeat the placement of \(n-1\). The AM-property and induction then assures that the constructed v equals \(\sigma \). \(\square \)

For instance, to construct the Stirling permutation \(\sigma _4=(1,3,4,4,3,2,2,1)\) Algorithm 2 would do the following

$$\begin{aligned} \begin{array}{rrrr} (i) \;(4,4),&(ii) \;(3,4,4,3),&(iii) \;(3,4,4,3,2,2),&(iv) \;(1,3,4,4,3,2,2,1)= \sigma . \end{array} \end{aligned}$$

6 Coda

For completeness we briefly discuss a generalization of Stirling permutations.

We call a general multipermutation \(\sigma _n\) of \(\{1,2,\ldots ,n\}\) inversion-even provided the multiplicities of each of its inversions is even.

In an inversion-even 2-permutation

$$\begin{aligned} \ldots a\ldots b\ldots a\ldots \text{ with } a>b \text{ implies } \ldots a\ldots b\ldots b\ldots a\ldots \;. \end{aligned}$$

Example 8

The 2-permutations of \(\{1,2\}\) and their number of inversions are given in the table below with identification of those that are Stirling permutations::

$$\begin{aligned} \begin{array}{c|c|c} 2\text{-permutations }&{}\text{ number } \text{ of } \text{ inversions } 21&{}\text{ Stirling } \text{ permutation }\\ \hline \hline 1122&{}0&{}\textrm{Yes}\\ 1212&{}1&{}\textrm{No}\\ 1221&{}2&{}\textrm{Yes}\\ 2211&{}4&{}\textrm{Yes}\\ 2121&{}3&{}\textrm{No}\\ 2112&{}2&{}\textrm{No} \end{array}. \end{aligned}$$

Thus an odd number of inversions in a 2-permutation of \(\{1,2\}\) implies that the two integers 1 and 2 alternate. \(\square \)

It follows from Example 8 that a 2-permutation \(\sigma _n\) of \(\{1,2,\ldots ,n\}\) is inversion-even if and only if it does not contain two integers a and b that alternate in their occurrences, that is, avoid the pattern 1212 and its reverse 2121. Such 2-permutations are called quasi-Stirling in [1] and are also considered in [8]. An equivalent definition of a quasi-Stirling permutation is that between any two integers equal to k and for any integer j, either both occurrences of j are between the two k’s or neither are. The two 2-permutations 311, 322 and 213, 312 are examples of quasi-Stirling permutations that are not Stirling permutations. The pattern 1212 gives 1 inversion and the pattern 2121 gives 3 inversions. The reverse of a quasi-Stirling permutation is also a quasi-Stirling permutation because 1212 and 2121 are reverses of one another. Thus quasi-Stirling permutations, as do Stirling permutations, have inversions only of multiplicities 2and 4. The 2-permutations 233112, 322113, 332112, and 321123 have inversions only of multiplicities 2 and 4, and hence they are quasi-Stirling permutations but they are not Stirling permutations, as they contain the pattern 2112. Since a 2-permutation is a Stirling permutation if and only if it avoids the pattern 212, and a 2-permutation is a quasi-Stirling permutation if and only if it avoids the patterns 1212 and 2121, we obtain the following characterization.

Corollary 3

A quasi-Stirling permutation is a Stirling permutation if and only if it avoids the pattern 2112.

Recall from Sect. 5 that Stirling permutations may be characterized by Euler 2-walks in labeled trees. Note that the edges of the tree T must be labeled according to the order in which they are added in a construction of the tree. See again the example in Fig. 1. It is natural to ask if also quasi-permutations can be constructed via trees. The following proposition is in [1].

Proposition 2

A 2-permutation is a quasi-Stirling permutation if and only if it corresponds to a closed Euler 2-walk in a labeled tree with arbitrary labeling of the edges.

Proof

Let T be a plane tree with an arbitrary edge labeling (i.e., via a bijection from its set of edges E into \(\{1, 2, \ldots , n-1\}\)). An Euler 2-walk in T gives a 2-permutation (as each edge is traversed twice) with the additional property that each edge \(e=uv\) is traversed before and after the two times traversal of any edge \(e'=pq\) that is below e in T. Here “below” means that if e is deleted then \(e'\) is disconnected from the root of T. This clearly gives a quasi-Stirling permutation.

Conversely, let \(\sigma _n\) be a quasi-Stirling permutation, and construct a plane tree T as follows, using induction (on n). Let \(k=\sigma _n(1)\) and let T consist of a single edge uv where u is the root, and give this edge the label k. Say that the other k is in position \(s>1\), so \(\sigma _n(s)=k\). Then, s must be even and in positions \(2, 3, \ldots , s-1\) there are \(s/2-1\) numbers, where each occurs twice, by the quasi-Stirling property. Then, by induction, these numbers can be used as labels on a subtree attached to vertex v. Also, if \(s<2n\), we can extend the tree by another edge attached to the root, with label \(\sigma _n(s+1)\) and placed to the right of the edge uv. We continue like this and eventually meet an integer p which is also the last component of \(\sigma _n\), and then the desired tree T is constructed. \(\square \)

Example 9

The quasi-Stirling permutation \(\sigma _5=(3,5,4,4,5,2,2,3,1,1)\) corresponds to the Euler 2-walk in the plane tree T in Fig. 2 when choosing the left-most alternative in DFS search. \(\square \)

Fig. 2
figure 2

Quasi-Stirling permutation and plane tree

Corresponding to a permutation \(\sigma _n=(i_1,i_2,\ldots ,i_n)\in {{\mathcal {S}}}_n\) is a graph called a permutation graph \(G(\sigma _n)\). The vertices of this graph are \(1,2,\ldots ,n\) and there is an edge joining k and l if and only if \(i_k>i_l \), \(1\le k<l\le n\). Thus the edges correspond to inversions. A characterization of a permutation graph is that both it and its complement with respect to the complete graph \(K_n\) are transitively orientable, that is, both are comparability graphs (see [9, 10, 12]. We orient the permutation graph \(G(\sigma _n)\) by orienting the edge joining k and l by \(k\rightarrow l\) if \(i_k>i_l\).

With a Stirling permutation \(\sigma _n\in \widehat{\mathcal S}_n\), we can associate a 2-graphFootnote 1 as follows. The inversion 2-graph \(G_2(\sigma _n)\) of \(\sigma _n\) is the 2-graph with vertices \(1,2,\ldots ,n\) whose edges, as with permutations, correspond to inversions. The multiplicity of an (ordinary) inversion in a Stirling permutation is 2 or 4. We assign the weight 1 to an inversion of multiplicity 2 and weight 2 to an inversion of multiplicity 4; so the edges of \(G_2(\sigma _n)\) have weights 1 or 2. The 2-complement of a 2-graph G is taken with respect to the complete 2-graph \(2K_n\), obtained by assigning weight 2 to each of the edges of the complete graph \(K_n\), and is denoted by \(2K_n{\setminus } G\). The 2-complement of the 2-graph of a Stirling permutation is also the 2-graph of a Stirling permutation, namely the Stirling permutation obtained by reversing the order of its elements. This leads to the following question.

Question 1

Can Stirling permutations be characterized in terms of their inversion 2-graphs similar to the way that permutations are characterized in term of orientability of their permutation graphs and complements? \(\square \)

In this regard consider the next example.

Example 10

Consider the \(5!!=5\cdot 3\cdot 1=15\) Stirling permutations of \(\{1,2,3\}\) given below:

$$\begin{aligned} \begin{array}{c} 112233\\ 113322\\ 112332\\ 122133\\ 122331\end{array} \begin{array}{c} 123321\\ 133221\\ 133122\\ 221133\\ 221331\end{array} \begin{array}{c} 223311\\ 233211\\ 331122\\ 332211\\ 331221\end{array}. \end{aligned}$$

The inversion 2-graphs of those Stirling permutations which contain a path of length 2 (otherwise they do not enter into transitivity considerations) are specified in the table below by giving the weights of edges (recall that these weights in the case of Stirling permutations are the number of inversions divided by 2):

$$\begin{aligned} \begin{array}{c|c|c||l} 3\rightarrow 2&{}2\rightarrow 1&{}3\rightarrow 1&{}\text{ Stirling } \text{ instance }\\ \hline \hline 2&{}2&{}2&{} 332211\\ 2&{}1&{}2&{}331221\\ 2&{}1&{}1&{}133221\\ 1&{}2&{}2&{}233211\\ 1&{}1&{}1&{}123321\\ 2&{}2&{}1&{}\emptyset \\ 1&{}2&{}1&{}\emptyset \\ 1&{}1&{}2&{}\emptyset \end{array}. \end{aligned}$$

Instances of 2-permutations with all nonzero even weights in the 2-graph that are not included above are (again the number of inversions divided by 2):

$$\begin{aligned}\begin{array}{c|c|c|c} 3\rightarrow 2&{}2\rightarrow 1&{}3\rightarrow 1&{}\text{ non-Stirling } \text{ instance }\\ \hline \hline 2&{}2&{}1&{} \emptyset \\ \hline 1&{}2&{}1&{} 322113 \\ \hline 1&{}1&{}2&{} 233112 \end{array} \end{aligned}$$

Thus we see that 121 and 112 need to be ruled out since they occur for a non-Stirling permutation but not for a Stirling permutation. Each of 212 and 111 occur for both a Stirling permutation and a non-Stirling permutation; thus we need to differentiate Stirling and non-Stirling permutations in these cases among those 2-permutations with all even weights. The pattern 221’ is possible for neither Stirling nor non-Stirling permutations so this pattern can’t occur. (Note that in the general case of a 2-permutation, we can have odd weights. For example, in 122313, \(3\rightarrow 1\) only occurs once as an inversion.) \(\square \)

An orientation \({\mathop {G}\limits ^{\rightarrow }}\) of a 2-graph G is obtained by assigning a direction to each of its edges. Thus each edge of weight 1 or 2 of G becomes a (directed) edge of weight 1 or 2, respectively. (Note well that there are no edges of \({\mathop {G}\limits ^{\rightarrow }}\) joining a pair of vertices in opposite directions.) We define a 2-graph G to be transitively orientable provided it has an orientation \({\mathop {G}\limits ^{\rightarrow }}\) so that the following property holds

$$\begin{aligned} x{\mathop {\rightarrow }\limits ^{a}} y, y {\mathop {\rightarrow }\limits ^{b}} z \text{ implies } x{\mathop {\longrightarrow }\limits ^{c\ge \min \{a,b\}}} z, \end{aligned}$$
(5)

where abc denote the weights of 1 or 2 of the corresponding edges of \({\mathop {G}\limits ^{\rightarrow }}\). Thus as noted above, the following are possible for a Stirling permutation:

$$\begin{aligned} \begin{array}{lc} (1)&{} x{\mathop {\rightarrow }\limits ^{1}} y, y {\mathop {\rightarrow }\limits ^{1}} z,x{\mathop {\rightarrow }\limits ^{1}} z;\\ (2)&{}x{\mathop {\rightarrow }\limits ^{1}} y, y {\mathop {\rightarrow }\limits ^{2}} z,x{\mathop {\rightarrow }\limits ^{2}} z;\\ (3)&{}x{\mathop {\rightarrow }\limits ^{2}} y, y {\mathop {\rightarrow }\limits ^{1}} z,x{\mathop {\rightarrow }\limits ^{1}} z;\\ (4)&{}x{\mathop {\rightarrow }\limits ^{2}} y, y {\mathop {\rightarrow }\limits ^{1}} z,x{\mathop {\rightarrow }\limits ^{2}} z;\\ (5) &{}x{\mathop {\rightarrow }\limits ^{2}} y, y {\mathop {\rightarrow }\limits ^{2}} z,x{\mathop {\rightarrow }\limits ^{2}} z,\end{array}. \end{aligned}$$

Of these, (1), and (4) are possible for a non-Stirling 2-permutation, namely, 321,123 (whose reverse is equal to itself) and 332,112, respectively, while (2), (3), and (5) are not. Thus more then (5) is needed to characterize Stirling permutations. In addition the following are not possible for a Stirling permutation as shown:

$$\begin{aligned} \begin{array}{c} x{\mathop {\rightarrow }\limits ^{1}} y, y {\mathop {\rightarrow }\limits ^{1}} z,x{\mathop {\rightarrow }\limits ^{2}} z; \quad 233112\\ x{\mathop {\rightarrow }\limits ^{1}} y, y {\mathop {\rightarrow }\limits ^{2}} z,x{\mathop {\rightarrow }\limits ^{1}} z; \quad 322113\\ \end{array} \end{aligned}$$

All satisfy the condition (5) for transitive orientability. Note that the triple \(x{\mathop {\rightarrow }\limits ^{2}} y, y {\mathop {\rightarrow }\limits ^{2}} z,x{\mathop {\rightarrow }\limits ^{1}} z\) which does not occur for any 2-permutation with all even weights does not satisfy (5).