1 Introduction

In [19], a \(q\)-weighted version of the Robinson–Schensted (RS) algorithm was introduced. In this paper, we show that this algorithm enjoys a symmetry property analogous to the well-known symmetry property of the RS algorithm. The proof uses a generalisation of the growth diagram approach introduced by [58].

The insertion algorithm we consider in this paper is based on column insertion, but the technique applies to any insertion algorithm belonging to a certain class of ‘branching insertion algorithms’, as described in Sect. 7 below. For example, [2] have recently introduced a \(q\)-weighted version of the row insertion algorithm, which is defined similarly to the column insertion version of [19]; they also consider a wider family of such algorithms (and, more generally, dynamics on Gelfand–Tsetlin patterns), some of which fall into the framework considered in the present paper, and can similarly be shown to have the symmetry property. We discuss such extensions in Sect. 7 below.

The Robinson–Schensted algorithm is a combinatorial algorithm which was introduced by Robinson [1] and Schensted [22]. It has wide applications in representation theory and probability theory, e.g. last passage percolation, totally asymmetric simple exclusion process/corner growth model, random matrix theory [12], queues in tandem [17] and more.

There are two versions of RS algorithms, the row insertion and column insertion version. In most of this paper, we deal with column insertion and its \(q\)-version. The RS algorithm transforms a word to a tableau pair of the same shape. A word can be treated as a path, and hence a random word corresponds to a random walk. When taking such a random walk, the shape of the output tableaux is a Markov chain, whose transition kernel is related to the Schur symmetric functions [16]. A geometric generalisation transforms a Brownian motion with drift to a Markov process whose generator is related to \(\mathsf {GL}(n,\mathbb R)\)-Whittaker functions [18], which are eigen functions of the quantum Toda chain [14]. The \(q\)-Whittaker functions on the one hand are a generalisation of the Schur symmetric functions and a specialisation of Macdonald \((q,t)\)-symmetric functions when \(t=0\) [15], and on the other hand are eigen functions of the \(q\)-deformed quantum Toda chain [4, 20]. When \(q\rightarrow 0\) they become the Schur functions, and when \(q\rightarrow 1\) with a proper scaling [10] they converge to Whittaker functions. In the spirit of this connection, a \(q\)-weighted RS algorithm was formulated in [19], which transforms the random walk to a Markov chain that is related to \(q\)-Whittaker functions.

As is expected, the algorithm degenerates to the usual RS algorithm when \(q\rightarrow 0\). Part of the random \(P\)-tableau also has \(q\)-TASEP dynamics [19], the latter introduced in [24], just as the same part of the random \(P\)-tableau of usual RS algorithm has TASEP dynamics [17].

Recently, a \(q\)-version of the RS row insertion algorithm was also introduced in [2]. It denegerates to the usual RS algorithm with row insertion when \(q\rightarrow 0\).

In this paper, we show that both algorithms enjoy a symmetry property analogous to the well-known symmetry property of the RS algorithm. Basically, the symmetry property for the RS algorithms restricted to permutation inputs is the property that the output tableau pair is interchanged if the permutation is inversed. Knuth [13] generalised the usual row insertion algorithm to one which takes matrix input, which we refer to as Robinson–Schensted–Knuth (RSK) algorithm. For this algorithm, the symmetry property is that the output tableau pair is interchanged if the matrix is transposed. Note that the matrix becomes the permutation matrix when the RSK algorithm is restricted to permutation, and hence the transposition of the matrix corresponds to inversion of the permutation. Burge gives a similar generalisation of the column insertion algorithm [3], which we refer to as Burge’s algorithm.

The symmetry property for the usual RS algorithm is normally discussed in the literature for the row insertion. However, in the permutation case, the output tableau pair for row insertion is simply the transposition of the pair for column insertion. Therefore, proofs of the symmetry property can be translated to column insertion instantly. In the matrix input case, the Burge and RSK algorithms are also closely related so that proofs can be extended from one to the other naturally.

For a proof of the symmetry property, one can see e.g. [9, 21, 23]. There are a few different approaches to deal with it. One is the Viennot diagram [25] which provides a nice geometric construction of the RS algorithms. In the matrix input case, there are two approaches which reduce to the Viennot diagram approach when restricted to permutations. One is the antichain or the inversion digraph construction of the RSK algorithm (which should extend naturally to the Burge algorithm) due to [13]; the other (for both RSK and Burge) is Fomin’s matrix-ball construction of [9].

Another method is the growth diagram technique due to Fomin [58]. It can be generalised to the RSK and Burge algorithms. Greene’s theorem [11] gives a proof by showing the relation between the lengths of the longest subsequences of the input and the shape of the output. However, the growth diagram approach can be thought of as a fast construction to calculate these lengths.

Among all these techniques, the special structure of growth diagram can be extended to a class of algorithms what we will call branching algorithms, which include the \(q\)-weighted column and row insertion algorithms. Therefore, it is this approach which we use in this paper. For a simple description of the technique for usual row insertion see e.g. [23], whose column version will be shown in Sect. 3.

The rest of the paper is organised in the following way. In Sect. 2, we recall the insertion rule of a letter into a tableau for the usual RS algorithm (with column insertion). We describe it in a way that suits the growth diagram. In Sect. 3, we describe the insertion rule for a word and state the symmetry property for the RS algorithm applied to permutations. In Sect. 4 and 5, we describe the \(q\)-weighted insertion algorithm for letters and words in a way which is different, but equivalent to the definition given in [19]. In Sect. 6, we state and prove the symmetry property in the \(q\)-case. Finally, in Sect. 7, we prove the symmetry property for the row insertion algorithm and more generally branching algorithms.

2 Classical Robinson–Schensted algorithm

A partition \(\lambda =(\lambda _1,\lambda _2,\ldots ,\lambda _k)\in W=\{(a_1,a_2,\ldots )\in \bigcup _{k=1}^\infty \mathbb N_{\ge 0}^k,a_1\ge a_2\ge \ldots \}\) is a vector of weakly decreasing non-negative integer entries. Denote by \(l(\lambda )\) the number of positive entries of \(\lambda \) and \(|\lambda |=\lambda _1+\cdots +\lambda _{l(\lambda )}\) the size of the partition. We say \(\lambda \) is a partition of \(n\) if \(|\lambda |=n\), which we denote by \(\lambda \vdash n\). A Young tableau \(P\) with shape \(\lambda \) is a left-aligned array of \(l(\lambda )\) rows of positive integers such that the entries are strictly increasing along each column and weakly increasing along each row, and such that the length of the \(j\)th row is \(\lambda _j\). For example, below is a tableau with shape \((4,3,2,2)\).

$$\begin{aligned} \begin{array}{cccc} 1&{}1&{}3&{}4\\ 3&{}5&{}8&{}\\ 6&{}7&{}&{}\\ 8&{}8&{}&{} \end{array} \end{aligned}$$
(1)

We denote by \(\text {sh}P\) the shape of tableau \(P\) and \(\mathcal T_\ell \) the set of all tableaux with entries no greater than \(\ell \). Denote \([n]=\{1,2,\ldots ,n\}\) for a positive integer \(n\). A standard tableau \(Q\) is a tableau with distinct entries from \([|\text {sh}Q|]\). For example, below is a standard tableau with shape \((4,3,2,2)\).

$$\begin{aligned} \begin{array}{cccc} 1&{}3&{}4&{}7\\ 2&{}5&{}8&{}\\ 6&{}10&{}&{}\\ 9&{}11&{}&{} \end{array} \end{aligned}$$

We denote by \(\mathcal S_n\) the set of standard tableaux with shape of size \(n\). For example, the above tableau is an element of \(\mathcal S_{11}\).

For a tableau \(P\), we denote by \(P^k\) its subtableau containing all entries no greater than \(k\) and call it the \(k\)th subtableau of \(P\). For example, the \(6\)th subtableau of the tableau shown in (1) is

$$\begin{aligned} \begin{array}{cccc} 1&{}1&{}3&{}4\\ 3&{}5&{}&{}\\ 6&{}&{}&{} \end{array} \end{aligned}$$

A tableau \(P\) can be identified by the shape of its subtableaux, which we usually denote by \(\lambda ^k=\text {sh}P^k\). Also, let \(\lambda ^0=\emptyset \) be the empty partition. Evidently, a tableau has only finitely many different \(\lambda ^i\)’s and there exists an \(\ell \) such that \(\lambda ^i=\text {sh}P\) for \(i\ge \ell \). We call \(\lambda ^i\) the \(i\)th shape of \(P\). We can identify \(P\) with these shapes and write \(P=\lambda ^0\prec \lambda ^1\prec \lambda ^2\prec \cdots \prec \lambda ^\ell \), where ‘\(\prec \)’ is an interlacing relation: for \(a=(a_1,a_2,\ldots )\) and \(b=(b_1,b_2,\ldots )\), \(a\prec b\) means \(b_1\ge a_1\ge b_2 \ge a_2 \ge \ldots \). For example, the tableau \(P\) in (1) is identified as

$$\begin{aligned} P=\emptyset \prec 2\prec 2\prec 31\prec 41\prec 42\prec 421\prec 422\prec 4322. \end{aligned}$$

