This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

A new lower bound for deterministic pop-stack-sorting

Morgan Bauer and Keith Copenhaver Mathematics Discipline
Natural Sciences Collegium
Eckerd College
copenhkj@eckerd.edu
(Date: July 13, 2023)
Abstract.

The pop-stack-sorting process is a variation of the stack-sorting process. We consider a deterministic version of this process. We prove a lemma which characterises interior elements of increasing runs after tt iterations of the process and provide a new lower bound of 35n\frac{3}{5}n for the number of iterations of the process to fully sort a uniformly randomly chosen permutation of length nn.

1. Introduction

Pop-stack-sorting was introduced by Avis and Newborn in [4]. It is a variation of the stack-sorting process first presented by Knuth in The Art of Computer Programming [14]. Pop-stack-sorting has been the subject of much research in recent years (see [2, 3, 5, 6, 7, 8, 10, 11, 12, 13]). For our purposes, a permutation is an ordered list of the elements of {1,2,,n}\{1,2,...,n\}, where each element appears once. We write permutations in the one-line notation, that is 12n12...n. We consider the deterministic algorithm to which Defant refers as the function 𝖯𝗈𝗉\mathsf{Pop} [9]. The function 𝖯𝗈𝗉\mathsf{Pop} acts as follows: given a permutation σ\sigma, read the permutation from left to right and if there are any consecutive elements which are in decreasing order, reverse the order of those elements. For example, 𝖯𝗈𝗉(471¯83¯6952¯)=417¯38¯6259¯\mathsf{Pop}(4\hskip 1.4457pt\underline{71}\hskip 1.4457pt\underline{83}\hskip 1.4457pt6\hskip 1.4457pt\underline{952})=4\hskip 1.4457pt\underline{17}\hskip 1.4457pt\underline{38}\hskip 1.4457pt6\hskip 1.4457pt\underline{259}. Let 𝒟n𝖯𝗈𝗉\mathcal{D}_{n}^{\mathsf{Pop}} be the average number of iterations of 𝖯𝗈𝗉\mathsf{Pop} that it takes to transform a uniformly randomly chosen permutation of length nn to the identity permutation 12n12...n. In [9], Defant conjectured that

limn𝒟n𝖯𝗈𝗉n=1,\lim_{n\rightarrow\infty}\frac{\mathcal{D}_{n}^{\mathsf{Pop}}}{n}=1,

and asked, in that paper and at the Banff workshop on Analytic and Probabilistic Combinatorics in November 2022, if there exists c(12,1]c\in\left(\frac{1}{2},1\right] such that

lim infn𝒟n𝖯𝗈𝗉nc.\liminf_{n\rightarrow\infty}\frac{\mathcal{D}_{n}^{\mathsf{Pop}}}{n}\geq c.

It was first proven in [16] that c1c\leq 1, and reproven in both [3, 1] using more direct arguments. The lower bound of c=12c=\frac{1}{2} was not proven by Defant in that paper, but we believe that his conjecture was based on an argument similar to a combination of Proposition 2 and Lemma 7.

In [15], Lichev gave a lower bound of c=0.503c=0.503. We improve this bound by proving the following theorem.

Theorem 1.

Let 𝒟n𝖯𝗈𝗉\mathcal{D}_{n}^{\mathsf{Pop}} be the average number of iterations of 𝖯𝗈𝗉\mathsf{Pop} that it takes to transform a uniformly randomly chosen permutation of length nn to the identity permutation. Then

lim infn𝒟n𝖯𝗈𝗉n35.\liminf_{n\rightarrow\infty}\frac{\mathcal{D}_{n}^{\mathsf{Pop}}}{n}\geq\frac{3}{5}.

2. Preliminaries

