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Σ​
corresponding to any shuffling method Σ since every such method is
associated with a set of permutations. Two variations of these devices are
considered - QΣ′​ and
QΣ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′​ is the set of the 321-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 n-permutations, pn​(QΣ′​), that one
can sort by using QΣ′​, for any shuffling method
Σ, such that the permutations associated with it are irreducible.
Next, we prove a generalization of the fact that
Qcutspop​ can sort all permutations. We also show
that pn​(QΣpop​) is given by the odd indexed
Fibonacci numbers F2n−1​, for any shuffling method Σ 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​ and
QMongepop​, corresponding to the popular
In-shuffle and Monge shuffling methods.Comment: 29 pages, 7 figure