19 research outputs found

    Methods of computing deque sortable permutations given complete and incomplete information

    Get PDF
    The problem of determining which permutations can be sorted using certain switchyard networks dates back to Knuth in 1968. In this work, we are interested in permutations which are sortable on a double-ended queue (called a deque), or on two parallel stacks. In 1982, Rosenstiehl and Tarjan presented an O(n) algorithm for testing whether a given permutation was sortable on parallel stacks. In the same paper, they also presented a modification giving O(n) test for sortability on a deque. We demonstrate a slight error in the version of their algorithm for testing deque sortability, and present a fix for this problem. The general enumeration problem for both of these classes of permutations remains unsolved. What is known is that the growth rate of both classes is approximately Theta(8^n), so computing the number of sortable permutations of length n, even for small values of n, is difficult to do using any method that must evaluate each sortable permutation individually. As far as we know, the number of deque sortable permutations was known only up to n=14. This was computed using algorithms which effectively generate all sortable permutations. By using the symmetries inherent in the execution of Tarjan's algorithm, we have developed a new dynamic programming algorithm which can count the number of sortable permutations in both classes in O(n^5 2^n) time, allowing the calculation of the number of deque and parallel stack sortable permutation for much higher values of n than was previously possible.Comment: dartmouth senior honors thesis advised by Peter Doyle and Scot Drysdale 45 pages, 9 figure

    Sorting by shuffling methods and a queue

    Full text link
    We consider sorting by a queue that can apply a permutation from a given set over its content. This gives us a sorting device QΣ\mathbb{Q}_{\Sigma} corresponding to any shuffling method Σ\Sigma since every such method is associated with a set of permutations. Two variations of these devices are considered - QΣ′\mathbb{Q}_{\Sigma}^{\prime} and QΣpop\mathbb{Q}_{\Sigma}^{\text{pop}}. These require the entire content of the device to be unloaded after a permutation is applied or unloaded by each pop operation, respectively. First, we show that sorting by a deque is equivalent to sorting by a queue that can reverse its content. Next, we focus on sorting by cuts. We prove that the set of permutations that one can sort by using Qcuts′\mathbb{Q}_{\text{cuts}}^{\prime} is the set of the 321321-avoiding separable permutations. We give lower and upper bounds to the maximum number of times the device must be used to sort a permutation. Furthermore, we give a formula for the number of nn-permutations, pn(QΣ′)p_{n}(\mathbb{Q}_{\Sigma}^{\prime}), that one can sort by using QΣ′\mathbb{Q}_{\Sigma}^{\prime}, for any shuffling method Σ\Sigma, such that the permutations associated with it are irreducible. Next, we prove a generalization of the fact that Qcutspop\mathbb{Q}_{\text{cuts}}^{\text{pop}} can sort all permutations. We also show that pn(QΣpop)p_{n}(\mathbb{Q}_{\Sigma}^{\text{pop}}) is given by the odd indexed Fibonacci numbers F2n−1F_{2n-1}, for any shuffling method Σ\Sigma having a specific back-front property. The rest of the work is dedicated to a surprising conjecture inspired by Diaconis and Graham which states that one can sort the same number of permutations of any given size by using the devices QIn-shpop\mathbb{Q}_{\text{In-sh}}^{\text{pop}} and QMongepop\mathbb{Q}_{\text{Monge}}^{\text{pop}}, corresponding to the popular In-shuffle and Monge shuffling methods.Comment: 29 pages, 7 figure

    2-stack pushall sortable permutations

    Full text link
    In the 60's, Knuth introduced stack-sorting and serial compositions of stacks. In particular, one significant question arise out of the work of Knuth: how to decide efficiently if a given permutation is sortable with 2 stacks in series? Whether this problem is polynomial or NP-complete is still unanswered yet. In this article we introduce 2-stack pushall permutations which form a subclass of 2-stack sortable permutations and show that these two classes are closely related. Moreover, we give an optimal O(n^2) algorithm to decide if a given permutation of size n is 2-stack pushall sortable and describe all its sortings. This result is a step to the solve the general 2-stack sorting problem in polynomial time.Comment: 41 page

    Sorting Pattern-Avoiding Permutations via 0-1 Matrices Forbidding Product Patterns

    Full text link
    We consider the problem of comparison-sorting an nn-permutation SS that avoids some kk-permutation π\pi. Chalermsook, Goswami, Kozma, Mehlhorn, and Saranurak prove that when SS is sorted by inserting the elements into the GreedyFuture binary search tree, the running time is linear in the extremal function Ex(Pπ⊗hat,n)\mathrm{Ex}(P_\pi\otimes \text{hat},n). This is the maximum number of 1s in an n×nn\times n 0-1 matrix avoiding Pπ⊗hatP_\pi \otimes \text{hat}, where PπP_\pi is the k×kk\times k permutation matrix of π\pi, ⊗\otimes the Kronecker product, and hat=(∙∙∙)\text{hat} = \left(\begin{array}{ccc}&\bullet&\\\bullet&&\bullet\end{array}\right). The same time bound can be achieved by sorting SS with Kozma and Saranurak's SmoothHeap. In this paper we give nearly tight upper and lower bounds on the density of Pπ⊗hatP_\pi\otimes\text{hat}-free matrices in terms of the inverse-Ackermann function α(n)\alpha(n). \mathrm{Ex}(P_\pi\otimes \text{hat},n) = \left\{\begin{array}{ll} \Omega(n\cdot 2^{\alpha(n)}), & \mbox{for most $\pi$,}\\ O(n\cdot 2^{O(k^2)+(1+o(1))\alpha(n)}), & \mbox{for all $\pi$.} \end{array}\right. As a consequence, sorting π\pi-free sequences can be performed in O(n2(1+o(1))α(n))O(n2^{(1+o(1))\alpha(n)}) time. For many corollaries of the dynamic optimality conjecture, the best analysis uses forbidden 0-1 matrix theory. Our analysis may be useful in analyzing other classes of access sequences on binary search trees

    Permutation classes

    Full text link
    This is a survey on permutation classes for the upcoming book Handbook of Enumerative Combinatorics
    corecore