For brevity, we adopt the notation σt:=𝖯𝗈𝗉t(σ)\sigma_{t}:=\mathsf{Pop}^{t}(\sigma) throughout the paper. Following the standard notation, the position of the element kk in the permutation σt\sigma_{t} is denoted σt1(k)\sigma_{t}^{-1}(k). An increasing run in σt\sigma_{t} is a maximal set of elements {p1,p2,,pk}\{p_{1},p_{2},...,p_{k}\}, k2k\geq 2, such that p1<p2<<pkp_{1}<p_{2}<\dots<p_{k} and σt1(p1)=σt1(p2)1==σt1(pk)k+1.\sigma_{t}^{-1}(p_{1})=\sigma_{t}^{-1}(p_{2})-1=...=\sigma_{t}^{-1}(p_{k})-k+1. A decreasing run is defined similarly. Note that, by this definition, we do not refer to single elements as increasing (or decreasing) runs of length one. An element is in the interior of an increasing (or decreasing) run if it is an element of an increasing (or decreasing) run, but neither the first nor the last element of that run. We also refer to iterations of 𝖯𝗈𝗉\mathsf{Pop} simply as iterations, and the ttth iteration as iteration tt.

Defant noted without proof in [9] that in the image of a permutation under 𝖯𝗈𝗉\mathsf{Pop}, there are no decreasing runs of length more than three.

Proposition 2.

Let σ\sigma be a permutation. Then σ1\sigma_{1} has no decreasing runs of length four or more.

Proof.

Suppose that σ1\sigma_{1} has four adjacent elements, a,b,c,a,b,c, and dd, in that order, such that a>b>c>d.a>b>c>d. Since 𝖯𝗈𝗉\mathsf{Pop} reverses decreasing runs, if two elements are in increasing order in σ\sigma, then they cannot be in the same decreasing run and therefore they are also in increasing order in σ1\sigma_{1}. Thus, bb lies before cc in σ.\sigma. If there are no elements between them in σ\sigma, then bb and cc are in a decreasing run and are reversed in σ1\sigma_{1}. Hence, there must be some element ee in between bb and cc with either e>be>b or e<ce<c. Assume e>be>b. If there are no elements between cc and dd in σ\sigma, then they are in the same decreasing run in σ\sigma and dd lies before cc in σ1\sigma_{1}. Thus the decreasing run including ee and cc does not include dd, so that ee is between cc and dd in σ1\sigma_{1}, a contradiction. A similar argument can be made to show that if e<ce<c then ee must be between aa and bb in σ1\sigma_{1}.  ∎

Since all decreasing runs in a pop-stack-sorted permutation are of length two or three, and we are intensely concerned with the manner in which individual elements move, we name each possible way of moving or holding position for an element during an iteration after the first.

We say that 𝖯𝗈𝗉\mathsf{Pop} causes two elements to switch if they are in reverse order but not part of a decreasing run of length three. We say that 𝖯𝗈𝗉\mathsf{Pop} causes three elements to pivot if they are in a decreasing run of length three, where the outermost elements both move and the middle of the three elements holds its position. We call the middle element of a pivot the center of the pivot. If an element is in the interior of an increasing run, or at the start of an increasing run in position 11, or the end of an increasing run in position nn, it has the same position after 𝖯𝗈𝗉\mathsf{Pop} is applied, and we say that the element stops.

In any given iteration after the first, there are four ways to move: switch left, switch right, pivot left, pivot right, and two ways to hold position: be the center of a pivot, or stop.

