Centre for Discrete Mathematics and Theoretical Computer Science Fast Generation of Fibonacci Permutations
- Publication date
- Publisher
Abstract
In 1985, Simion and Schmidt showed that |Sn(τ3)|, the cardinality of the set of all length n permutations avoiding the patterns τ3 = {123, 213, 132} is the Fibonacci numbers, fn+1. They also developed a constructive bijection between the set of all binary strings with no two consecutive ones and Sn(τ3). In May 2004, Egge and Mansour generalized this Simion-Schmidt counting result and showed that, Sn(τp), the set of permutations avoiding the patterns τp = {12...p, 213, 132} is counted by the (p − 1)-generalized Fibonacci numbers, f (p−1) n+1. The Simion-Schmidt’s set of binary strings is F (2) n−1, the well known Fibonacci strings, which is a special case of F (p) n, p-generalized Fibonacci strings having no p − 1 consecutive ones. In May 2001, Vajnovszki proposed a loopless algorithm for generating F (p) n, a Gray code for F (p) n. This algorithm has a constant worst case time while the Hamming distance between any two consecutive strings in F (p) n is one. In this paper we formalize and generalize the Simion-Schmidt bijection so that the new and Sn(τp), and we show that, Sn(τp), the image of the bijection now is between F (p−1) n−1 ordered list F (p) n through this generalized bijection is a list for all length n permutations avoiding the patterns τp = {12...p, 213, 132} with the Hamming distance between any two consecutive permutations bounded by (p−1), and so a Gray code for Sn(τp). We also propose a loopless algorithm, which is a modification of Vajnovszki’s algorithm, and which generates Sn(τp) also in constant worst case time. Keywords: Pattern(s) avoiding permutations, Fibonacci numbers, generalized Fibonacci strings, Gray codes, continuous discrete bijections.