1 Introduction

For \(n\ge 1,\) let \(\pi =\pi _1\cdots \pi _n\) be the one-line representation of a permutation of the set \([n]=\{1,\dots ,n\}.\) For \(n \ge m \ge 1,\) a permutation \(\sigma = \sigma _1\cdots \sigma _n\) contains a permutation (or pattern) \(\pi =\pi _1\cdots \pi _m\) if there exists a subsequence \(1\le h(1)< h(2)< \cdots < h(m)\le n\) such that for any \(i,j\in [m],\) \(\sigma _{h(i)}<\sigma _{h(j)}\) if and only if \(\pi _i<\pi _j.\) We say that the permutation \(\sigma \) avoids \(\pi \) if it does not contain \(\pi .\)

The study of pattern avoidance in permutations was initiated by Knuth [18], and the work of Simion and Schmidt [22] was the first one to focus solely on enumerative results. Since then many authors have studied pattern avoidance for various combinatorial objects. This includes the study of pattern avoidance in binary trees [8, 21], rooted forests [2, 11], circular permutations [7, 26], Dyck paths [4], set partitions [14, 17] and compositions [15]. Pattern avoidance has also been studied for its applications to algebraic geometry (see, for example [1, 5, 9, 10, 27]).

Very recently, Gil and Tomasko [12, 13] initiated the study of pattern avoidance in Grassmannian permutations. In particular, they have shown that all non-identity Grassmannian permutations are Wilf-equivalent and obtained expressions for the number of Grassmannian permutations of a given size avoiding a non-identity Grassmannian permutation. They also count the number of Grassmannian permutations of size \(2k - 2\) and \(2k - 3\) that avoid the identity permutation of size k (denoted \({\text {id}}_k\)). In this article, we build on their work by studying Grassmannian permutations of arbitrary size avoiding \({\text {id}}_k.\) We also refine our results to some special classes of Grassmannian permutations.

The outline of the article is as follows. In Sect. 2, we describe a convenient representation of Grassmannian permutations using binary words that will help in proving results in the sequel. In Sect. 3, we count the number of Grassmannian permutations of size m avoiding \({\text {id}}_k.\) We first do this using binary words and recursions, thus proving a conjecture by Michael Weiner (see Theorem 3.1). We also use Dyck paths to obtain a different expression for these numbers. We then refine this result in Sect. 4 by studying avoidance of an increasing pattern in odd and even Grassmannian permutations. Finally, we obtain similar counts for other classes of Grassmannian permutations in Sect. 5.

2 Preliminaries

We denote the set of Grassmannian permutations of [n] by \(\mathcal {G}_n.\) We use binary words to encode these permutations. Let \(w = w_1 w_2 \cdots w_n\) be a binary word of length n. We construct the Grassmannian permutation G(w) as follows. If \(A = \{i \in [n] \mid w_i = 0\}\) is a set of size k,  then we set the first k terms of G(w) to be those of A listed in increasing order. The remaining \(n - k\) terms are those of \([n] {\setminus } A\) listed in increasing order.

Example 2.1

The Grassmannian permutation associated with the binary word \(0^3101^30 = 000101110\) is \(123594678 \in \mathcal {G}_9.\)

The following result is an immediate consequence of the definitions.

Proposition 2.2

Each permutation in \(\mathcal {G}_n\) is of the form G(w) for some binary word w of length n. This representation is unique for any non-identity permutation,  and the binary words that correspond to the identity permutation are those of the form \(0^j1^{n - j}\) for \(j \in [0, n].\)

As a warm-up exercise, we count the Grassmannian permutations according to the number of fixed points. A fixed point in a permutation \(\pi \) of [n] is a number \(i \in [n]\) such that \(\pi (i) = i.\)

Proposition 2.3

The number of Grassmannian permutations of length n with k fixed points is 1 if \(k = n,\) 0 if \(k = n - 1\) and \((k + 1)2^{n - k - 2}\) otherwise.

Proof