Consider the example σ=471836952\sigma=471836952 from above. Then we have σ1=𝖯𝗈𝗉(471¯83¯6952¯)=417¯38¯6259¯.\sigma_{1}=\mathsf{Pop}(4\hskip 1.4457pt\underline{71}\hskip 1.4457pt\underline{83}\hskip 1.4457pt6\hskip 1.4457pt\underline{952})=4\hskip 1.4457pt\underline{17}\hskip 1.4457pt\underline{38}\hskip 1.4457pt6\hskip 1.4457pt\underline{259}. Applying 𝖯𝗈𝗉\mathsf{Pop} again, we have σ2=𝖯𝗈𝗉(41¯73¯862¯59)=14¯37¯268¯59.\sigma_{2}=\mathsf{Pop}(\underline{41}\hskip 1.4457pt\underline{73}\hskip 1.4457pt\underline{862}\hskip 1.4457pt5\hskip 1.4457pt9)=\underline{14}\hskip 1.4457pt\underline{37}\hskip 1.4457pt\underline{268}\hskip 1.4457pt5\hskip 1.4457pt9. During iteration 2, the pair 1 and 4 and the pair 3 and 7 switch and the elements 2, 6, and 8 pivot, with 6 as the center of the pivot. The only elements which hold their position during iteration 2 are 6, 5, and 9; 6 is the center of a pivot and both 5 and 9 stop. Note also that the element 6, which is the center of a pivot in iteration 2, stops during iteration 1.

3. The pop-stop lemma and proof of Theorem 1

We begin with two observations regarding elements which stop. Let σ\sigma be a permutation of length n3n\geq 3.

Observation 3.

If three elements pivot during iteration tt, t2,t\geq 2, then the center of the pivot stops during iteration t1t-1.

Proof.

If kk moves or is the center of a pivot during iteration t1t-1, then kk is in an increasing run with at least one of its neighbors in σt1\sigma_{t-1}, thus kk cannot be the center of a pivot during iteration tt, a contradiction. The only remaining possibility is that kk stops during iteration t1t-1. ∎

Observation 4.

If an element moves to the left during iteration tt, t2t\geq 2, then during iteration t1t-1 it either moves to the left or stops. The corresponding statement for moving right also holds.

Proof.

If an element moves to the right or is the center of a pivot during iteration t1t-1, then it is larger than its neighbor on its left in σt1\sigma_{t-1} and thus cannot move to the left during iteration tt. Therefore, the element must move to the left or stop during iteration t1t-1. ∎

The following lemma, which we refer to as the pop-stop lemma, gives some insight into the circumstances under which an element stops during iteration tt. Such elements are important because pivots (after the first iteration) are always preceded by a stop. Fix some 1kn1\leq k\leq n in a permutation σ\sigma of length nn, where σ1(k)>k\sigma^{-1}(k)>k so that the sorting process eventually causes kk to move to the left. Intuitively, kk almost always moves to the left until it becomes a left-to-right maximum unless it encounters an element smaller than kk to its left and stops or it is the center of a pivot. However, both cases necessitate stops and therefore there must be smaller elements to the left of kk, and such elements never move to the right of kk. If kk stops during iteration tt where tt is large, there must be many elements which are smaller than kk to its left, or it must already be a left-to-right maximum. Thus, there exists some tt which depends on kk but not on σ\sigma such that kk cannot stop during iteration tt unless it is a left-to-right maximum.

Lemma 5 (pop-stop lemma).

Let σ\sigma be a permutation of length nn and let σt(i)\sigma_{t}(i) be in the interior of an increasing run. Then σt(i)\sigma_{t}(i) is either a left-to-right maximum of σt\sigma_{t} or there are at least t+12\left\lceil\frac{t+1}{2}\right\rceil elements smaller than σt(i)\sigma_{t}(i) to its left in σt\sigma_{t}. Similarly, σt(i)\sigma_{t}(i) is either a right-to-left-minimum of σt\sigma_{t} or there are at least t+12\left\lceil\frac{t+1}{2}\right\rceil elements larger than σt(i)\sigma_{t}(i) to its right in σt\sigma_{t}.

Proof.

We proceed by induction on tt, the number of iterations. If t=0t=0 or t=1t=1, t+12=1\left\lceil\frac{t+1}{2}\right\rceil=1, so the statement is true by virtue of σt(i)\sigma_{t}(i) being in the interior of an increasing run.