The basic operation of the RS algorithm is to insert a letter \(k\in \mathbb N_+{:=}\mathbb N\backslash \{0\}\) into a tableau \(P=\emptyset \prec \lambda ^1\prec \lambda ^2\prec \cdots \prec \lambda ^\ell \) and produce a new tableau \(\tilde{P}=\emptyset \prec \tilde{\lambda }^1\prec \tilde{\lambda }^2\prec \cdots \prec \tilde{\lambda }^\ell \). To do this, we first find the lowest row in \(\lambda ^k\) such that appending a box at the end of that row would preserve the interlacement between the \(k-1\)th shape and the \(k\)th shape, and append the box to that row. Suppose the row has index \(j_k\), then we find the lowest row in \(\lambda ^{k+1}\) that is no lower than row \(j_k\) such that appending a box at the end of that row would preserve the interlacement between the \(k\)th shape and the \(k+1\)th shape, append the box to that row and so on and so forth. More precisely, define

$$\begin{aligned} j_{k-1}=k;\quad j_{i}=\max (\{j\le j_{i-1}:\lambda ^{i-1}_{j-1}>\lambda ^i_j\}\cup \{1\}),\qquad i\ge k. \end{aligned}$$

Then, the new tableau \(\tilde{P}\) is defined by

$$\begin{aligned} \tilde{\lambda }^i= {\left\{ \begin{array}{ll} \lambda ^i,&{}\text {if }i<k;\\ \lambda ^i+\mathbf {e}_{j_i},&{}\text {otherwise.} \end{array}\right. } \end{aligned}$$

where \(\mathbf {e}_{j}\) is the \(j\)th standard basis of \(\mathbb R^{\mathbb N_+}\).

For example, if we insert a 6 into the tableau shown in (1), the insertion process is shown as follows:

$$\begin{aligned} \begin{array}{cccc} \hat{5}&{}\hat{5}&{}\hat{5}&{}\hat{5}\\ \hat{5}&{}\hat{5}&{}&{}\\ \hat{6}&{}{\hat{\mathbf {6}}}&{}&{} \end{array} \rightarrow \begin{array}{cccc} \hat{6}&{}\hat{6}&{}\hat{6}&{}\hat{6}\\ \hat{6}&{}\hat{6}&{}{\hat{\mathbf {7}}}&{}\\ \hat{6}&{}\hat{7}&{}&{} \end{array} \rightarrow \begin{array}{cccc} \hat{7}&{}\hat{7}&{}\hat{7}&{}\hat{7}\\ \hat{7}&{}\hat{7}&{}\hat{8}&{}{\hat{\mathbf {8}}}\\ \hat{7}&{}\hat{7}&{}&{}\\ \hat{8}&{}\hat{8}&{}&{} \end{array} \end{aligned}$$

where each \(\hat{i}\) denotes a box in \(\lambda ^i\), and each bold entry denotes an appended box. The resultant tableau is thus

$$\begin{aligned} \tilde{P}=\emptyset \prec 2\prec 2\prec 31\prec 41\prec 42\prec 422\prec 432\prec 4422= \begin{array}{cccc} 1&{}1&{}3&{}4\\ 3&{}5&{}7&{}8\\ 6&{}6&{}&{}\\ 8&{}8&{}&{}. \end{array} \end{aligned}$$

One can visualise the insertion process by building the shapes up vertically.

figure a

As we can see, this forms a one-column lattice diagram such that for each \(i\le k\), the vertices labelled with \(\lambda ^{i-1},\lambda ^{i},\tilde{\lambda }^{i-1}\) and \(\tilde{\lambda }^{i}\) surround a box, which we call the \(i\)th box. We can put an \(X\) into the \(k\)th box to indicate that the number inserted into \(P\) is \(k\). The corresponding diagram of the previous example where we insert a 6 into tableau (1) is:

figure b

3 Symmetry property for the Robinson–Schensted algorithm

In this section, we define the insertion of words and recall Fomin’s formulation of the RS algorithm in terms of growth diagrams [58] which we use to show the proof of the symmetry property, following the presentation given in [23, Sect. 7.13].

For a word \(w=w_1w_2\ldots w_n\in [l]^n\), the RS algorithm starts with the empty tableau \(P(0)=\emptyset \). Then, \(w_1\) is inserted into \(P(0)\) to obtain \(P(1)\), then \(w_2\) into \(P(1)\) to obtain \(P(2)\) and so on. The recording tableau \(Q\) is a standard tableau defined by:

$$\begin{aligned} Q=\text {sh}P(0)\prec \text {sh}P(1)\prec \cdots \prec \text {sh}P(n). \end{aligned}$$

For example, the following table shows the process of inserting the word \(w=31342\):

figure c

The corresponding pair of tableaux, which we denote as \((P(w),Q(w))\), is:

$$\begin{aligned} (P(w),Q(w))=\left( \begin{array}{ccc} 1&{}3&{}3\\ 2&{}&{}\\ 4&{}&{} \end{array}, \begin{array}{ccc} 1&{}2&{}5\\ 3&{}&{}\\ 4&{}&{} \end{array} \right) \end{aligned}$$

If we denote \((\lambda ^k(i))_{1 \le k \le \ell }\) as the shape of the subtableaux for \(P(i)\), then since \(P(i)\) is obtained from \(P(i-1)\) by inserting \(w_i\), we can construct a \(\{0,1,\ldots ,n\}\times \{0,1,\ldots ,\ell \}\subset \mathbb N^2\) lattice growth diagram by concatenating the one-column lattice diagrams defined in the previous section. This is illustrated in the following picture.

figure d

As such, the tableau pair obtained is for \(P\) the shapes on the vertices of the rightmost vertical and for \(Q\) the shapes on the vertices on the top horizontal line:

$$\begin{aligned} P=\lambda ^1(n)\nearrow \lambda ^2(n)\nearrow \cdots \nearrow \lambda ^\ell (n);\\ Q=\lambda ^\ell (1)\nearrow \lambda ^\ell (2)\nearrow \cdots \nearrow \lambda ^\ell (n). \end{aligned}$$

For example, if we take \(\ell =4\) for word \(w=31342\), the growth diagram is as follows:

figure e

The RS algorithm was initially defined to take a permutation as an input and output a pair of standard tableaux with the same shape. In this case, we take the word identified by \(\sigma (1)\sigma (2)\sigma (3)\dots \sigma (n)\) as the input, which we also denote by \(\sigma \). A classical result of the algorithm is the symmetry property:

Theorem 1

(See e.g. [9, 21, 23]) For any permutation \(\sigma \),

$$\begin{aligned} (P(\sigma ^{-1}),Q(\sigma ^{-1}))=(Q(\sigma ),P(\sigma )). \end{aligned}$$

Proof

(Sketch proof) We present a growth diagram proof whose row insertion counterpart can be found in [23]. Basically, the algorithm is reformulated in a way that is symmetric on the \(n\) by \(n\) growth diagram. We index a box by \((m,k)\) if its four vertices are \((m-1,k-1),(m-1,k),(m,k-1)\) and \((m,k)\). For any box \((m,k)\), denote by \(\lambda ,\mu ^1,\mu ^2,\nu \) the partitions on \((m-1,k-1)\), \((m-1,k), (m,k-1)\) and \((m,k)\), respectively (see the diagram below).

figure f

The algorithm goes with the following rule:

  1. 1.

    If there is an \(X\) in the box and \(\lambda =\mu ^1=\mu ^2\), then \(\nu =\lambda +\mathbf {e}_{l(\lambda )+1}\), that is \(\nu \) is obtained by adding a box that forms a new row itself at the bottom of \(\lambda \).

  2. 2.

    If there is no \(X\) in the box and \(\lambda =\mu ^1\), then \(\nu =\mu ^2\).

  3. 3.

    If there is no \(X\) in the box and \(\lambda =\mu ^2\), then \(\nu =\mu ^1\).

  4. 4.

    If there is no \(X\) in the box and \(\mu ^1=\lambda +\mathbf {e}_i\), \(\mu ^2=\lambda +\mathbf {e}_j\) with \(i\ne j\), then \(\nu =\lambda +\mathbf {e}_i+\mathbf {e}_j=\mu ^1\cup \mu ^2\).

  5. 5.

    If there is no \(X\) in the box and \(\mu ^1=\mu ^2=\lambda +\mathbf {e}_i\), then \(\nu =\lambda +\mathbf {e}_i+\mathbf {e}_{i'}\), where \(i'=\max (\{j\le i:\mu ^1_{j-1}>\mu ^1_j\}\cup \{1\}).\)

Note that these rules do not apply to the words case, which is why permutation is special. The 5 cases together with a trivial case that belongs to both Case 2 and Case 3 are illustrated as follows.

figure g
figure h

This way, all the vertices of the diagram can be labelled recursively given \(\emptyset \) as the boundary condition on the leftmost and bottom vertices. One could check that this is indeed equivalent to the definition in the previous section. Moreover, the transposition of the lattice diagram preserves the algorithm. That is: if we put \(X\)s in boxes \((\sigma (i),i)_{i\le n}\) rather than \((i,\sigma (i))_{i\le n}\), and label each vertex \((i,j)\) with what was labelled on \((j,i)\), we end up with the configuration that is the same as if we apply the rules 1 through 5. This immediately finishes the proof.

4 A \(q\)-weighted Robinson–Schensted algorithm

In a recent paper [19], a \(q\)-weighted RS algorithm was introduced. In this and the next section, we describe the algorithm in a different way from the definition in [19]. At the end of next section, it is obvious to see that:

Proposition 2

The algorithm described in this section for inserting a letter to a tableau and in the next section for inserting a word to an empty tableau is an equivalent reformulation of the \(q\)-weighted RS algorithm defined in [19].

When inserting a letter to a tableau, it outputs a weighted set of tableaux. To insert a \(k\) into \(P\), we start with \(\lambda ^k\), append a box to different possible rows no lower than \(k\), record the index of rows and for each one of these indices \(j_k\), we obtain a new \(k\)th shape \(\tilde{\lambda }^k=\lambda ^k+\mathbf {e}_{j_k}\) with weight \(w_0(k,j_k)\); then, we proceed to add a box to all possible rows in \(\lambda ^{k+1}\) no lower than \(j_k\) and obtain a weighted set of new \(k+1\)th shapes \(\{(\tilde{\lambda }^{k+1}=\lambda ^{k+1}+\mathbf {e}_{j_{k+1}},w_1(k+1,j_{k+1})):j_{k+1}\le j_k\}\); then, for each \(j_{k+1}\), we obtain the new \(k+2\)th shapes with weight \(w_1(k+2,j_{k+2})\) by adding a box to \(j_{k+2}\)th row in \(\lambda ^{k+2}\) and so on and so forth. We also prune all the 0-weighted branches.

This way we obtain a forest of trees whose roots are \(\tilde{\lambda }^k\)’s and leaves are \(\tilde{\lambda }^\ell \)’s with edges labelled by the weights. If we prepend \(\emptyset \prec \lambda ^1\prec \lambda ^2\prec \cdots \prec \lambda ^{k-1}\) to this forest, we obtain a tree with root \(\emptyset \), the first \(k\) levels each having one branch with one edge, which we label with weight 1. Then, for each leaf \(\tilde{\lambda }^\ell \), we obtain a unique tableau by reading its genealogy. We also associate this tableau with a weight which is the product of weights along the edges. By going through all leaves, we obtain a set of weighted tableaux, which is the output of \(q\)-inserting a \(k\) to \(P\).

Now, we describe how we calculate the weights when inserting a box to \(i\)th shape \(\lambda ^i\) with a \(j_{i-1}\) (let \(j_{k-1}=k\)) specified. First, let us define functions \(f_0\) and \(f_1\) associated with a pair of nested partitions \(\mu \prec \lambda \):

$$\begin{aligned} f_0(j;\mu ,\lambda )=1-q^{\mu _{j-1}-\lambda _j};\qquad f_1(j;\mu ,\lambda )=\frac{1-q^{\mu _{j-1}-\lambda _j}}{1-q^{\mu _{j-1}-\mu _j}};\quad 1<j\le k\\ f_0(1;\mu ,\lambda )=f_1(1;\mu ,\lambda )=1. \end{aligned}$$

When adding a box to the first affected partition \(\lambda ^k\), the weight \(w_0(k,j_k)\) associated with each \(j_k\le k\) is

$$\begin{aligned} w_0(k,j_k)=f_0(j_k;\lambda ^{k-1},\lambda ^k)\prod _{p=j_k+1}^k(1-f_0 (p;\lambda ^{k-1},\lambda ^k)). \end{aligned}$$

For \(r>k\), and for a fixed pair of \((\lambda ^r,j_{r-1})\), when adding a box to row \(j_r\le j_{r-1}\) of \(\lambda ^{r}\), the corresponding weight \(w_1(r,j_r)\) is

$$\begin{aligned}&w_1(r,j_r)\\&\quad ={\left\{ \begin{array}{ll} f_0(j_r;\lambda ^{r-1},\lambda ^r)\left( \prod _{p=j_r+1}^{j_{r-1}-1}(1-f_0(p;\lambda ^{r-1},\lambda ^r))\right) \\ \;\;\;\;\;\; \times ~(1-f_1(j_{r-1};\lambda ^{r-1},\lambda ^r)),&{}1\le j_r<j_{r-1}\\ f_1(j_r;\lambda ^{r-1},\lambda ^r),&{}j_r=j_{r-1}. \end{array}\right. } \end{aligned}$$

For example, below is a path of the tree, i.e. genealogy of a possible output tableau when inserting a \(5\) into tableau (1):

$$\begin{aligned} \emptyset \xrightarrow {1} \begin{array}{cc} \hat{1}&\hat{1} \end{array}\xrightarrow {1} \begin{array}{cc} \hat{1}&\hat{1} \end{array}\xrightarrow {1} \begin{array}{ccc} \hat{2}&{}\hat{2}&{}\hat{3}\\ \hat{3}&{}&{} \end{array}\xrightarrow {1} \begin{array}{cccc} \hat{3}&{}\hat{3}&{}\hat{3}&{}\hat{4}\\ \hat{3}&{}&{}&{} \end{array}\xrightarrow {1-q} \begin{array}{cccc} \hat{4}&{}\hat{4}&{}\hat{4}&{}\hat{4}\\ \hat{4}&{}\hat{5}&{}&{}\\ {\hat{\mathbf {5}}}&{}&{}&{} \end{array}\\ \xrightarrow {\left( 1-\frac{1-q}{1-q^2}\right) (1-q^2)} \begin{array}{cccc} \hat{5}&{}\hat{5}&{}\hat{5}&{}\hat{5}\\ \hat{5}&{}\hat{5}&{}{\hat{\mathbf {6}}}&{}\\ \hat{6}&{}&{}&{} \end{array}\xrightarrow {1} \begin{array}{cccc} \hat{6}&{}\hat{6}&{}\hat{6}&{}\hat{6}\\ \hat{6}&{}\hat{6}&{}{\hat{\mathbf {7}}}&{}\\ \hat{6}&{}\hat{7}&{}&{} \end{array}\xrightarrow {\frac{1-q}{1-q^2}} \begin{array}{cccc} \hat{7}&{}\hat{7}&{}\hat{7}&{}\hat{7}\\ \hat{7}&{}\hat{7}&{}\hat{8}&{}{\hat{\mathbf {8}}}\\ \hat{7}&{}\hat{7}&{}&{}\\ \hat{8}&{}\hat{8}&{}&{} \end{array} \end{aligned}$$

where again each \(\hat{r}\) denotes a box in \(\lambda ^r\) and the bold \({\hat{r}}\) denotes the new box \(\tilde{\lambda }^r/\lambda ^r\). We also have \(j_5=3\), \(j_6=j_7=j_8=2\) in this example. The above output tableau is

$$\begin{aligned} \tilde{P}=\emptyset \prec 2\prec 2\prec 31\prec 41\prec 421\prec 431\prec 432\prec 4422= \begin{array}{cccc} 1&{}1&{}3&{}4\\ 3&{}5&{}6&{}8\\ 5&{}7&{}&{}\\ 8&{}8&{}&{} \end{array} \end{aligned}$$

with weight \(1\cdot 1\cdot 1\cdot 1\cdot (1-q)\cdot \left( 1-\frac{1-q}{1-q^2}\right) (1-q^2)\cdot 1\cdot \frac{1-q}{1-q^2}=\frac{q(1-q)^2}{1+q}\). For any two tableaux \(P\) and \(\tilde{P}\), we denote the weight of obtaining \(\tilde{P}\) after inserting \(k\) into \(P\) by \(I_k(P,\tilde{P})\). So, in the previous example, we have \(I_5(P,\tilde{P})=\frac{q(1 - q)^2}{1 + q}\).

As we can see, each branching to obtain a weighted set of new \(i\)th shapes \(\{\tilde{\lambda }^i\}\) is determined by \(\lambda ^i\) and \(j_{i-1}\), the latter in turn is identified by the pair \((\lambda ^{i-1},\tilde{\lambda }^{i-1})\). Therefore, the branching is determined by the triplet \((\lambda ^{i-1},\lambda ^i,\tilde{\lambda }^{i-1})\). While each \(\tilde{\lambda }^i\), together with \(\lambda ^i\) and \(\lambda ^{i+1}\), determines a next branching. Hence, the tree has the structure illustrated in Fig. 1, where we put the weights on the edges. This way we can write the weights:

$$\begin{aligned} w((\lambda ^{i-1},\lambda ^i,\tilde{\lambda }^{i-1}),\tilde{\lambda }^i) = {\left\{ \begin{array}{ll} \mathbb I_{\tilde{\lambda }^i=\lambda ^i} &{}i<k\\ w_0(i,j_i)&{}i=k\\ w_1(i,j_i)&{}i>k \end{array}\right. } \end{aligned}$$

where \(\tilde{\lambda }^i =\lambda ^i+\mathbf {e}_{j_i}\), \(j_i\le j_{i-1}\) for \(i\ge k\) and \(\mathbb I\) is the indicator function.

Fig. 1
figure 1

The structure of a branching insertion algorithm when inserting a letter \(k\) (see Sect. 7, where the \(q\)-weighted algorithm is an example)

Therefore, the \(q\)-insertion algorithm can be visualised in a ‘one-column’ graph similar to the usual insertion. Each node \(\lambda ^{i}\) (or \(\tilde{\lambda }^{j,(p_j)}\)) representing the old \(i\)th shape (or a new \(j\)th shape) is associated with a vertex \((0,i)\) (or \((1,j)\)) as the northwest (or northeast) vertex of the \(i\)th (or \(j\)th) box. Each triplet \((\lambda ^{i-1},\lambda ^i,\tilde{\lambda }^{i-1,(p_{i-1})})\) is represented as connected triple nodes surrounding the \(i\)th box from the south and the west, for which each branch \(\tilde{\lambda }^{i,(p_i)}\) is represented as a node that connects to both \(\lambda ^i\) and \(\tilde{\lambda }^{i-1,(p_{i-1})}\), where we put the weights on both the horizontal and vertical edges.

$$\begin{aligned} w(\tilde{\lambda }^{i-1,(p_{i-1})}\rightarrow \tilde{\lambda }^{i,(p_i)})=w(\lambda ^{i}\rightarrow \tilde{\lambda }^{i,(p_i)})=w((\lambda ^{i-1},\lambda ^i,\tilde{\lambda }^{i-1,(p_{i-1})}),\tilde{\lambda }^i),\quad i\ge 1. \end{aligned}$$

As is in the usual insertion case, we put an \(X\) in the \(k\)th box to indicate we are inserting a \(k\). Figure 2 is such a visualisation corresponding to the tree in Fig. 1.

Fig. 2
figure 2

The one-column construction of \(q\)-inserting a letter to a tableau

All the nodes associated with the right column \(((i,0):0\le i\le \ell )\) form a tree, such that each \(\tilde{P}\) in the output corresponds to a genealogy of a node associated with \((1,\ell )\), whose weight \(I_k(P,\tilde{P})\) can be obtained as the product of the weights along the genealogical line of the tree.

5 Word input for the \(q\)-weighted Robinson–Schensted algorithm

We can also take a word as input for the \(q\)-weighted RS algorithm and produce a set of weighted pairs of tableaux. We start with the set of only one pair of tableaux \((P(0),Q^0)=(\emptyset ,\emptyset )\) with weight 1. Suppose at time \(m\), we have obtained a set of weighted pairs of tableaux

$$\begin{aligned} \{(P(m)^{(1)},(Q^m)^{(1)},w(m)^{(1)}),\ldots ,(P(m)^{(p)},(Q^m)^{(p)},w(m)^{(p)})\}. \end{aligned}$$

We use brackets in superscripts to indicate the different possibilities, in order not to confuse with subtableaux or shapes. We take each triplet \((P(m)^{(i)},(Q^m)^{(i)},w(m)^{(i)})\) in the collection and insert \(w_{m+1}\) into \(P(m)^{(i)}\) to produce a new set of \(P\)-tableaux paired with the weight generated during the insertion

$$\begin{aligned} \{(P(m+1)^{(i,1)},w^{(i,1)}),(P(m+1)^{(i,2)},w^{(i,2)}),\ldots ,(P(m+1)^{(i,r_i)},w^{(i,r_i)})\}. \end{aligned}$$

Then, for each \(P(m+1)^{(i,j)}\), \(1\le j\le r_i\), we pair it with a \((Q^{m+1})^{(i,j)}\) by adding a box with entry \(m+1\) to \((Q^m)^{(i)}\) such that \(\text {sh}P(m+1)^{(i,j)}=\text {sh}(Q^{m+1})^{(i,j)}\). We also attach a weight \(w(m+1)^{(i,j)}=w(m)w^{(i,j)}\) to this pair. This way, for each triplet \((P(m)^{(i)},(Q^m)^{(i)},w(m)^{(i)})\), we have obtained its branching set

$$\begin{aligned}&\{(P(m+1)^{(i,1)},(Q^{m+1})^{(i,1)},w(m+1)^{(i,1)}),\\&\qquad (P(m+1)^{(i,2)},(Q^{m+1})^{(i,2)},w(m+1)^{(i,2)}), \\&\qquad \qquad \qquad \qquad \qquad \ldots ,(P(m+1)^{(i,r_i)},(Q^{m+1})^{(i,r_i)},w(m+1)^{(i,r_i)})\}. \end{aligned}$$

Let \(i\) run over \(1,2,\ldots ,p\); we obtained a collection of all possible branchings:

$$\begin{aligned} ((P(m+1)^{(i,j)},(Q^{m+1})^{(i,j)},w(m+1)^{(i,j)}))_{1 \le i \le p, 1 \le j \le r_i}. \end{aligned}$$

Note by collection we mean a vector of objects that allows repeats, as opposed to a set. We merge triplets with the same tableau pair by adding up their weights. This way, we have obtained the weighted set of pairs of tableaux at time \(m+1\).

The output of inserting the word \(w_1w_2\dots w_n\) is defined as the weighted set at time \(n\). We denote by \(\phi _w(P,Q)\) the weight of pair \((P,Q)\) in this set. This is defined recursively by the following formula (see [19]). For \(P\) and \(Q\) with the same shape of size \(n\) and word \(w\) of length \(n-1\),

$$\begin{aligned} \phi _{wk}(P,Q)=\sum \phi _w(\hat{P},Q^{n-1})I_k(\hat{P},P), \end{aligned}$$

where the sum is over all tableau \(\hat{P}\) with the same shape as \(Q^{n-1}\).

This, like in the usual case, can be visualised as a graph whose nodes are associated with vertices on \(D_{n,\ell }{:=}\{0,\ldots ,n\}\times \{0,\ldots ,\ell \}\) lattice diagram by concatenating the graphs of the one-column construction in Fig. 2 associated with the insertion of each letter. Each possible \(\lambda ^{k,(p_{m,\,k})}(m)\) is associated with the vertex \((m,k)\). For example, we obtain the following graph if we apply the algorithm to \(2132\in [3]^4\), where the unlabelled edges have weight 1, which will be the case hereafter.

figure i

From the definition of the algorithm, each node \(\lambda ^{\ell ,(p)}(n)\) at \((n,\ell )\) corresponds to a \((P,Q)\) tableau pair in the output set. Indeed, we can trace back the genealogy of \(\lambda ^{\ell ,(p)}(n)\) and find a unique array of indices \((p_{m,\,k})_{0 \le \,m \le \,n, 0 \le \,k \le \,\ell }\) with \(p_{n,\ell }=p\) such that nodes \((\lambda ^{k,(p_{m,\,k})}(m))_{m,\,k}\) are connected and form a diagram that is isomorphic to the lattice diagram \(D_{n,\ell }\). Clearly,

$$\begin{aligned} P^{(p)}&= \lambda ^{0,(p_{n,\,0})}(n)\prec \lambda ^{1,(p_{n,\,1})}(n)\prec \cdots \prec \lambda ^{\ell ,(p_{n,\,\ell })}(n);\\ Q^{(p)}&= \lambda ^{\ell ,(p_{0,\,\ell })}(0)\prec \lambda ^{\ell ,(p_{1,\,\ell })}(1)\prec \cdots \prec \lambda ^{\ell ,(p_{n,\,\ell })}(n), \end{aligned}$$

are the corresponding \((P,Q)\) tableau pair. Moreover, we can identify a weight with the node \(\lambda ^{\ell ,(p)}\) by multiplying the weights of all the horizontal (or all the vertical) edges along its genealogical diagram and denote it by \(w(\lambda ^{\ell ,(p)})\):

$$\begin{aligned} w(\lambda ^{\ell ,(p)}(n))&= \prod _{1\,\le \,m\,\le \,n,0\,\le \,k\,\le \,\ell } w(\lambda ^{k,(p_{m-1,\,k})}(m-1)\rightarrow \lambda ^{k,(p_{m,\,k})}(m))\\&= \prod _{0\,\le \, m\,\le \, n,1\,\le \, k\,\le \,\ell } w(\lambda ^{k-1,(p_{m,\,k-1})}(m)\rightarrow \lambda ^{k,(p_{m,\,k-1})}(m)). \end{aligned}$$

Then, by definition,

$$\begin{aligned} \phi _w(P,Q)=\sum w(\lambda ^{\ell ,(p)}(n))\mathbb I_{P^{(p)}=P,Q^{(p)}=Q}, \end{aligned}$$

where the sum is over all nodes \(\lambda ^{l,(p)}(n)\) at vertex \((n,l)\).

Note that when \(q\in (0,1)\), for a fixed word \(w\), the weights are all non-negative and have a total sum 1:

$$\begin{aligned} \phi _w(P,Q)\ge 0,\qquad \sum \phi _w(P,Q)=1, \end{aligned}$$

where the sum is over all pairs of semi-standard and standard tableau pairs \((P,Q)\). This means the algorithm can be viewed as a randomised version of the usual RS algorithm, see [19].

6 The symmetry property for the \(q\)-weighted RS algorithm with permutation input

When we take a permutation input \(\sigma \) which is identified as a word with distinct letters in the same way as in the usual RS algorithm, we also end up with a symmetry property, which is the main result of this paper:

Theorem 3

For any permutation \(\sigma \in S_n\) and standard tableau pair \((P,Q)\),

$$\begin{aligned} \phi _{\sigma ^{-1}}(Q,P)=\phi _\sigma (P,Q). \end{aligned}$$

As in the usual RS algorithm case, permutation input is special in that we can restate the insertion rule in a symmetric fashion. For each box, we pick a connected triplet on southwest, northwest and southeast corners. That is, suppose the box has index \((m,k)\) we fix arbitrary \(p_1\), \(p_2\) and \(p_3\) such that \((\lambda ,\mu ^1,\mu ^2){:=}(\lambda ^{k-1,(p_1)}(m-1),\lambda ^{k,(p_2)}(m-1),\lambda ^{k-1,(p_3)}(m))\) is a connected triplet. We denote by \(N\) the set of partitions on the vertex \((m,k)\) that are connected to \(\mu ^1\) and \(\mu ^2\), and for any \(\nu \in N\), we write \(w(\mu ,\nu )\) instead of \(w(\mu ^1\rightarrow \nu )\) or \(w(\mu ^2\rightarrow \nu )\) since they are equal, and for the sake of symmetry. Define an operator \(I^k:W\rightarrow W\) by

$$\begin{aligned} I^k\lambda := \lambda +\mathbf {e}_{\max \{j\,\le \,k\,:\,\lambda \,+\,\mathbf {e}_j \in W\}} \end{aligned}$$

and a set \(\Lambda ^k(\lambda )\subset W\) by

$$\begin{aligned} \Lambda ^k(\lambda ) := \{I^j\lambda :j\le k\}, \end{aligned}$$

and denote \(\Lambda (\lambda ) := \Lambda ^{l(\lambda )+1}(\lambda )\).

Then, \(N\) and \((w(\mu ,\nu ):\nu \in N)\) belong to one of the following 5 cases.

  1. 1.

    The box has an \(X\) in it, and \(\mu ^1\), \(\mu ^2\) are equal to \(\lambda \). Then, \(N\) consists of all possible partitions obtained by adding a box to \(\lambda \):

    $$\begin{aligned} N=\Lambda (\lambda ). \end{aligned}$$

    The weights are

    $$\begin{aligned} w(\mu ,\nu )={\left\{ \begin{array}{ll} q^{\lambda _j}-q^{\lambda _{j-1}},&{}\text {if }\nu =\lambda +\mathbf {e}_j\text { for some }j>1\\ q^{\lambda _1},&{}\text {if }\nu =\lambda +\mathbf {e}_1 \end{array}\right. },\quad \nu \in N. \end{aligned}$$
  2. 2.

    The box does not have an \(X\) in it and \(\mu ^1=\lambda \). Then, \(N\) is a singleton which is the same as \(\mu ^2\), and the weight is 1:

    $$\begin{aligned} w(\mu ,\nu )=1,\quad \nu \in N=\{\mu ^2\}. \end{aligned}$$
  3. 3.

    (The dual case of case 2) The box does not have an \(X\) in it and \(\mu ^2=\lambda \). Then, \(N\) is a singleton which is the same as \(\mu ^1\), and the weight is 1:

    $$\begin{aligned} w(\mu ,\nu )=1,\quad \nu \in N=\{\mu ^1\}. \end{aligned}$$
  4. 4.

    The box is empty. \(\mu ^1=\lambda +\mathbf {e}_i\) and \(\mu ^2=\lambda +\mathbf {e}_j\) for some \(i\ne j\). Then, \(N\) again only contains one element \(\mu ^1\cup \mu ^2\), with weight 1:

    $$\begin{aligned} w(\mu ,\nu )=1,\quad \nu \in N=\{\mu ^1\cup \mu ^2\}. \end{aligned}$$
  5. 5.

    The box is empty and \(\mu ^1=\mu ^2=\lambda +\mathbf {e}_i\,{:=}\,\mu \) for some \(i\). Then, \(N\) consists of all possible partitions that are obtained by adding a box to a row no lower than \(i\)th row of \(\mu \). That is

    $$\begin{aligned} N=\Lambda ^i(\mu ). \end{aligned}$$

    The weights are

    $$\begin{aligned}&w(\mu ,\nu )\\&={\left\{ \begin{array}{ll} \frac{1-\,q^{\lambda _{i-1}-\lambda _i-1}}{1-\,q^{\lambda _{i-1}-\lambda _i}},&{}\nu =\mu +\mathbf {e}_i;\\ \frac{1-\,q}{1-\,q^{\lambda _{i-1}-\lambda _i}}q^{\lambda _j-\lambda _i-1}(1-\,q^{\lambda _{j-1}-\lambda _j}),&{}\nu =\mu +\mathbf {e}_j\text { for some }2\le j< i;\\ \frac{1-\,q}{1-\,q^{\lambda _{i-1}-\lambda _i}}q^{\lambda _1-\lambda _i-1},&{}\nu =\mu +\mathbf {e}_1. \end{array}\right. }\\ \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad ,\nu \in N. \end{aligned}$$

We call this the growth graph rule as opposed to the insertion rule described in Sect. 4 and 5. Below is a group of illustrations of all 5 cases, where \(\lambda \) is the southwest partition.

figure j
figure k
figure l

Proof

(Proof of Theorem 3) It now suffices to show that the above construction agrees with the definition of the algorithm in the preceding section. That is, for any connected triplets \((\lambda ,\mu ^1,\mu ^2)\) surrounding the box \((m,k)\) from the southwest, its branching set with corresponding weights according to the insertion rule agrees with \(N\) and \(w(\mu ,\nu )\)’s according to the growth graph rule. To distinguish the context of insertion rule and growth graph rule, we also write \(\lambda =\lambda ^{k-1}\), \(\mu ^1=\lambda ^{k}\), \(\mu ^2=\tilde{\lambda }^{k-1}\) and \(\nu =\tilde{\lambda }^k\in N\) in accordance with the definition of the insertion algorithm in Sect. 4. We show this by discussing the location of \((m,k)\) in the permutation matrix of \(\sigma \), which corresponds to the 5 cases in the growth graph rule.

  1. 1.

    The box \((m,k)\) has an \(X\) in it. This means \(\sigma _m=k\). So, we are inserting a \(k\) to the tableau at time \(m\) and hence \(\lambda ^{k-1}=\tilde{\lambda }^{k-1}\), i.e. \(\lambda =\mu ^2\). Moreover, since \(\sigma \) is a permutation, we have \(\sigma _i\ne k\) for all \(i<m\), hence \(\lambda ^{k-1}=\lambda ^k\), i.e. \(\lambda =\mu ^1\) (condition of Case 1 satisfied). Any branch of \((\lambda ^{k-1},\lambda ^k,\tilde{\lambda }^{k-1})=(\lambda ,\lambda ,\lambda )\) is one of the \(\lambda +\mathbf {e}_j\)’s such that the weight \(w((\lambda ,\lambda ,\lambda ),\lambda +\mathbf {e}_j)=w_0(k,j)\ne 0\).

    $$\begin{aligned} w_0(k,j)&= f_0(j;\lambda ,\lambda )\prod _{p=j+1}^k(1-f_0(p;\lambda ,\lambda ))\\&= {\left\{ \begin{array}{ll} (1-q^{\lambda _{j-1}-\lambda _j})q^{\lambda _j}&{}\text { if }j>1\\ q^{\lambda _1}&{}\text { if }j=1. \end{array}\right. } \end{aligned}$$

    So, the weights agree. All the pruned branches \(\lambda +\mathbf {e}_j\) with \(w_0(k,j)=0\) are exactly the \(\lambda +\mathbf {e}_j\)’s that are not partitions. Therefore, \(N\) is exactly the set of all branches of the triplet.

  2. 2.

    There is no \(X\) in \((i,k)\) for \(1\le i\le m\). This means \(\sigma _i\ne k\) for \(i\le m\). Since \(\sigma _i\ne k\) for \(i<m\), \(\lambda ^{k-1}=\lambda ^k\), i.e. \(\lambda =\mu ^1\) (condition of Case 2 satisfied). Moreover, since \(\sigma _m\ne k\), the triplet produces only one branch which is equal to \(\mu ^2\) with weight 1. This agrees with Case 2.

  3. 3.

    There is no \(X\) in \((m,i)\) for \(1\le i\le k\). This means \(\sigma _m>k\). By the insertion rule, \(\lambda ^{k-1}=\tilde{\lambda }^{k-1}\), i.e. \(\lambda =\mu ^2\) (condition of Case 3 satisfied). Again, by the same rule, the triplet only produces one branch that equals \(\mu ^1\) with weight 1.

  4. 4.

    There is one \(X\) in each of \((t,k)\) and \((m,s)\) for some \(t<m\) and \(s<k\). Then, on the one hand, \(\sigma _t=k\) so \(\lambda ^k=\lambda ^{k-1}+\mathbf {e}_i\) for some \(i\), i.e. \(\mu ^1=\lambda +\mathbf {e}_i\). On the other hand, \(\sigma _m<k\) so \(\tilde{\lambda }^{k-1}=\lambda ^{k-1}+\mathbf {e}_j\) for some \(j\) and \(j_{k-1}=j\), i.e. \(\mu ^2=\lambda +\mathbf {e}_j\) (condition of Case 4 or Case 5 satisfied). Therefore, the branches of the triplet \((\lambda ,\lambda +\mathbf {e}_i,\lambda +\mathbf {e}_j)\) are in the form of \(\tilde{\lambda }^k=\lambda ^k+\mathbf {e}_{j_k}\) for \(j_k\le j\) with weights

    $$\begin{aligned} \begin{aligned}&w((\lambda ,\lambda +\mathbf {e}_i,\lambda +\mathbf {e}_j),\lambda +\mathbf {e}_i+\mathbf {e}_{j_k})=w_1(k,j_k)\\&={\left\{ \begin{array}{ll} f_0(j_k;\lambda ,\lambda +\mathbf {e}_i)\left( \prod _{p=j_k+1}^{j-1}(1-f_0(p;\lambda ,\lambda +\mathbf {e}_i))\right) \\ \times (1-f_1(j;\lambda ,\lambda +\mathbf {e}_i))&{}\text { if }j_k<j\\ f_1(j;\lambda ,\lambda +\mathbf {e}_i)&{}\text { if }j_k=j \end{array}\right. } \end{aligned} \end{aligned}$$
    (2)

    If \(j\ne i\) (condition of Case 4 satisfied), then \(f_1(j;\lambda ,\lambda +\mathbf {e}_i)=(1-q^{\lambda _{j-1}-\lambda _j})/(1-q^{\lambda _{j-1}-\lambda _j})=1\). Therefore, the branch has only one shape equal to \(\mu ^1+\mathbf {e}_j\) with weight 1. This agrees with Case 4. If \(j=i\) (condition of Case 5 satisfied), then by (2),

    $$\begin{aligned} w_1(k,j_k)= {\left\{ \begin{array}{ll} \frac{1-\,q^{\lambda _{i-1}-\lambda _i-1}}{1-\,q^{\lambda _{i-1}-\lambda _i}};&{}\text { if }j_k=i;\\ \frac{1-\,q}{1-\,q^{\lambda _{i-1}-\lambda _i}}q^{\lambda _j-\lambda _i-1}(1-\,q^{\lambda _{j-1}-\lambda _j});&{}\text { if }2\le j_k< i;\\ \frac{1-\,q}{1-\,q^{\lambda _{i-1}-\lambda _i}}q^{\lambda _1-\lambda _i-1};&{}\text { if }j_k=1. \end{array}\right. } \end{aligned}$$

    So, the weights agree with Case 5. Moreover, all the pruned branches are exactly the \(\lambda +\mathbf {e}_i+\mathbf {e}_{j_k}\)’s that are not partitions. Therefore, \(N\) is indeed the set of all branches.

When inverting a permutation \(\sigma \) to \(\sigma ^{-1}\), the \(X\) marks are transposed, so is the weighted graph by the symmetry of the rule, and thus, we have arrived at the conclusion.

Note that in both rules although we consider an arbitrary box with index \((m,k)\), the rules do not depend on either \(m\) or \(k\). This is a key condition for the symmetry property to work and will be generalised in Proposition 6 in the following section. Below is the growth graph of the permutation \(1423\):

figure m

The growth graphs defined above are a natural \(q\)-generalisation of the growth diagrams introduced by Fomin [58] and reduce to Fomin’s growth diagrams when \(q\rightarrow 0\).

7 More insertion algorithms

In [23], it was explained how to use Fomin’s growth diagram technique to show the symmetry property for the RS algorithm with row insertion. To row insert a \(k\) into a tableau \(P\), we again keep \(\lambda ^0\prec \lambda ^1\prec \cdots \prec \lambda ^{k-1}\) unchanged. Then, we append a box at the end of first row of \(\lambda ^k,\lambda ^{k+1},\ldots ,\lambda ^{k_1-1}\), where \(k_1\) is the smallest number in row 1 of \(P\) that is larger than \(k\), then we append a box at the end of second row of \(\lambda ^{k_1},\lambda ^{k_1+1},\dots ,\lambda ^{k_2-1}\), where \(k_2\) is the smallest number in row 2 of \(P\) that is larger than \(k_1\) and so on and so forth. More precisely, define:

$$\begin{aligned} k_0=k;\quad k_j=\min (\{k'> k_{j-1}:\lambda ^{k'}_j>\lambda ^{k'-1}_j\}\cup \{\ell +1\}),\quad j\ge 1. \end{aligned}$$

Then, the output tableau has:

$$\begin{aligned} \tilde{\lambda }^i= {\left\{ \begin{array}{ll} \lambda ^i,&{}\text { if }i<k,\\ \lambda ^i+\mathbf {e}_j,&{}\text { if }k_{j-1}\le i<k_j\text { for some }j. \end{array}\right. } \end{aligned}$$

For example, if we insert a 3 into the tableau (1), the one-column insertion diagram is as follows:

figure n

and the corresponding output tableau is

$$\begin{aligned} \tilde{P}= \begin{array}{cccc} 1&{}1&{}3&{}3\\ 3&{}4&{}8&{}\\ 5&{}7&{}&{}\\ 6&{}8&{}&{}\\ 8&{}&{}&{}. \end{array} \end{aligned}$$

The row insertion of a word is defined in the same way as in column inserting a word. The usual row and column insertions are related in a few ways.

The first is a well-known algebraic duality relation, which we now recall. For any tableau \(T\) and positive integers \(x,y\), denote by \(c_x\) (resp. \(r_y\)) the operation of column (resp. row) inserting \(x\) (resp. \(y\)), that is, \(c_xT\) (resp. \(r_yT\)) is the output tableau when column (resp. row) inserting \(x\) (resp. \(y\)) into \(T\). Denote by \((P_{\text {col}}(w),Q_{\text {col}}(w))\) (resp. \((P_{\text {row}}(w),Q_{\text {row}}(w))\)) the tableau pairs when applying column (resp. row) insertions to word \(w\), respectively. Thus, we have \(P_{\text {col}}(w)=c_{w_n}c_{w_{n-1}}\dots c_{w_1}\emptyset \) and \(P_{\text {row}}(w)=r_{w_n}r_{w_{n-1}}\dots r_{w_1}\emptyset \). Also, denote by \(w^r\) the inverse word of \(w\): \(w^r=(w_n,w_{n-1},\dots ,w_1)\). Moreover, denote by \(\text {ev}(Q)\) the evacuation operation on \(Q\), see e.g. [9, 21]. Then,

Proposition 4

[see e.g. [9]] For any tableau \(T\) and integers \(x,y\), the column insertion of \(x\) and the column insertion of \(y\) commute:

$$\begin{aligned} r_yc_xT=c_xr_yT. \end{aligned}$$
(3)

This implies for any word \(w\),

$$\begin{aligned} P_{\text {col}}(w)=P_{\text {row}}(w^r). \end{aligned}$$
(4)

If furthermore \(w\) is a permutation, then

$$\begin{aligned} Q_{\text {col}}(w)=(\text {ev}(Q_{\text {row}}(w^r)))' \end{aligned}$$

where \(T'\) means the transposition of tableau \(T\).

This duality has a matrix input generalisation where \(Q_{\text {row}}(w^r)\) is obtained by a reverse sliding operation, see e.g. [9].

Another simple relation is between the original definitions. Row insertion was initially defined as an algorithm of inserting and bumping based on the ordering of integers. This definition turns into column insertion if one replaces all occurrence of ‘row’ by ‘column’ and replaces the strong order (greater than) with the weak order (greater than or equal to) due to the asymmetry of the ordering in rows and columns in the definition of a tableau. For these definitions, see e.g. [21].

There is also a third relation which is less well-known and can be seen if one describes the ‘dynamics’ of the column and row insertion algorithms in terms of the (Gelfand–Tsetlin) coordinates \((\lambda ^k_j)_{1\le j\le k\le \ell }\), where \(\lambda ^k\) is the \(k\)th shape of the \(P\)-tableau. In column insertion, we initialise \(j_{k-1}=j\). Then, in each step, we find the largest row index \(j_k\le j_{k-1}\) for a letter \(k\) such that \(\lambda ^{k-1}_{j_k-1}>\lambda ^k_{j_k}\), append a box to \(\lambda ^k_{j_k}\) and increase \(k\) by 1. In row insertion, we initialise \(k_0=k\), and in each step one we find the smallest letter \(k_j>k_{j-1}\) for a row index \(j\) such that \(\lambda ^{k_j}_j>\lambda ^{k_j-1}_j\), append a box to \(\lambda ^{k_{j-1}}_j,\dots ,\lambda ^{k_j-1}_j\) and increase \(j\) by 1. We shall refer to this relation as the dynamical duality.

In a recent paper [2], a \(q\)-weighted RS algorithm with row insertion was proposed. It is defined in a similar way as the \(q\)-column insertion and is related to the latter by an analogue of the dynamical duality described above.

In \(q\)-column insertion, we initialise \(j_{k-1}=k\). Then, in each step, we run over all row indices \(j_k\le j_{k-1}\) for a letter \(k\), with some weight append a box to \(\lambda ^k_{j_k}\) and increase \(k\) by 1. In \(q\)-row insertion, we initialise \(k_0=k\). In each step one, we run over all letters \(k_j>k_{j-1}\) for a row index \(j\) such that, with some weight, we append a box to \(\lambda ^{k_{j-1}}_j,\dots ,\lambda ^{k_j-1}_j\) and increase \(j\) by 1.

Our definition here is a reformulation equivalent to the one in [2]. For \(\mu \prec \lambda \), define

$$\begin{aligned} g(1;\mu ,\lambda )&= 1-q^{\lambda _1-\mu _1},\\ g(j;\mu ,\lambda )&= \frac{1-q^{\lambda _j-\mu _j}}{1-q^{\mu _{j-1}-\mu _j}}\quad j\ge 2. \end{aligned}$$

When \(q\)-row inserting a \(k\) into a tableau \(P\), we keep the first \(k-1\) shapes unchanged: \(\tilde{\lambda }^i=\lambda ^i, i=1,\dots ,k-1\), with weight \(1\), \(\tilde{\lambda }^k=\lambda +\mathbf {e}_1\) and for \(i>k\), we have a binary branching for each triplet \((\lambda ^{i-1},\lambda ^i,\tilde{\lambda }^{i-1}=\lambda ^{i-1}+\mathbf {e}_{j_{i-1}})\):

$$\begin{aligned} u((\lambda ^{i-1},\lambda ^i,\lambda ^{i-1}+\mathbf {e}_{j_{i-1}}),\lambda ^i+\mathbf {e}_{j_i})= {\left\{ \begin{array}{ll} g(j_{i-1};\lambda ^{i-1},\lambda ^i),&{}j_i=j_{i-1}+1;\\ 1-g(j_{i-1};\lambda ^{i-1},\lambda ^i),&{}j_i=j_{i-1};\\ 0,&{}\text { otherwise.} \end{array}\right. } \end{aligned}$$

Denote by \(J_k(P,\tilde{P})\) the weight of obtaining a \(\tilde{P}\) after row inserting a \(k\) into \(P\).

We define the \(q\)-row insertion for word input in the same way as \(q\)-column insertion of words: successively \(q\)-row inserting letters, multiplying the weights, keeping a tableau \(Q\) to record changes for each \(P\) and merging the same tableau pairs by adding up the weights. Denote by \(\psi _w(P,Q)\) the weight of obtaining tableau pair \((P,Q)\) after \(q\)-row inserting a word \(w\). Then, we have the same recursion rule: for a pair of tableaux \((P,Q)\) with the same shape of size \(n\) and a word \(w\) of length \(n-1\),

$$\begin{aligned} \psi _{wk}(P,Q)=\sum \psi _w(\hat{P},Q^{n-1})J_k(\hat{P},P). \end{aligned}$$

where the sum is over all tableau \(\hat{P}\) with the same shape as \(Q^{n-1}\). Since the algorithm has a similar triplet branching structure as in Fig. 1, we can build the one-column insertion construction like in Fig. 2 and concatenate them into a growth graph. With the same approach we can show the symmetry property for this algorithm.

Theorem 5

For any permutation \(\sigma \in S_n\) and standard tableau pair \((P,Q)\),

$$\begin{aligned} \psi _{\sigma ^{-1}}(Q,P)=\psi _\sigma (P,Q). \end{aligned}$$

Proof

(A sketch proof) Again, denote by \(\lambda ,\mu ^1,\mu ^2\) nodes associated with vertices surrounding a box from the south and the west. The set \(M\) of all partitions branched from the triplet with \((u(\mu ,\nu ):\nu \in M)\) belongs to one of the following 5 cases.

  1. 1.

    The box has an \(X\) in it, and \(\mu ^1\), \(\mu ^2\) are equal to \(\lambda \). Then, \(M\) consists of only one partition \(\lambda +\mathbf {e}_1\) with weight 1.

  2. 2.

    The box does not have an \(X\) in it, and \(\mu ^1=\lambda \). Then, \(M\) consists of only one partition \(\mu ^2\) with weight 1.

  3. 3.

    The box does not have an \(X\) in it, and \(\mu ^2=\lambda \). Then, \(M\) consists of only one partition \(\mu ^1\) with weight 1.

  4. 4.

    The box is empty. \(\mu ^1=\lambda +\mathbf {e}_i\) and \(\mu ^2=\lambda +\mathbf {e}_j\) for some \(i\ne j\). Then, \(M\) again only contains one element \(\mu ^1\cup \mu ^2\) with weight 1.

  5. 5.

    The box is empty and \(\mu ^1=\mu ^2=\lambda +\mathbf {e}_i{:=}\mu \) for some \(i\). Then, \(M=\{\lambda +\mathbf {e}_i+\mathbf {e}_{i+1},\lambda +2\mathbf {e}_i\}\) with weight

    $$\begin{aligned} u((\lambda ,\lambda +\mathbf {e}_i,\lambda +\mathbf {e}_i),\lambda +\mathbf {e}_{i+1})&= {\left\{ \begin{array}{ll} 1-q,&{}\text { if }i=1;\\ \frac{1-\,q}{1-\,q^{\lambda _{i-1}-\lambda _i}},&{}\text { if }i>1. \end{array}\right. }\\ u((\lambda ,\lambda +\mathbf {e}_i,\lambda +\mathbf {e}_i),\lambda +2\mathbf {e}_i)&= {\left\{ \begin{array}{ll} q,&{}\text { if }i=1;\\ 1-\frac{1-\,q}{1-\,q^{\lambda _{i-1}-\lambda _i}},&{}\text { if }i>1. \end{array}\right. } \end{aligned}$$

The claim is concluded once these symmetric rules are verified to be equivalent to the insertion rule, which is done in the same way as in the proof of Theorem 3.

As a remark, let us point out that there is no direct generalisation of the algebraic duality relation between the column and row insertions as in Proposition 4 to the \(q\)-weighted case. More specifically, the distribution of the \(P\)-tableaux of \(q\)-column inserting a word \(w\) is not necessarily the same as that of \(q\)-row inserting the reversed word \(w^r\), even when \(w\) is a permutation. That is, if for a standard tableau \(P\) and a permutation \(\sigma \) we define

$$\begin{aligned} \Phi _\sigma (P)&:= \sum _{Q\in \mathcal S}\phi _\sigma (P,Q);\\ \Psi _\sigma (P)&:= \sum _{Q\in \mathcal S}\psi _\sigma (P,Q), \end{aligned}$$

then there exist a positive integer \(n\), a permutation \(\sigma \in S_n\) and a standard tableau \(P\in \mathcal S_n\) such that

$$\begin{aligned} \Phi _\sigma (P)\ne \Psi _{\sigma ^r}(P). \end{aligned}$$

For example, taking \(n=4\), \(\sigma =2143\) and \( P=\begin{array}{cc} 1&{}2\\ 3&{}\\ 4&{} \end{array}\), there is no \(P\) in the output \(P\)-tableaux of \(q\)-column inserting \(\sigma \), i.e. \(\Phi _\sigma (P)=0\), but the \(q\)-row insertion of the reversed permutation word does produce \(P\), with the weight \(\Psi _{\sigma ^r}(P)=q(1-q)^2/(1+q)\). On the other hand, since the commutation relation (3) of the column and row insertion algorithms implies the \(P\)-duality (4), which can be carried over to the \(q\)-case, by contraposition, the \(q\)-column and \(q\)-row insertions do not commute. More precisely, for letters \(x\) and \(y\) and tableaux \(P\) and \(\tilde{P}\), define by \(IJ_{xy}(P,\tilde{P})\) the weight of obtaining \(\tilde{P}\) by first \(q\)-column inserting \(x\) then \(q\)-row inserting \(y\), and by \(JI_{yx}(P,\tilde{P})\) the weight by first \(q\)-row inserting \(y\) then \(q\)-column inserting \(x\):

$$\begin{aligned} IJ_{xy}&:= \sum _{\hat{P}}I_x(P,\hat{P})J_y(\hat{P},\tilde{P});\\ JI_{yx}&:= \sum _{\hat{P}}J_y(P,\hat{P})I_x(\hat{P},\tilde{P}), \end{aligned}$$

then there exist two positive integers \(x\), \(y\) and tableaux \(P\), \(\tilde{P}\) such that

$$\begin{aligned} IJ_{xy}(P,\tilde{P})\ne JI_{yx}(P,\tilde{P}). \end{aligned}$$

As an example, let \(x=3\), \(y=2\), \(P= \begin{array}{c} 1\\ 4 \end{array} \) and \(\tilde{P}= \begin{array}{cc} 1&{}2\\ 3&{}\\ 4&{} \end{array}\), then \(IJ_{32}(P,\tilde{P})=q(1-q)/(1+q)\) but \(JI_{23}(P,\tilde{P})=0\).

Let us go back to the symmetry property. More generally, the symmetry property does not require very strong conditions on the insertion algorithms. Here, we give a sufficient condition for an insertion algorithm to have this property.

First, we define a branching insertion algorithm as an algorithm that has the branching structure as in Fig. 1 when we insert a letter to a tableau. That is, there exists an initial branching weight function \(w_0\), a high level weight function \(w_1\) and a low level weight function \(w_2\) such that when inserting a letter \(k\), the weight of a new \(i\)th shape is:

$$\begin{aligned} w((\lambda ^{i-1},\lambda ^i,\tilde{\lambda }^{i-1}),\tilde{\lambda }^i)= {\left\{ \begin{array}{ll} w_0((\lambda ^{i-1},\lambda ^i,\tilde{\lambda }^{i-1}),\tilde{\lambda }^i),&{}\text { if }i=k;\\ w_1((\lambda ^{i-1},\lambda ^i,\tilde{\lambda }^{i-1}),\tilde{\lambda }^i),&{}\text { if }i>k;\\ w_2((\lambda ^{i-1},\lambda ^i,\tilde{\lambda }^{i-1}),\tilde{\lambda }^i),&{}\text { if }i<k. \end{array}\right. } \end{aligned}$$

Then, we have

Proposition 6

If a branching insertion algorithm satisfies the following conditions:

  1. (i)

    The insertion of \(k'\) into a tableau results in increment of one coordinate by 1 in \(\lambda ^{k'},\lambda ^{k'+1},\dots ,\lambda ^\ell \), while keep \(\lambda ^0,\lambda ^1,\dots ,\lambda ^{k'-1}\) unchanged, that is, the support of \(w_0((\lambda ^{i-1},\lambda ^i,\tilde{\lambda }^{i-1}),\tilde{\lambda }^i)\) and \(w_1((\lambda ^{i-1},\lambda ^i,\tilde{\lambda }^{i-1}),\tilde{\lambda }^i)\) are in \(\{\lambda ^i+\mathbf {e}_j:j\ge 1\}\) and \(w_2((\lambda ^{i-1},\lambda ^i,\tilde{\lambda }^{i-1}),\tilde{\lambda }^i)=\mathbb I_{\lambda ^i=\tilde{\lambda }^i}\),

  2. (ii)

    \(w_1((\lambda ^{m-1},\lambda ^m,\lambda ^{m-1}+\mathbf {e}_i),\lambda ^m+\mathbf {e}_j)=\mathbb I_{i=j}\) if \(\lambda ^m_i=\lambda ^{m-1}_i\);

  3. (iii)

    \(w_0((\lambda ,\lambda ,\lambda ),\lambda +\mathbf {e}_i)\) does not depend on the inserted letter;

  4. (iv)

    \(w_1((\lambda ,\lambda +\mathbf {e}_i,\lambda +\mathbf {e}_i),\lambda +\mathbf {e}_i+\mathbf {e}_j)\) does not depend on the inserted letter,

then it has the symmetry property.

Proof

(Sketch proof) We use the same notations \(\lambda ,\mu ^1,\mu ^2\) as in descriptions of growth graph rules such that they surround the box \((m,k)\) from the south and the west. The symmetry property is shown once we can construct a symmetric growth graph rule, where the relation of \(\lambda \), \(\mu ^1\) and \(\mu ^2\) and whether there is an \(X\) in the box, determines the location of the box in the permutation matrix, and vice versa.

Then, the 5 cases of the growth diagram rule are satisfied given these conditions: for Case 1, the equivalence between \((\lambda =\mu ^1=\mu ^2{\text { AND }}X)\) and \((\sigma _m=k)\) is given by (i) and (ii), and the branched shapes and weights are given by (iii); for Case 2, both the equivalence between \((\lambda =\mu ^1{\text { AND }}{\text { NOT }}X)\) and \((\sigma _s\ne k\forall s\le m)\) is given by (ii), and the singleton branching with weight \(1\) is also given by (ii); for Case 3, both the equivalence between \((\lambda =\mu ^2{\text { AND }}{\text { NOT }}X)\) and \((\sigma _m>k)\) is given by (i), and the singleton shape with weight \(1\) is also given by (i); for Case 4 and 5, the equivalence between \((\mu ^1=\lambda +\mathbf {e}_i{\text { AND }}\mu ^2=\lambda +\mathbf {e}_j{\text { AND }}{\text { NOT }}X)\) and \((\sigma ^{-1}_k<m{\text { AND }}\sigma _m<k)\) is given by (i) (ii), and the singleton shape with weight \(1\) in Case 4 is given by (ii) while the branched shapes and weights in Case 5 are given by (iv).

With this proposition, we can test different algorithms for the symmetry property. For example, a family of \(n!\) \(q\)-weighted algorithms is defined in [2], see Dynamics 3 in Sect. 6.5.3 and (8.5) in Sect. 8.2.1 in that paper. They are indexed by vectors \(h=(h_1,h_2,\dots ,h_n)\) with \(h_i\) being a positive integer less than or equal to \(i\). They are branching algorithms. The algorithm indexed by \(h=(1,1,\dots ,1)\) is the \(q\)-weighted row insertion, and as we have seen in Theorem 5 it has the symmetry property.

The algorithm indexed by \(h=(1,2,\dots ,n)\) also satisfies the conditions in Proposition 6 and, therefore, has a symmetry property. For convenience, we refer to this algorithm as \(A_{1:n}\) in the following. Here, we restate the definition of \(A_{1:n}\) in the framework of branching insertion algorithms. Denote for \(\mu \prec \lambda \):

$$\begin{aligned} I^j(\lambda ;\mu )&{:=}&\lambda +\mathbf {e}_{\max (\{i\,\le j\,:\,\mu _{i-1}\,>\,\lambda _i\}\cup \{1\})}. \end{aligned}$$

The algorithm is defined by the following weights

$$\begin{aligned}&w_0((\lambda ^{k-1},\lambda ^k,\tilde{\lambda }^{k-1}),\tilde{\lambda }^k)=\mathbb I_{\tilde{\lambda }^k=I^k(\lambda ^k;\lambda ^{k-1})},\nonumber \\&w_1((\lambda ^{i-1},\lambda ^i,\tilde{\lambda }^{i-1}),\tilde{\lambda }^i)\nonumber \\&={\left\{ \begin{array}{ll} -\frac{q^{\lambda ^{i-1}_j-\lambda ^i_{j+1}+1}(1-\,q^{\lambda ^i_j-\lambda ^{i-1}_j})}{(1-\,q^{\lambda ^{i-1}_j-\lambda ^i_{j+1}+1})(1-\,q^{\lambda ^{i-1}_{j-1}-\lambda ^{i-1}_j})},\nonumber \\ \qquad \qquad \qquad \qquad \text { if }\tilde{\lambda }^{i-1}=\lambda ^{i-1}+\mathbf {e}_{j},\tilde{\lambda }^i=\lambda ^i+\mathbf {e}_{j+1}\text { for some }j\ge 2;\nonumber \\ -\frac{q^{\lambda ^{i-1}_1-\lambda ^i_2+1}(1-\,q^{\lambda ^i_1-\lambda ^{i-1}_1})}{1-\,q^{\lambda ^{i-1}_1-\lambda ^i_2+1}},\nonumber \\ \qquad \qquad \qquad \qquad \text { if }\tilde{\lambda }^{i-1}=\lambda ^{i-1}+\mathbf {e}_1,\tilde{\lambda }^i=\lambda ^i+\mathbf {e}_2;\nonumber \\ 1+\frac{q^{\lambda ^{i-1}_j-\lambda ^i_{j+1}+1}(1-\,q^{\lambda ^i_j-\lambda ^{i-1}_j})}{(1-\,q^{\lambda ^{i-1}_j-\lambda ^i_{j+1}+1})(1-\,q^{\lambda ^{i-1}_{j-1}-\lambda ^{i-1}_j})},\nonumber \\ \qquad \qquad \qquad \qquad \text { if }\tilde{\lambda }^{i-1}=\lambda ^{i-1}+\mathbf {e}_{j},\tilde{\lambda }^i=I^{j}(\lambda ^i;\lambda ^{i-1})\text { for some }j\ge 2;\nonumber \\ 1+\frac{q^{\lambda ^{i-1}_1-\lambda ^i_2+1}(1-\,q^{\lambda ^i_1-\lambda ^{i-1}_1})}{1-\,q^{\lambda ^{i-1}_1-\lambda ^i_2+1}},\nonumber \\ \qquad \qquad \qquad \qquad \text { if }\tilde{\lambda }^{i-1}=\lambda ^{i-1}+\mathbf {e}_1,\tilde{\lambda }^i=\lambda ^i+\mathbf {e}_1;\nonumber \\ 0,\qquad \qquad \qquad \qquad \text { otherwise,} \end{array}\right. }\nonumber \\&w_2((\lambda ^{i-1},\lambda ^i,\tilde{\lambda }^{i-1}),\tilde{\lambda }^i)=\mathbb I_{\tilde{\lambda }^i=\lambda ^i}. \end{aligned}$$
(5)

When \(q\rightarrow 0\), this algorithm is reduced to the usual column insertion. However, note that \(A_{1:n}\) is quite different from the \(q\)-column insertion discussed in the present paper. For example, when \(q\in (0,1)\), the weights can be negative and, therefore, it cannot be viewed naturally as a randomised algorithm in a probabilistic sense. This is also the case for the two algorithms called ‘\(q\)-Whittaker-multivariate “dynamics” with deterministic long-range interactions’ discussed at the end of this section. Moreover, we have pointed out the dynamical duality between the \(q\)-column insertion and the \(q\)-row insertion, which is an analogue of the dynamical duality between the usual insertion algorithms. Finally, we can see from the weight function formulae in (5) that \(A_{1:n}\) has row insertion like branching of inserting a displaced letter into a lower row, which never happens in the usual column insertion where a displaced letter stays in the same row or is inserted to a higher row. Therefore, we regard the \(q\)-column and \(q\)-row insertion algorithms as the most natural \(q\)-generalisations of the usual RS algorithms.

The natural question of whether the symmetry property holds for algorithms with general \(h\) has a negative answer, even when \(q\rightarrow 0\). For example, let us take \(n=3\), \(h=(1,2,1)\) and \(\sigma =231\). Inserting \(\sigma \) gives us

$$\begin{aligned} P=\begin{array}{cc} 1&{}2\\ 3&{} \end{array}, Q=\begin{array}{cc} 1&{}2\\ 3&{} \end{array} \end{aligned}$$

while inserting \(\sigma ^{-1}=(3,1,2)\) gives

$$\begin{aligned} P=\begin{array}{c} 1\\ 2\\ 3 \end{array}, Q=\begin{array}{c} 1\\ 2\\ 3 \end{array}. \end{aligned}$$

In terms of Proposition 6, these algorithms violate condition (iii) and (iv). It seems likely that an algorithm indexed by \(h\) has the symmetry property if and only if \(h\) is \((1,1,\dots ,1)\) or \((1,2,\dots ,n)\).

In [2] another family of ‘RSK-type’, \(q\)-weighted algorithms associated with vectors \(h\) called ‘\(q\)-Whittaker-multivariate “dynamics” with deterministic long-range interactions’ were introduced. We omit the definitions here and point interested readers to Sect. 8.2.2 of that paper. When \(h=(1,2,\dots ,n)\) and \(h=(1,1,\dots ,1)\), they also satisfy the conditions in Proposition 6 and thus enjoy the symmetry property.