The case \(k = n\) corresponds to the identity permutation, and it is clear that no permutation can have exactly \(n - 1\) fixed points. Let w be a binary word not of the form \(0^i1^{n - i}\) for \(i \in [0, n].\) This means that there is at least one 1 that appears before a 0. Hence, w is of the form \(0^a 1 w' 0 1^b\) for some \(a, b \ge 0\) and binary word \(w'\) of length \(n - (a + b + 2).\) From the way the permutation G(w) is defined, it can be checked that the number of fixed points is \(a + b,\) which are \(\{1, 2, \ldots , a, n - b + 1, n - b + 2, \ldots , n\}.\) So, if we want G(w) to have k fixed points, we have to choose \(a \in [0, k]\) and a binary word \(w'\) of length \(n - k - 2.\) This gives us the required result. \(\square \)

We now turn to pattern avoidance. We say a binary word \(w'\) contains a binary word w if it contains w as a subsequence. We say a binary word \(w'\) avoids w if it does not contain w.

Example 2.4

The binary word 01001101100 contains the pattern 1100. One such instance is indicated in the following: \(0{\underline{1}}00{\underline{1}}1{\underline{0}}11{\underline{0}}0.\) It avoids the pattern 001001 since any pair of 1s that have at least two 0s between them must use the first 1.

It can be checked that pattern avoidance in Grassmannian permutations translates to binary words as described in the following proposition.

Proposition 2.5

If G(w) is not the identity permutation, \(G(w')\) contains G(w) if and only if \(w'\) contains w. If G(w) is the identity permutation of size k,  then \(G(w')\) contains G(w) if and only if \(w'\) contains \(0^j1^{k - j}\) for some \(j \in [0, k].\)

For any binary word w,  denote by \(\mathcal {G}_n(w)\) the set of Grassmannian permutations of length n that avoid G(w). We reprove a result from [12] using the language of binary words.

Theorem 2.6

[12, Theorem 3.3] If w is a binary word of length k and G(w) is not the identity permutation, 

$$\begin{aligned} |\mathcal {G}_n(w)| = 1 + \sum _{j = 2}^{k - 1} \left( {\begin{array}{c}n\\ j\end{array}}\right) . \end{aligned}$$

Proof

The proof is in the same lines as that of [20, Proposition 3.22]. By Proposition 2.5, we have to count the binary words v of length n that do not contain the subsequence \(w = w_1 w_2 \cdots w_k.\) Suppose \(j \in [0, k - 1]\) is the largest number such that v contains \(w_1 w_2 \cdots w_j.\) Then, using the left most occurrence of \(w_1w_2 \cdots w_j,\) we can see that v must be of the form

$$\begin{aligned} (1-w_1)^{i_1}\ w_1\ (1-w_2)^{i_2}\ w_2\ \cdots \ (1-w_j)^{i_j}\ w_j\ (1 - w_{j+1})^{i_{j+1}}, \end{aligned}$$

where \((i_1, \ldots , i_{j+1})\) is a sequence in \({\mathbb {Z}}_{\ge 0}\) and \(i_1 + \cdots + i_{j+1} = n - j.\) There are \(\left( {\begin{array}{c}n\\ j\end{array}}\right) \) such words of length n. Since all words corresponding to the identity permutation avoid w,  removing the over-counting, we get

$$\begin{aligned} |\mathcal {G}_n(w)| = \sum _{j = 0}^{k - 1} \left( {\begin{array}{c}n\\ j\end{array}}\right) - n = 1 + \sum _{j = 2}^{k - 1} \left( {\begin{array}{c}n\\ j\end{array}}\right) . \end{aligned}$$

\(\square \)

As we make use of Dyck paths in the sequel, we now set up relevant notations. A Dyck path of semilength n is a lattice path that starts at the origin, ends at (2n, 0),  has steps \(U = (1, 1)\) and \(D = (1, -1),\) and never falls below the x-axis. A peak in a Dyck path is an up-step immediately followed by a down-step. The height of a peak is the y-coordinate of the point at the end of its up-step. Similarly, a valley is a down-step immediately followed by an up-step and its height is the y-coordinate of the point at the end of its down-step. The number of Dyck paths of semilength n is the \(n^{th}\) Catalan number (for example, see [24]) given by

$$\begin{aligned} C_n = \frac{1}{n + 1}\left( {\begin{array}{c}2n\\ n\end{array}}\right) . \end{aligned}$$

For any \(n \ge 1\) and \(k \ge 0,\) the number of Dyck paths of semilength \(n + 1\) whose last peak is of height \(n + 1 - k\) is given by

$$\begin{aligned} T(n, k) = \frac{n - k + 1}{n + 1} \cdot \left( {\begin{array}{c}n + k\\ n\end{array}}\right) . \end{aligned}$$

A proof of this can be found, for example, in [3]. These numbers are sometimes called the ballot numbers and are listed as [23, A009766].

3 Counting Grassmannian Permutations Avoiding \({\text {id}}_k\)

In this section, we prove an expression conjectured by Michael Weiner, stated in [12, Page 4], for the number of Grassmannian permutations of size m avoiding \({\text {id}}_k.\) We do this using binary words and recursions. We also obtain a different expression for the same numbers by representing the binary words as Dyck paths.

Theorem 3.1

[12, Conjecture] For any \(k \ge 2\) and \(m \in [k, 2k - 2],\) we have

$$\begin{aligned} |\mathcal {G}_m(0^k)| = \sum _{j = 1}^{2k - m}(-1)^{j - 1} j \cdot \left( {\begin{array}{c}2k - m - j\\ j\end{array}}\right) \cdot C_{k - j}. \end{aligned}$$
(1)

We note that the terms on the right-hand side of the above equation for those j where \(2k - m - j < j\) are 0,  and hence the sum only runs over \(j \in [1, k - \lfloor m/2 \rfloor ].\) But we write the sum as above to make the expressions in the following computations easier to read.

For \(m \ge 0,\) let \({\mathcal {B}}(m)\) denote the set of binary words of length m. Set \({\mathcal {B}}(0, m) = \emptyset ,\) and for \(k \ge 1,\) let

$$\begin{aligned} {\mathcal {B}}(k, m) = \{w \in {\mathcal {B}}(m) : w \text { avoids } 0^j1^{k-j} \text { for all } j \in [0, k]\}. \end{aligned}$$

Moreover, we let B(km) denote the cardinality of \({\mathcal {B}}(k, m).\)

Note that if \(m \ge k,\) for any \(i \in [0, m],\) \(0^i1^{m - i}\) contains \(0^j1^{k - j}\) for some \(j \in [0, k].\) Hence, the results in Sect. 2 imply that \(B(k, m) = |\mathcal {G}_m(0^k)|\) for \(m \ge k \ge 2.\) We show that B(km) is defined by the following recurrence:

  1. (i)

    \(B(0, m) = 0\) for all \(m \ge 0\) and \(B(k, 0) = 1\) for all \(k \ge 1.\)

  2. (ii)

    If \(m \ge 2k - 1,\) then \(B(k, m) = 0.\)

  3. (iii)

    For all other values of \(k, m \ge 1,\) we have

    $$\begin{aligned} B(k, m) = B(k, m - 1) + B(k - 1, m - 1) - T(k - 1, m - k). \end{aligned}$$

The first two points are easy to see. We now prove the point (iii). Let \(w = w_1 w_2 \cdots w_m\) be a binary word of length m. Set \(w' = w_1 w_2 \cdots w_{m - 1}.\) We have the following:

  • \(w \in {\mathcal {B}}(k, m)\) with \(w_m = 1\) if and only if \(w' \in {\mathcal {B}}(k - 1, m - 1).\)

  • \(w \in {\mathcal {B}}(k, m)\) with \(w_m = 0\) if and only if \(w' \in {\mathcal {B}}(k ,m - 1)\) and does not have \((k - 1)\) 0s.

Binary words in \({\mathcal {B}}(k, m - 1)\) that have \((k - 1)\) 0s are of the form

$$\begin{aligned} 1^{a_{k - 1}} 0 1^{a_{k - 2}} 0 \cdots 1^{a_1} 0 \end{aligned}$$

for some sequence \((a_1, \ldots , a_{k - 1})\) in \({\mathbb {Z}}_{\ge 0}\) such that \(a_1 + \cdots + a_i \le i\) for all \(i \in [k - 1]\) and \(a_1 + \cdots + a_{k - 1} = m - k.\) Associating the Dyck path given by

$$\begin{aligned} U D^{a_1} U D^{a_2} \cdots D^{a_{k - 1}} U D^{2k - m} \end{aligned}$$

to such a sequence shows that they are counted by \(T(k - 1, m - k).\) This gives us the required recursion.

For any \(k, m \ge 0,\) we define A(km) to be the right-hand side of (1), i.e.,

$$\begin{aligned} A(k, m) = \sum _{j = 1}^{2k - m}(-1)^{j - 1} j \cdot \left( {\begin{array}{c}2k - m - j\\ j\end{array}}\right) \cdot C_{k - j}. \end{aligned}$$

We show that it satisfies the same recurrence as B(km). The fact that \(A(0, m) = 0\) for all \(m \ge 0\) and that \(A(k, m) = 0\) if \(m \ge 2k\) follows from the definition of A(mk). To prove that \(A(k, 0) = 1\) for all \(k \ge 1,\) we have to show that for all \(k \ge 1,\)

$$\begin{aligned} \sum _{j = 1}^k (-1)^{j - 1} j \cdot \left( {\begin{array}{c}2k - j\\ j\end{array}}\right) \cdot C_{k - j} = 1. \end{aligned}$$

Simplifying the summands and re-indexing, this is equivalent to proving that

$$\begin{aligned} \sum _{j = 0}^n (-1)^{j} \left( {\begin{array}{c}n + 1\\ n - j\end{array}}\right) \left( {\begin{array}{c}n + j + 1\\ j\end{array}}\right) = (-1)^n \end{aligned}$$

for any \(n \ge 0.\) This can be proved using the binomial theorem for negative powers by considering the generating function equality

$$\begin{aligned} (1 + x)^{n + 1} \cdot (1 + x)^{-(n + 2)} = \frac{1}{1 + x}. \end{aligned}$$

Proving the analogue of point (iii) for A(km) boils down to proving that

$$\begin{aligned} T(k - 1, m - k) = \sum _{j = 0}^{2k - m - 1} (-1)^{j} \left( {\begin{array}{c}2k - m - 1 - j\\ j\end{array}}\right) \cdot C_{k - 1 - j} \end{aligned}$$

for all \(k \ge 1\) and \(m \in [2k - 1].\) This is a consequence of the following lemma, which is given as Equation (5) in [19] (set \(a = n + k - 1\) and \(b = k\) to obtain the expression given in [19]).

Lemma 3.2

[19, Equation (5)] For any \(a, b \ge 0\) with \(b \in [-a, a],\) we have

$$\begin{aligned} T(a, b) = \sum _{j = 0}^{a - b} (-1)^j \left( {\begin{array}{c}a - b - j\\ j\end{array}}\right) \cdot C_{a - j}. \end{aligned}$$
(2)

This shows that \(A(k, m) = B(k, m)\) for all \(k, m \ge 0\) and hence proves Theorem 3.1.

3.1 Count Using Dyck Paths

In this sub-section, we count the binary words in \({\mathcal {B}}(k, m)\) using Dyck paths.

Lemma 3.3

For any \(k, m \ge 1,\) B(km) is the number of Dyck paths of semilength \((k + 1)\) where the sum of the heights of the first and last peak is \((2k - m).\)

Proof

The binary words in \({\mathcal {B}}(k, m)\) with j 0s are of the form

$$\begin{aligned} 1^{a_j} 0 1^{a_{j - 1}} 0 \cdots 1^{a_2} 0 1^{a_1} 0 1^{a_0} \end{aligned}$$

where \((a_0, a_1, \ldots , a_j)\) is a sequence in \({\mathbb {Z}}_{\ge 0}\) such that

  • \(j \in [0, k - 1],\)

  • \(a_0 + a_1 + \cdots a_i < (k - j) + i\) for all \(i \in [0, j],\) and

  • \(j + a_0 + a_1 + \cdots a_j = m.\)

We associate the Dyck path given by

$$\begin{aligned} U^{k - j} D^{a_0 + 1} U D^{a_{1}} \cdots U D^{a_{j - 1}} U D^{a_j} U D^{k + j - m} \end{aligned}$$

to such a sequence. This gives us the required result. \(\square \)

As a consequence of the above lemma and Theorem 3.1, we obtain the following result which gives an expression for the numbers listed as [23, A114503].

Proposition 3.4

The number of Dyck paths of semilength n where \(s \le 2n - 2\) is the sum of the heights of the first and last peaks is

$$\begin{aligned} \sum _{j = 1}^{\lfloor s/2 \rfloor } (-1)^{j - 1} j \left( {\begin{array}{c}s - j\\ j\end{array}}\right) C_{n - 1 - j}. \end{aligned}$$

We now use Lemma 3.3 to obtain an alternate expression for B(km). To do this we use a refinement of the ballot numbers.

Lemma 3.5

The number of Dyck paths of semilength \(n + 1\) with first peak of height a and last peak of height b where \(a + b \le 2n\) is given by

$$\begin{aligned} \left( {\begin{array}{c}2n - a - b\\ n - a\end{array}}\right) - \left( {\begin{array}{c}2n - a - b\\ n\end{array}}\right) . \end{aligned}$$

Proof

This lemma is an easy consequence of the result proved in [6]. The Dyck paths we want to count correspond to paths from \((a + 1, a - 1)\) to \((2n - b + 1, b - 1)\) using the steps \(U = (1, 1)\) and \(D = (1, -1)\) that do not fall below the x-axis. These can be counted using the reflection principle (for example, see [16]). \(\square \)

Theorem 3.6

For any \(k, m \ge 1,\) we have

$$\begin{aligned} |\mathcal {G}_m(0^k)| = B(k, m) = \sum _{a = 1}^{2k - m - 1} \left[ \left( {\begin{array}{c}m\\ k - a\end{array}}\right) - \left( {\begin{array}{c}m\\ k\end{array}}\right) \right] . \end{aligned}$$

Studying the bijection in Lemma 3.3 and the representation of Grassmannian permutations using binary words, we get the following results.

Corollary 3.7

The number of binary words (of any length,  including the empty word) that avoid \(0^i1^{k - i}\) for all \(i \in [0, k]\) and have exactly j 0s is the ballot number \(T(k, j + 1).\)

Corollary 3.8

For any \(k \ge 1,\) the number of binary words that avoid \(0^i1^{k - i}\) for all \(i \in [0, k]\) is

$$\begin{aligned} \sum _{m = 0}^{2k - 2} B(k, m) = C_{k + 1} - 1. \end{aligned}$$

Corollary 3.9

The number of Grassmannian permutations that avoid \({\text {id}}_k\) is

$$\begin{aligned} \sum _{m = 0}^{2k - 2}|\mathcal {G}_m(0^k)| = C_{k + 1} - \left( {\begin{array}{c}k\\ 2\end{array}}\right) - 1. \end{aligned}$$

4 Parity Restrictions

A permutation is said to be odd if it has an odd number of inversions (occurrences of the pattern 21). We define a binary word w to be odd if the corresponding permutation G(w) is odd. We have the following characterization of odd binary words.

Proposition 4.1

If w is the binary word

$$\begin{aligned} 1^{a_{k}} 0 1^{a_{k - 1}} 0 \cdots 1^{a_1} 0 1^{a_0} \end{aligned}$$

then the number of inversions in the permutation G(w) is \(\sum _{i = 1}^{k} i \cdot a_i.\) In particular,  w is odd if and only if an odd number of terms in the sequence \((a_1, a_3, a_5, \ldots )\) are odd.

Proof

We need to count the number of occurrences of the pattern \(21 = G(10)\) in the Grassmannian permutation G(w). This is just the number of times 10 appears as a subsequence of w. Hence, the number of inversions contributed by a 0 in w is the number of 1s before it. This gives us the required expression for the number of inversions. \(\square \)

Remark 4.2

As a consequence of the above result, we obtain a generating function for Grassmannian permutations keeping track of the number of inversions. Using x to keep track of the length of the permutation and t for the number of inversions, the required generating function is

$$\begin{aligned} \left( \frac{1}{1 - x}\right) \left[ 1 + \sum _{k \ge 1} \left( \frac{x}{1 - xt}\right) \left( \frac{x}{1 - xt^2}\right) \cdots \left( \frac{x}{1 - xt^k}\right) \right] - \frac{x}{(1 - x)^2}. \end{aligned}$$

The last term removes the over-counting for the identity permutations.

We study odd and even Grassmannian permutations that avoid \({\text {id}}_k.\) We use O(km) to denote the number of odd binary words in \({\mathcal {B}}(k, m)\) and similarly define E(km). Note that in particular, we have

$$\begin{aligned} B(k, m) = O(k, m) + E(k, m) \end{aligned}$$

and that O(km) is the number of odd permutations in \(\mathcal {G}_m(0^k).\) Since we have already obtained expressions for B(km) in Sect. 3, we only list expressions for O(km).

In the following results, we set \(C_n\) to be 0 if n is not an integer. Similar to [12, Proposition 3.1], we have the following.

Proposition 4.3

For any \(k \ge 2,\) we have

$$\begin{aligned} O(k, 2k - 2) = \dfrac{C_{k - 1} + C_{(k - 2)/2}}{2}. \end{aligned}$$

Also,  \(O(k, 2k - 3) = 2E(k, 2k - 2).\)

Before proving this result, we need a small lemma.

Lemma 4.4

The number of Dyck paths of semilength n that have all peaks and valleys at odd height is \(C_{(n - 1)/2}.\)

Proof

Since the first peak should be at odd height, the first string of up-steps should be of odd length. The string of down-steps following it should be of even length since the first valley should be at odd height. Continuing this logic, we see that such Dyck paths are those of the form

$$\begin{aligned} U^{2a_1 + 1} D^{2b_1} \cdots U^{2a_k} D^{2b_k + 1}. \end{aligned}$$

This shows that the semilength n should be odd. Also, note that such a Dyck path is primitive (i.e., it only touches the x-axis at (0, 0) and (2n, 0)). Hence, associating the Dyck path of semilength \((n - 1)/2\) given by

$$\begin{aligned} U^{a_1} D^{b_1} \cdots U^{a_k} D^{b_k} \end{aligned}$$

to this Dyck path gives the required count. \(\square \)

Proof of Proposition 4.3

Just as in the proof of [12, Proposition 3.1], we use Dyck paths to represent the words in \({\mathcal {B}}(k, 2k - 2).\) Notice that any word in \({\mathcal {B}}(k, 2k - 2)\) is of the form

$$\begin{aligned} 1^{a_{k -1}} 0 1^{a_{k - 2}} 0 \cdots 1^{a_2} 0 1^{a_1} 0 \end{aligned}$$

where \((a_1, a_2, \ldots , a_k)\) is a sequence in \({\mathbb {Z}}_{\ge 0}\) such that \(a_1 + a_2 + \cdots + a_i \le i\) for all \(i \in [k - 1]\) and \(a_1 + a_2 + \cdots + a_{k - 1} = k - 1.\) These sequences correspond to Dyck paths of semilength \((k - 1)\) by setting \(a_i\) to be the number of down-steps immediately following the \(i^{th}\) up-step:

$$\begin{aligned} U D^{a_1} U D^{a_2} \cdots U D^{a_{k - 1}}. \end{aligned}$$

An odd Dyck path is one where, when written in the above form, an odd number of terms in \((a_1, a_3, a_5, \ldots )\) are odd. We define even Dyck paths to be those that are not odd.

Note that \(O(k, 2k - 2)\) is the number of odd Dyck paths of semilength \((k - 1)\) and \(E(k, 2k - 2)\) is the number of even Dyck paths of semilength \((k - 1).\) The total number of Dyck paths of semilength \((k - 1)\) is \(C_{k - 1}.\) Hence, we can prove the expression for \(O(k, 2k - 2)\) by showing that there are \(C_{(k - 2)/2}\) more odd Dyck paths than even ones.

We first consider Dyck paths that have at least one peak or valley at even height. For such a Dyck path, find the first peak or valley at even height. If it is a peak, change it to a valley and if it is a valley, change it to a peak.

Example 4.5

The first peak or valley at even height in the Dyck path on the left in Fig. 1 is the first valley, which is at height 0. Changing this to a peak gives the Dyck path on the right. Note that the change in the sequence \((a_1, a_2, a_3, a_4)\) corresponding to the Dyck path is as follows:

$$\begin{aligned} (1, 0, 1, 2) \rightarrow (1 - 1, 0 + 1, 1, 2) = (0, 1, 1, 2). \end{aligned}$$

Hence, the Dyck path on the left is even and the one on the right is odd.

Fig. 1
figure 1

Changing the first peak or valley at even height

It can be checked that this gives a bijection between odd and even Dyck paths that have at least one peak or valley at even height.

We now show that Dyck paths where all peaks and valleys are at odd heights must be odd. This will then prove our required result by Lemma 4.4. Suppose the Dyck path

$$\begin{aligned} U D^{a_1} U D^{a_2} \cdots U D^{a_{k - 1}} \end{aligned}$$

has all peaks and valleys at odd heights. If \(a_i \ne 0\) and \(i < (k - 1),\) then there is a peak after the \(i^{th}\) up-step of height \(i - (a_1 + a_2 + \cdots + a_{i - 1})\) and a valley before the \((i + 1)^{th}\) up-step of height \(i - (a_1 + a_2 + \cdots + a_{i}).\) This shows that all \(a_i\) for \(i < (k - 1)\) are even. If k is odd, then \(a_1 + a_2 + \cdots + a_{k - 1} = k - 1\) and hence \(a_{k - 1}\) is even. This means that the last peak is of even height \(a_{k - 1},\) which is a contradiction. This means that k is even, \(a_{k - 1}\) is odd, and hence the Dyck path is odd. This proves the first part of the proposition.

To prove the second statement in the proposition, we use the same method to study \({\mathcal {B}}(k, 2k - 3)\) as in [12, Proposition 3.1]. The binary words in \({\mathcal {B}}(k, 2k - 3)\) that

  • have \((k - 2)\) 0s are in bijection with the words in \({\mathcal {B}}(k, 2k - 2)\) via adding a 0 at the end of the word, and

  • those that have \((k - 2)\) 1s are in bijection with the words in \({\mathcal {B}}(k, 2k - 2)\) via adding a 1 at the start of the word.

Both these actions change the parity of the word if and only if k is even. This shows that \(O(k, 2k - 3) = 2O(k, 2k - 2)\) if k is odd and \(O(k, 2k - 3) = 2E(k, 2k - 2)\) if k is even. But the expression for \(O(k, 2k - 2)\) shows that \(O(k, 2k - 2) = E(k, 2k - 2)\) when k is odd. This proves the second part of the proposition. \(\square \)

Remark 4.6

The expression for \(O(k, 2k - 2)\) can also be derived using recursions just as in [22, Proposition 1]. The numbers \(O(k, 2k - 2)\) are listed as [23, A007595] and \(E(k, 2k - 2)\) are listed as [23, A000150]. The number \(C_{k - 1} = B(k, 2k - 2)\) coincides with the number of permutations of length \((k - 1)\) that avoid the pattern 132. Similarly, the number \(O(k, 2k - 2)\) coincides with the number of even permutations of length \((k - 1)\) that avoid the pattern 132 and \(E(k, 2k - 2)\) coincides with the number of such odd permutations. The numbers \(O(k, 2k - 2)\) also count the Dyck paths of semilength \((k - 1)\) that have an even number of peaks at even height. A bijection between odd Dyck paths and such Dyck paths can be obtained using the same ideas as in the proof of Proposition 4.3.

The idea in the proof of Proposition 4.3 can be generalized to obtain an expression for O(km) in terms of B(km).

Theorem 4.7

For any \(k, m \ge 1,\) we have

$$\begin{aligned} 2O(k, m) = {\left\{ \begin{array}{ll} B(k, m) + B(\frac{k}{2}, \frac{m - 2}{2}) - B(\frac{k}{2}, \frac{m}{2}) \\ \qquad - B(\frac{k - 2}{2}, \frac{m - 2}{2}), &{}\text {if both } k \text { and } m \text { are even}\\ B(k, m) - 2B(\left\lfloor \frac{k}{2} \right\rfloor , \left\lfloor \frac{m - 1}{2} \right\rfloor ), &{}\text {otherwise}. \end{array}\right. } \end{aligned}$$

Proof

For \(j \in [0, k - 1],\) the words in \({\mathcal {B}}(k, m)\) with j 0s are of the form

$$\begin{aligned} 1^{a_j} 0 1^{a_{j - 1}} 0 \cdots 1^{a_2} 0 1^{a_1} 0 1^{a_0} \end{aligned}$$

where \(j + a_0 + a_1 + \cdots + a_j = m\) and \((j - i) + a_0 + a_1 + \cdots + a_i \le k - 1\) for all \(i \in [0, j].\) We associate the following lattice path to such a binary word:

$$\begin{aligned} D^{a_0} U D^{a_1} U D^{a_2} \cdots U D^{a_j}. \end{aligned}$$
(3)

These are lattice paths that start at the origin, have j up-steps, \(m - j\) down-steps, and do not fall below the line \(y = j - k + 1.\) We use \({\mathcal {B}}(k, m)\) to denote the set of these lattice paths as well. Such a lattice path is called odd if an odd number of terms in \((a_1, a_3, a_5, \ldots )\) are odd. The remaining lattice paths are called even. Note that O(km) is the number of odd lattice paths in \({\mathcal {B}}(k, m).\)

Remark 4.8

We could have used Dyck paths, just as in Lemma 3.3, to represent such binary words. However, under this bijection, an odd Dyck path (in the sense mentioned in Proposition 4.3) might correspond to an even binary word depending on the parity of k and j. To avoid this confusion, we use these lattice paths.

We deal with the case when k is odd and m is even, the others are similar. We have to show that there are \(2B(\frac{k - 1}{2}, \frac{m - 2}{2})\) more even lattice paths than odd ones. We first consider lattice paths that have a peak or valley whose height has the same parity as \(j - k + 1\) (which, since k is odd, is the parity of j). For such lattice paths, changing the first such peak or valley gives a bijection between odd and even lattice paths.

Example 4.9

Figure 2 shows two lattice paths that are matched by this bijection corresponding to the binary words 110011 and 110101. Here \(k = 5, m = 6,\) and \(j = 2.\)

Fig. 2
figure 2

Matching lattice paths of opposite parity

It is easy to see that if j is odd, or if j is even and \(a_0 > 0\) is even, then a lattice path of type (3) must have at least one peak or valley whose height has the same parity as j. So, if a lattice path in \({\mathcal {B}}(k, m)\) does not have a peak or valley whose height has the same parity as j,  then we must have that

  • j is even,

  • \(a_0 = 0\) or \(a_0\) is odd, and

  • \(a_1, \dots , a_{j-1}\) are even (which means that the path must be even).

In addition, since m is assumed to be even, the first and third items imply that \(a_0 + a_j\) must be even, so \(a_0\) and \(a_j\) have the same parity.

If both \(a_0\) and \(a_j\) are non-zero, then the lattice path is of the form

$$\begin{aligned} D^{2b_0 + 1} U^{2c_1} D^{2b_1} U^{2c_2} \cdots U^{2c_p} D^{2b_p + 1}. \end{aligned}$$

Associating the lattice path given by

$$\begin{aligned} D^{b_0} U^{c_1} D^{b_1} \cdots U^{c_p} D^{b_p} \end{aligned}$$

to such a lattice path gives a bijection with the lattice paths in \({\mathcal {B}}(\frac{k - 1}{2}, \frac{m - 2}{2}).\)

If both \(a_0, a_j = 0,\) then the lattice path is of the form

$$\begin{aligned} U^{2c_1 + 1} D^{2b_1} U^{2c_2} \cdots D^{2b_{p - 1}} U^{2c_p + 1}. \end{aligned}$$

Associating the lattice path given by

$$\begin{aligned} U^{c_1} D^{b_1} U^{c_2} \cdots D^{b_{p - 1}} U^{c_p} \end{aligned}$$

to such a lattice path gives a bijection with lattice paths in \({\mathcal {B}}(\frac{k - 1}{2}, \frac{m - 2}{2}).\)

The above observations show that there are \(2B(\frac{k - 1}{2}, \frac{m - 2}{2})\) more even lattice paths than odd ones in \({\mathcal {B}}(k, m)\) and hence proves the expression for O(km) when k is odd and m is even.

The same method works for the other cases as well. When k and m are both even, there are some odd lattice paths that do not have a peak or valley at height having the same parity as \(j - k + 1.\) In fact, precisely \(B(\frac{k}{2}, \frac{m - 2}{2})\) of them are odd and \(B(\frac{k}{2}, \frac{m}{2}) + B(\frac{k - 2}{2}, \frac{m - 2}{2})\) of them are even. This is why the expression in this case is slightly different. \(\square \)

From the proof of the above result and Corollaries 3.7and 3.8, we obtain the following.

Corollary 4.10

The number of odd binary words that avoid \(0^i1^{k - i}\) for all \(i \in [0, k]\) and have exactly j 0s is

$$\begin{aligned} \tfrac{1}{2}(T(k, j + 1) - 2T(\tfrac{k}{2}, \tfrac{j + 2}{2})),&\text { if both } k \text { and } j \text { are even},\\ \tfrac{1}{2}(T(k, j + 1) - 2T(\tfrac{k - 1}{2}, \tfrac{j + 2}{2}) - T(\tfrac{k - 1}{2}, \tfrac{j}{2})),&\text { if } k \text { is odd and } j \text { is even}, \text { and}\\ \tfrac{1}{2}(T(k, j + 1) - T(\lfloor \tfrac{k - 1}{2}\rfloor , \tfrac{j + 1}{2})),&\text { otherwise}. \end{aligned}$$

Corollary 4.11

The number of odd Grassmannian permutations avoiding \({\text {id}}_k\) is

$$\begin{aligned} \frac{C_{k + 1}}{2} - 2C_{\frac{k + 1}{2}} + 1 \end{aligned}$$

when k is odd and if k is even it is

$$\begin{aligned} \frac{C_{k + 1} - C_{k/2}}{2} - C_{\frac{k + 2}{2}} + 1. \end{aligned}$$

5 Other Restrictions

In this section, we consider the avoidance of \({\text {id}}_k\) in special classes of Grassmannian permutations mentioned in [12, Section 2].

5.1 BiGrassmannian Permutations

A permutation \(\pi \) is said to be biGrassmannian if both \(\pi \) and \(\pi ^{-1}\) are Grassmannian. Rewriting a result from [12] in terms of binary words, we have the following.

Proposition 5.1

[12, Proposition 2.1] The biGrassmannian permutations of size m are those in \(\mathcal {G}_m(1010)\) and are counted by

$$\begin{aligned} 1 + \left( {\begin{array}{c}m + 1\\ 3\end{array}}\right) . \end{aligned}$$

We study biGrassmannian permutations avoiding \({\text {id}}_k.\)

Theorem 5.2

For \(k\le m < 2k,\) the number of biGrassmannian permutations of size m that avoid \({\text {id}}_k\) is

$$\begin{aligned} \left( {\begin{array}{c}2k - m + 1\\ 3\end{array}}\right) . \end{aligned}$$

Proof

When \(m = k,\) the only biGrassmannian permutation of size k that contains \({\text {id}}_k\) is the identity itself. Using Proposition 5.1, we get that there are

$$\begin{aligned} \left( {\begin{array}{c}k + 1\\ 3\end{array}}\right) \end{aligned}$$

biGrassmannian permutations of size k that avoid \({\text {id}}_k.\)

When \(m \ge k,\) the binary words corresponding to biGrassmannian permutations of size m that avoid \({\text {id}}_k\) are of the following forms:

  1. (i)

    \(0^a1^b0^c\) for some \(a, b, c \ge 1\) such that \(a + b \le k - 1\) and \(a + c \le k - 1.\)

  2. (ii)

    \(0^a1^b0^c1^d\) for some \(a, b, c, d \ge 1\) such that \(a + b + d \le k - 1\) and \(a + c + d \le k - 1.\)

  3. (iii)

    \(1^a0^b\) for some \(a, b \ge 1\) such that \(a \le k - 1\) and \(b \le k - 1.\)

  4. (iv)

    \(1^a0^b1^c\) for some \(a, b, c \ge 1\) such that \(a + c \le k - 1\) and \(b + c \le k - 1.\)

If \(m > k,\) we show that the binary words listed above are in bijection with the non-identity biGrassmannian permutations of size \(2k - m.\) This will then prove the second part of the result. Since \(m > k,\) words of type (i) cannot have \(b \le m - k\) or \(c \le m - k.\) We replace b by \(b - (m - k)\) and c by \(c - (m - k).\) We make the same replacement for words of type (ii). For words of type (iii) and (iv) we replace a by \(a - (m - k)\) and b by \(b - (m - k).\) It can be checked that this gives us the required bijection. \(\square \)

We now consider odd biGrassmannian permutations avoiding \({\text {id}}_k.\) Since biGrassmannian permutations are precisely those Grassmannian permutations that avoid the pattern 2413 [12, Proposition 2.1], we have the following from [13].

Proposition 5.3

[13, Theorem 3.3] Set a(m) to be the number of odd biGrassmannian permutations of size m. Then, 

$$\begin{aligned} a(m) = {\left\{ \begin{array}{ll} \frac{1}{4} \left( {\begin{array}{c}m + 2\\ 3\end{array}}\right) , &{} \text {if } m \text { is even}\\ \frac{1}{24}(m - 1)(m + 1)(m + 3), &{} \text {if } m \text { is odd}. \end{array}\right. } \end{aligned}$$

Theorem 5.4

The number of odd biGrassmannian permutations of size m that avoid \({\text {id}}_k\) is

$$\begin{aligned} a(m),&\quad \text {if } m \le k,\\ a(2k - m),&\quad \text {if } m> k \text { and } (m - k) \text { is even}, \text {and}\\ a(2k - m - 2),&\quad \text {if } m > k \text { and } (m - k) \text { is odd}. \end{aligned}$$

Proof

If \(m \le k,\) then all odd biGrassmannian permutations avoid \({\text {id}}_k.\) Also, if \(m \ge 2k,\) then all odd biGrassmannian permutations contain \({\text {id}}_k.\) The proof for the other two cases are similar to the proof of Theorem 5.2. For example, suppose that \(m > k,\) \((m - k)\) is odd, and

$$\begin{aligned} 0^a 1^b 0^c 1^d \end{aligned}$$

is an odd biGrassmannian permutation avoiding \({\text {id}}_k.\) The Grassmannian permutation associated to the binary word

$$\begin{aligned} 0^a 1^{b - (m - k - 1)} 0^{c - (m - k - 1)} 1^d \end{aligned}$$

is an odd biGrassmannian permutation of length \((2k - m - 2).\) Similar operations on other odd biGrassmannian permutations of size m avoiding \({\text {id}}_k\) show that they correspond to odd biGrassmannian permutations of size \((2k - m - 2).\) A similar technique works for proving the result when \(m > k\) and \((m - k)\) is even. \(\square \)

5.2 Grassmannian Involutions

These are Grassmannian permutations \(\pi \) that satisfy \(\pi ^{-1} = \pi .\) Rewriting a result from [12] in terms of binary words, we have the following characterization of Grassmannian involutions.

Proposition 5.5

[12, Proposition 2.3] The Grassmannian involutions are those of the form \(G(0^{k_1}1^{k_2}0^{k_2}1^{k_3})\) for some \(k_1, k_2, k_3 \ge 0\) and the number of those of size m is

The following result can be proved using a similar bijection to the one described in the proof of Theorem 5.2.

Theorem 5.6

For \(k \le m < 2k,\) the number of Grassmannian involutions of size m that avoid \({\text {id}}_k\) is

$$\begin{aligned} \left\lfloor \frac{(2k - m)^2}{4} \right\rfloor . \end{aligned}$$

Just as we did for biGrassmannian permutations, we now study odd Grassmannian involutions avoiding \({\text {id}}_k.\)

Proposition 5.7

Set b(m) to be the number of odd Grassmannian involutions of size m. Then, 

$$\begin{aligned} b(m) = \left\lfloor \frac{(m + 1)^2}{8} \right\rfloor . \end{aligned}$$

Proof

For \(m \le 4,\) direct calculations show that \(b(m) = m - 1.\) We now show that for \(m \ge 5,\) we have

$$\begin{aligned} b(m) = b(m - 4) + m - 1. \end{aligned}$$

This will prove the required result.

The binary words corresponding to odd Grassmannian involutions of size m are of the following forms:

  1. (i)

    \(0^a 1^b 0^b\) where \(a, b \ge 1\) and b is odd.

  2. (ii)

    \(0^a 1^b 0^b 1^c\) where \(a, b, c \ge 1\) and b is odd.

  3. (iii)

    \(1^a 0 ^a\) where \(a \ge 1\) is odd.

  4. (iv)

    \(1^a 0^a 1^b\) where \(a, b \ge 1\) and a is odd.

In words of the first two types, if \(b \ne 1,\) replace b by \((b - 2).\) Similarly, in words of the last two types, if \(a \ne 1,\) replace a by \((a - 2).\) This gives a bijection between such words and odd Grassmannian involutions of size \((m - 4).\) The number of remaining binary words is \((m - 1).\) This proves the required recursion. \(\square \)

Using the same ideas as in the proof of Theorem 5.4, we have the following result.

Theorem 5.8

The number of odd Grassmannian involutions of size m that avoid the \({\text {id}}_k\) is

$$\begin{aligned} b(m),&\quad \text {if } m \le k,\\ b(2k - m),&\quad \text {if } m> k \text { and } (m - k) \text { is even}, \text {and}\\ b(2k - m - 2),&\quad \text {if } m > k \text { and } (m - k) \text { is odd}. \end{aligned}$$

6 Concluding Remarks

It would be interesting to see if Theorem 3.1 (or equivalently, Proposition 3.4) and Lemma 3.2 can be proved directly, possibly by the Principle of Inclusion-Exclusion, instead of using recursions. We list some particular cases of these identities which might be easier to tackle than the general results.

  1. (i)

    For \(0 \le m < k,\) we have

    $$\begin{aligned} \sum _{j = 1}^{k}(-1)^{j - 1} j \cdot \left( {\begin{array}{c}2k - m - j\\ j\end{array}}\right) \cdot C_{k - j} = 2^m. \end{aligned}$$
  2. (ii)

    For \(k \ge 1,\) we have

    $$\begin{aligned} \sum _{j = 1}^{k}(-1)^{j - 1} j \cdot \left( {\begin{array}{c}k - j\\ j\end{array}}\right) \cdot C_{k - j} = 2^k - k - 1. \end{aligned}$$