Suppose an element σt(i)\sigma_{t}(i) moves left during iteration tt. Observation 4 implies that σt(i)\sigma_{t}(i) moves left for kk consecutive iterations for some k1k\geq 1 (from iteration tk+1t-k+1 to iteration tt, inclusive) and σt(i)\sigma_{t}(i) either stops during iteration tkt-k or k=tk=t. Let kk^{*} be the number of positions that σt(i)\sigma_{t}(i) moved in the previous kk iterations, so k=|iσtk1(σt(i))|k^{*}=\lvert i-\sigma_{t-k}^{-1}(\sigma_{t}(i))\rvert. It must be the case that kkk^{*}\geq k.

If k=tk=t, then there are at least k>k+12=t+12k^{*}>\left\lceil\frac{k+1}{2}\right\rceil=\left\lceil\frac{t+1}{2}\right\rceil elements larger than σt(i)\sigma_{t}(i) to its right in σt\sigma_{t}.

If k<tk<t, then σt(i)\sigma_{t}(i) stops during iteration tkt-k and is in the interior of an increasing run in σtk1\sigma_{t-k-1}. By the induction hypothesis, σt(i)\sigma_{t}(i) is a right-to-left minimum in σtk1\sigma_{t-k-1} or there are (tk1)+12\left\lceil\frac{(t-k-1)+1}{2}\right\rceil elements larger than σt(i)\sigma_{t}(i) to its right in σtk1\sigma_{t-k-1}. If σt(i)\sigma_{t}(i) is a right-to-left minimum in σtk1\sigma_{t-k-1}, it is also a right-to-left minimum in σt\sigma_{t}. If there are (tk1)+12\left\lceil\frac{(t-k-1)+1}{2}\right\rceil elements larger than σt(i)\sigma_{t}(i) to its right in σtk+1\sigma_{t-k+1}, then there are at least

(tk1)+12+k=tk+2k2t+12\left\lceil\frac{(t-k-1)+1}{2}\right\rceil+k^{*}=\left\lceil\frac{t-k+2k^{*}}{2}\right\rceil\geq\left\lceil\frac{t+1}{2}\right\rceil

elements larger than σt(i)\sigma_{t}(i) to its right.

It follows that elements which move left in iteration tt are either right-to-left minima or have at least t+12\left\lceil\frac{t+1}{2}\right\rceil larger elements on their right in σt\sigma_{t}.

A symmetric argument shows that elements which move right are either left-to-right maxima or have at least t+12\left\lceil\frac{t+1}{2}\right\rceil smaller elements on their left in σt\sigma_{t}.

If an element σt(i)\sigma_{t}(i) stops during iteration tt, then it is in the interior of an increasing run in σt1\sigma_{t-1}. By the induction hypothesis, in both σt1\sigma_{t-1} and σt\sigma_{t}, σt(i)\sigma_{t}(i) is either a left-to-right maximum or there are t2\left\lceil\frac{t}{2}\right\rceil elements smaller than σt(i)\sigma_{t}(i) to its left, and it is either a right-to-left minimum or there are t2\left\lceil\frac{t}{2}\right\rceil elements larger than σt(i)\sigma_{t}(i) to its right.

