A058986 Sorting by prefix reversal (or "flipping pancakes"). You can only reverse segments that include the initial term of the current permutation; a(n) is the number of reversals that are needed to transform an arbitrary permutation of n letters to the identity permutation.
0, 1, 3, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 22
Offset: 1
Examples
For n = 3, the stack of pancakes with radii (1, 3, 2) requires a(3) = 3 flips to sort: Starting with (1, 3, 2), flip the top two pancakes to get (3, 1, 2), then flip the entire stack to get (2, 1, 3), then flip the top two pancakes again to get (1, 2, 3).
References
- J. J. Chew, III (jjchew(AT)math.utoronto.ca), personal communication, Jan 15 and Feb 08 2001, computed a(10) - a(13).
- E. Györi and G. Turán, Stack of pancakes, Studia Sci. Math. Hungar., 13 (1978), 133-137.
Links
- Kazuyuki Amano, (15/14)n Flips are (almost) Sufficient to Sort Heydari and Sudborough's Pancake Stack, IEICE Trans. Info. Sys. (2024). See p. 1.
- Shogo Asai, Yuusuke Kounoike, Yuji Shinano and Keiichi Kaneko, Computing the Diameter of 17-Pancake Graph Using a PC Cluster, Proc. Euro-Par 2006, LNCS 4128, pp. 1114-1124, 2006 Springer Verlag.
- Vineet Bafna and Pavel Pevzner, Genome rearrangements and sorting by reversals, SIAM Journal on Computing 25:272-289 (1996).
- Anne Bergeron, A very elementary presentation of the Hannenhalli-Pevzner theory, Discrete Applied Mathematics 146:134-145 (2005).
- Anne Bergeron, and Francois Strasbourg, Experiments in computing sequences of reversals, Proceedings of the First International Workshop on Algorithms in Bioinformatics, 2001, pp. 164-174. Berlin: Springer-Verlag.
- Laurent Bulteau, Guillaume Fertin, Irena Rusu, Pancake Flipping is Hard, arXiv:1111.0434 [cs.CC], Nov 10, 2011.
- Alberto Caprara, Sorting by reversals is difficult, Proceedings of RECOMB '97: The First International Conference on Computational Molecular Biology, 1997, pp. 75-83. New York: ACM Press.
- B. Chitturi, W. Fahle, Z. Meng, L. Morales, C. O. Shields, I. H. Sudborough and W. Voit, An (18/11)n upper bound for sorting by prefix reversals, Theoret. Comput. Sci. 410 (2009), no. 36, 3372-3390.
- J. Cibulka, On average and highest number of flips in pancake sorting, Theoret. Comput. Sci. 412 (2011), 822-834
- C. Dalfó and Miquel A. Fiol, Spectra and eigenspaces from regular partitions of Cayley (di)graphs of permutation groups, Linear Algebra Appl. 597 (2020), 94-112; arXiv:1906.05851 [math.CO].
- F. Javier de Vega, An extension of Furstenberg's theorem of the infinitude of primes, arXiv:2003.13378 [math.NT], 2020.
- Harry Dweighter ["Harried Waiter", pseudonym of Jacob E Goodman], Problem E2569, Amer. Math. Monthly, 82 (1975), 1010. Comments by M. R. Garey, D. S. Johnson and S. Lin, loc. cit. 84 (1977), 296.
- W. H. Gates and C. H. Padadimitriou, Bounds for sorting by prefix reversal, Discrete Math. 27 (1979), 47-57.
- Sridhar Hannenhalli and Pavel A. Pevzner, Transforming cabbage into turnip: polynomial algorithm for sorting signed permutations by reversals, Journal of the ACM 48:1-27 (1999).
- Brian Hayes, Computing Science: Sorting out the genome, Amer. Scientist, 95 (2007), 386-391.
- M. H. Heydari and I. Hal Sudborough, On the diameter of the pancake network,J. Algorithms 25 (1997) no 1, 67-94.
- J. D. Kececioglu, and D. Sankoff, Exact and approximation algorithms for sorting by reversals, with application to genome rearrangement, Algorithmica (1995) 13:180.
- Yuichi Komano and Takaaki Mizuki, Card-Based Zero-Knowledge Proof Protocol for Pancake Sorting, Int'l Conf. Info. Tech. Comm. Sec., Innov. Security Sol. Info. Tech. Comm. (SecITC 2022), Lecture Notes Comp. Sci. (LNCS Vol. 13809), Springer, Cham, pp. 222-239.
- Yuusuke Kounoike, Keiichi Kaneko and Yuji Shinano, Computing the Diameters of 14- and 15-pancake Graphs, Proc. International Symposium on Parallel Architectures, Algorithms and Networks(ISPAN 2005), pp. 490-495.
- Marc Lebrun et al., The PCC Games List, Section V1N5.
- Ed Pegg, Jr., Pancakes
- Ivars Peterson, Pancake Sorting.
- Ivars Peterson, Improved Pancake Sorting
- J. Sawada and A. Williams, Successor rules for flipping pancakes and burnt pancakes, Preprint 2015; Theoretical Computer Science, Volume 609, Part 1, Jan 04 2016, Pages 60-75.
- Simon Singh, Flipping pancakes with mathematics, Blog Posting, Nov 14 2013. [States that a(18)=20, a(19)=22]
- N. J. A. Sloane, My favorite integer sequences, in Sequences and their Applications (Proceedings of SETA '98).
- Katie Steckles and Brady Haran, Pancake Numbers, Numberphile video (2017).
- Eric Tannier, and Marie-France Sagot, Sorting by reversals in subquadratic time, Proceedings of the 15th Annual Symposium on Combinatorial Pattern Matching, 2004, pp. 1-13. Berlin: Springer-Verlag.
- Eric Weisstein's World of Mathematics, Pancake Sorting
- Douglas B. West, The Pancake Problems (1975, 1979, 1973)
- Index entries for sequences related to sorting
Formula
It is known that a(n) >= n+1 for n >= 6, a(n) >= (17/16)*n if n is a multiple of 16 (so a(32) >= 34) and a(n) <= (5*n+5)/3.
There is an improved asymptotic upper bound of (18/11)*n + O(1) for the number of prefix reversals to sort permutations of length n given in the Chitturi et al. paper. - Ivan Hal Sudborough (hal_sud(AT)yahoo.com), Jul 02 2008
Extensions
Typo in value for a(5) corrected by Ed Pegg Jr, Jan 02 2002
a(14)-a(17) from Ivan Hal Sudborough (hal_sud(AT)yahoo.com), Jul 02 2008. The new upper bounds for n = 14, 15, 16 and 17 are found in the articles by Asai et al. and Kounoike et al.
Simon Singh's blog gives values for a(18) and a(19). It is not clear if these have been proved to be correct. - N. J. A. Sloane, Dec 11 2013
Comments