Assume that the element σt(i)\sigma_{t}(i) is in the interior of an increasing run in σt\sigma_{t}. Now we proceed by cases.

  1. Case 1:

    The element σt(i)\sigma_{t}(i) is the center of a pivot during iteration tt.

    It is not possible for σt(i)\sigma_{t}(i) to be a left-to-right maximum or right-to-left minimum in σt1\sigma_{t-1} or σt2\sigma_{t-2}, since σt1(i1)>σt(i)>σt1(i+1)\sigma_{t-1}(i-1)>\sigma_{t}(i)>\sigma_{t-1}(i+1), so we only consider the number of elements.

    By Observation 3, σt(i)\sigma_{t}(i) stops during iteration t1t-1 and is in the interior of an increasing run in σt2\sigma_{t-2}. By the induction hypothesis, in σt2\sigma_{t-2}, there are at least t12\left\lceil\frac{t-1}{2}\right\rceil elements smaller than σt(i)\sigma_{t}(i) to its left. The pivot causes one element smaller than σt(i)\sigma_{t}(i) to move from the right of σt(i)\sigma_{t}(i) to its left, so that, in σt\sigma_{t}, there are at least t12+1=t+12\left\lceil\frac{t-1}{2}\right\rceil+1=\left\lceil\frac{t+1}{2}\right\rceil elements smaller than σt(i)\sigma_{t}(i) to its left. A symmetric argument shows that there are at least t+12\left\lceil\frac{t+1}{2}\right\rceil elements larger than σt(i)\sigma_{t}(i) to its right in σt\sigma_{t}.

  2. Case 2:

    The element σt(i)\sigma_{t}(i) moves right or left during iteration tt.

    Suppose σt(i)\sigma_{t}(i) moves left. Then it must either be a right-to-left minimum or have at least t+12\left\lceil\frac{t+1}{2}\right\rceil elements larger than σt(i)\sigma_{t}(i) on its right in σt\sigma_{t}. The element σt(i1)\sigma_{t}(i-1) either moves right during iteration tt, or it is in the interior of an increasing run in σt1\sigma_{t-1}. In either case, it is either a left-to-right maximum or there are at least t2\left\lceil\frac{t}{2}\right\rceil elements smaller than σt(i1)\sigma_{t}(i-1) on its left in σt\sigma_{t}. Thus, σt(i)\sigma_{t}(i) is either a left-to-right maximum or there are at least t2+1t+12\left\lceil\frac{t}{2}\right\rceil+1\geq\left\lceil\frac{t+1}{2}\right\rceil elements smaller than σt(i)\sigma_{t}(i) on its left in σt\sigma_{t}.

    A symmetric argument applies if σt(i)\sigma_{t}(i) moves right.

  3. Case 3:

    The element σt(i)\sigma_{t}(i) stops during iteration tt.

    Each neighbor of σt(i)\sigma_{t}(i) either moves towards σt(i)\sigma_{t}(i) during iteration tt or stops. By the same arguments as in Case 2, in σt\sigma_{t}, σt(i1)\sigma_{t}(i-1) is either a left-to-right maximum or there are at least t2\left\lceil\frac{t}{2}\right\rceil elements smaller than σt(i1)\sigma_{t}(i-1) on its left. Similarly, σt(i+1)\sigma_{t}(i+1) is either a right-to-left minimum or there are at least t2\left\lceil\frac{t}{2}\right\rceil elements larger than σt(i+1)\sigma_{t}(i+1) on its right in σt\sigma_{t}. Therefore, in σt\sigma_{t}, σt(i)\sigma_{t}(i) is either a left-to-right maximum or there are at least t+12\left\lceil\frac{t+1}{2}\right\rceil elements smaller than σt(i)\sigma_{t}(i) on its left and σt(i)\sigma_{t}(i) is either a right-to-left minimum or there are at least t+12\left\lceil\frac{t+1}{2}\right\rceil elements larger than σt(i)\sigma_{t}(i) on its right.

In order to be in the center of a pivot (after the initial iteration), an element must first stop. If an element is in position ii in σ2i4\sigma_{2i-4} and it is in the interior of an increasing run, the element has at least 2i4+12=i1\left\lceil\frac{2i-4+1}{2}\right\rceil=i-1 smaller elements to its left, so the pop-stop lemma guarantees that if it stops, then it is a left-to-right maximum. Since the center of a pivot has a larger element to its left, σ2i4(i)\sigma_{2i-4}(i) is not the center of a pivot, and neither are any other elements which are within i1i-1 positions from either end of σ2i4\sigma_{2i-4}.

The most an element can move in any iteration after the first is two positions by pivoting. Thus, for every two iterations, an element can move four positions, however, after those two iterations one more position at the end of the permutation cannot be the center of a pivot. Thus, we split the permutation into fifths; during roughly the first 25n\frac{2}{5}n iterations, an element can move about 45n\frac{4}{5}n positions, but in the following iterations 15n\frac{1}{5}n positions can not be centers of pivots. This can be leveraged to yield the following theorem.

Theorem 6.

Let σ\sigma be a permutation of length nn and let the element ni+1n-i+1 (the iith largest element) be in the kkth position after one iteration, that is, σ1(k)=ni+1\sigma_{1}(k)=n-i+1. Let tt^{*} be the least tt such that σt\sigma_{t} is the increasing permutation.

If i2i\geq 2, then

t2i3+2(nk5i+7)5+nk5i+75.t^{*}\geq 2i-3+\left\lfloor\frac{2(n-k-5i+7)}{5}\right\rfloor+\left\lceil\frac{n-k-5i+7}{5}\right\rceil.

If i=1i=1 (so that the element considered is nn), then

t2(nk)5+nk5+1.t^{*}\geq\left\lfloor\frac{2(n-k)}{5}\right\rfloor+\left\lceil\frac{n-k}{5}\right\rceil+1.
Proof.

If i2i\geq 2, for the first 2i42i-4 iterations, the pop-stop lemma implies that position ni+1n-i+1 and all positions to its right cannot contain the center of a pivot, which does not contribute to our argument. During those iterations, the element ni+1n-i+1 moves from position kk in σ1\sigma_{1} to the right at most two positions at a time for the next 2i32i-3 iterations, for a total of at most 4i64i-6 positions moved after iteration 2i42i-4. Thus, ni+1n-i+1 is in position at most k+4i6k+4i-6 in σ2i4\sigma_{2i-4}. From there, it needs to move through at least another ni+1(k+4i6)=nk5i+7n-i+1-(k+4i-6)=n-k-5i+7 elements to reach its final position. The element can pivot for a maximum of 2(nk5i+7)5\left\lfloor\frac{2(n-k-5i+7)}{5}\right\rfloor iterations and then must switch for at least nk5i+75\left\lceil\frac{n-k-5i+7}{5}\right\rceil iterations to finish, giving a total of at least 2i4+2(nk5i+7)5+nk5i+752i-4+\left\lfloor\frac{2(n-k-5i+7)}{5}\right\rfloor+\left\lceil\frac{n-k-5i+7}{5}\right\rceil iterations to sort the permutation. The proof for i=1i=1 is similar, but does not require the initial 2i42i-4 iterations. ∎

We note that this bound could be improved by a single iteration for some values of n,k,n,k, and ii if one were to consider the possibilities of the distance to travel after 2i42i-4 iterations mod 5, but such considerations give at most a change of one in the bound at the cost of a more complicated statement.

Lichev proved the following lemma ([15], Observation 1 and Observation 2).

Lemma 7.

In a uniformly randomly chosen permutation σ\sigma of length nn, there exists a.a.s.  an element ni+1n-i+1 such that after the first iteration |(ni+1)σ11(ni+1)|nn2/3+12log2(n).|(n-i+1)-\sigma_{1}^{-1}(n-i+1)|\geq n-n^{2/3}+1-2\log_{2}(n).

This lemma combined with Theorem 6 yields Theorem 1 almost immediately.

Proof of Theorem 1..

By Lemma 7, there exists a.a.s.  an element ni+1n-i+1, i<n2/3i<n^{2/3}, such that after the first iteration, ni+1n-i+1 is to the left of position k<n2/3+2log2nk<n^{2/3}+2\log_{2}n. Combining this with Theorem 6 yields a lower bound of (35o(1))n\left(\frac{3}{5}-o(1)\right)n iterations.

4. Future directions

We note that the bound of 25n\frac{2}{5}n is asymptotically the correct upper bound for the possible number of pivots to the right which any element can make. We present a family of permutations in which the element nn pivots 25n1\frac{2}{5}n-1 times and reaches the final position after 35n\frac{3}{5}n iterations.

Example 8.

Let n=5kn=5k, and let S1={1,2,,k}S_{1}=\{1,2,...,k\}, S2={k+1,,2k}S_{2}=\{k+1,...,2k\}, S3={2k+1,,4k}S_{3}=\{2k+1,...,4k\}, S4={4k+1,,5k}S_{4}=\{4k+1,...,5k\}. Construct a permutation σ\sigma as follows: take elements from S2,S3,S_{2},S_{3}, and S4S_{4} in the pattern S4,S3,S2,S3,S4,S3,,S2,S3S_{4},S_{3},S_{2},S_{3},S_{4},S_{3},\dots,S_{2},S_{3} in decreasing order. Once all of the elements from these sets have been exhausted, append each element of S1S_{1} in increasing order at the end. Explicitly, this is the permutation 5k,4k,2k,4k1,5k1,4k2,2k1,4k3,5k2,4k4,2k2,4k5,,k+1,2k+1,1,2,,k.5k,4k,2k,4k-1,5k-1,4k-2,2k-1,4k-3,5k-2,4k-4,2k-2,4k-5,...,k+1,2k+1,1,2,...,k. Figure 1 shows this construction for k=4k=4.

In this case, the permutation takes 45n\frac{4}{5}n iterations to be transformed into the identity; although nn is in the last position of σ35n\sigma_{\frac{3}{5}n}, there are other elements which are not in order in σ35n\sigma_{\frac{3}{5}n}.

We do not believe this bound is attainable for both the elements 11 and nn in the same permutation. The following construction gives a permutation where each of 11 and nn pivot roughly 38n\frac{3}{8}n times.

Example 9.

Let n=4k1n=4k-1, and let S1={1,2,,k}S_{1}=\{1,2,...,k\}, S2={k+1,,3k1}S_{2}=\{k+1,...,3k-1\}, and let S3={3k,,4k1}S_{3}=\{3k,...,4k-1\}. Consider the permutation which consists of elements taken in the pattern S3,S2,S1,S2,S3,S2,S1,S2,,S3,S2,S1,S_{3},S_{2},S_{1},S_{2},S_{3},S_{2},S_{1},S_{2},\dots,S_{3},S_{2},S_{1}, in decreasing order. Figure 2 shows this construction for k=4k=4.

The permutation takes roughly 34n\frac{3}{4}n iterations to be transformed into the identity permutation.

055101015152020055101015152020
Figure 1. A permutation using the construction in Example 8 with k=4k=4. The element 20 pivots 7=(25)2017=\left(\frac{2}{5}\right)20-1 times and reaches the final position after 12=(35)2012=\left(\frac{3}{5}\right)20 iterations. The permutation is sorted after 16 iterations, with the pair 4 and 5 and the pair 10 and 11 being the only elements which are out of order after 15 iterations.
0551010151505510101515
Figure 2. A permutation using the construction in Example 9 with k=4k=4. The elements 1 and 15 both pivot five times and reach their final positions after nine iterations. The permutation is sorted after ten iterations.

We believe that the pop-stop lemma can be used in future arguments to improve this lower bound in two ways.

First, for every two pivots in an “early” iteration which can be shown to be unlikely, the pop-stop lemma guarantees an “extra” pivot which is prevented later. For example, if it were possible to show that the average number of pivots in the first n/5n/5 iterations for the element which must travel the furthest was n/10n/10, the pop-stop lemma gives a corresponding n/20n/20 guaranteed switches at the end.

Second, our arguments in the proof of Theorem 6 use the pop-stop lemma to argue that there are no pivots near the left or right of σt\sigma_{t}. However, The lemma also implies that elements near the top or the bottom of σt\sigma_{t} cannot be the center of pivots. For example, in σ2i4\sigma_{2i-4}, if the element ii is in the interior of an increasing run, it has at least 2i32=i1\left\lceil\frac{2i-3}{2}\right\rceil=i-1 smaller elements to its left, so it cannot be the center of a pivot in σ2i3\sigma_{2i-3} and beyond, as a pivot requires that the element ii must stop in iteration tt and have an element smaller immediately to its right in σt\sigma_{t}. One can picture that the pop-stop lemma guarantees a square where no centers of pivots can occur that starts one element from the edge of the permutation (for the elements in the first and last positions and the elements 11 and nn can never be the center of a pivot) and closes in one element in each direction every two iterations (see Figure 3). As Example 8 shows, it is not impossible for elements to pivot every time in the first 25n1\frac{2}{5}n-1 iterations, but using these closing windows at the top and bottom might be one approach to show that it is rare in a uniformly randomly chosen permutation.

5. Acknowledgements

The authors are grateful to Colin Defant for introducing us to the problem and for some helpful suggestions and corrections. We are also grateful to Kelly Debure for lending us some time.

0202040406060808010010002020404060608080100100
0202040406060808010010002020404060608080100100
Figure 3. A permutation of length 100 after 10 sorts, with a box excluding the outermost 10+12+1=7\left\lceil\frac{10+1}{2}\right\rceil+1=7 elements in each cardinal direction, and then after 20 sorts, with a box excluding the outermost 20+12+1=12\left\lceil\frac{20+1}{2}\right\rceil+1=12 elements. The elements outside of the box are either left-to-right maxima, right-to-left minima, or they cannot stop until they become one of the two. Therefore no elements outside of the box will be the center of a pivot in any later iteration.

References

  • [1] M. Albert and V. Vatter. How many pop-stacks does it take to sort a permutation? The Computer Journal, 65(10):2610–2614, 2022.
  • [2] A. Asinowski, C. Banderier, S. Billey, B. Hackl, and S. Linusson. Pop-stack sorting and its image: permutations with overlapping runs. Acta Mathematica Universitatis Comenianae, 88(3):395–402, 2019.
  • [3] A. Asinowski, C. Banderier, and B. Hackl. Flip-sort and combinatorial aspects of pop-stack sorting. Discrete Mathematics & Theoretical Computer Science, 22(Special issues), 2021.
  • [4] D. Avis and M. Newborn. On pop-stacks in series. Utilitas Math, 19(129-140):410, 1981.
  • [5] Y. Choi and N. Sun. The image of the pop operator on various lattices. arXiv preprint arXiv:2209.13695, 2022.
  • [6] A. Claesson and B. Á. Guðmundsson. Enumerating permutations sortable by kk passes through a pop-stack. Advances in Applied Mathematics, 108:79–96, 2019.
  • [7] A. Claesson, B. Á. Guðmundsson, and J. Pantone. Counting pop-stacked permutations in polynomial time. Experimental Mathematics, 32(1):97–104, 2023.
  • [8] C. Defant. Enumeration of stack-sorting preimages via a decomposition lemma. Discrete Mathematics & Theoretical Computer Science, 22(Combinatorics), 2021.
  • [9] C. Defant. Fertility monotonicity and average complexity of the stack-sorting map. European Journal of Combinatorics, 93:103276, 2021.
  • [10] C. Defant. Meeting covered elements in ν\nu-Tamari lattices. Advances in Applied Mathematics, 134:102303, 2022.
  • [11] C. Defant. Pop-stack-sorting for Coxeter groups. Combinatorial Theory, 2 (3), 2022.
  • [12] C. Defant and N. Williams. Coxeter pop-tsack torsing. Algebraic Combinatorics, 5(3):559–581, 2022.
  • [13] L. Hong. The pop-stack-sorting operator on Tamari lattices. Advances in Applied Mathematics, 139:102362, 2022.
  • [14] D. Knuth. The Art of Computer Programming: Sorting and searching. Addison-Wesley series in computer science and information processing. Addison-Wesley Publishing Company, 1968.
  • [15] L. Lichev. Lower bound on the running time of pop-stack sorting on a random permutation. arXiv preprint arXiv:2212.09316, 2022.
  • [16] P. Ungar. 2n noncollinear points determine at least 2n directions. Journal of Combinatorial Theory, Series A, 33(3):343–347, 1982.