The Frobenius Problem in a Free Monoid
Total Page:16
File Type:pdf, Size:1020Kb
The Frobenius Problem in a Free Monoid by Zhi Xu A thesis presented to the University of Waterloo in ful¯llment of the thesis requirement for the degree of Doctor of Philosophy in Computer Science Waterloo, Ontario, Canada, 2009 °c Zhi Xu 2009 I hereby declare that I am the sole author of this thesis. This is a true copy of the thesis, including any required ¯nal revisions, as accepted by my examiners. I understand that my thesis may be made electronically available to the public. ii Abstract Given positive integers c1; c2; : : : ; ck with gcd(c1; c2; : : : ; ck) = 1, the Frobenius prob- lem (FP) is to compute the largest integer g(c1; c2; : : : ; ck) that cannot be written as a non-negative integer linear combination of c1; c2; : : : ; ck. The Frobenius prob- lem in a free monoid (FPFM) is a non-commutative generalization of the Frobe- nius problem. Given words x1; x2; : : : ; xk such that there are only ¯nitely many words that cannot be written as concatenations of words in f x1; x2; : : : ; xk g, the FPFM is to ¯nd the longest such words. Unlike the FP, where the upper bound 2 g(c1; c2; : : : ; ck) · max1·i·k ci is quadratic, the upper bound on the length of the longest words in the FPFM can be exponential in certain measures and some of the exponential upper bounds are tight. For the 2FPFM, where the given words over § are of only two distinct lengths m and n with 1 < m < n, the length of the longest omitted words is · g(m; m j§jn¡m + n ¡ m). In Chapter 1, I give the de¯nition of the FP in integers and summarize some of the interesting properties of the FP. In Chapter 2, I give the de¯nition of the FPFM and discuss some general properties of the FPFM. Then I mainly focus on the 2FPFM. I discuss the 2FPFM from di®erent points of view and present two equivalent problems, one of which is about combinatorics on words and the other is about the word graph. In Chapter 3, I discuss some variations on the FPFM and related problems, including input in other forms, bases with constant size, the case of in¯nite words, the case of concatenation with overlap, and the generalization of the local postage-stamp problem in a free monoid. In Chapter 4, I present the construction of some essential examples to complement the theory of the 2FPFM discussed in Chapter 2. The theory and examples of the 2FPFM are the main contribution of the thesis. In Chapter 5, I discuss the algorithms for and computational complexity of the FPFM and related problems. In the last chapter, I summarize the main results and list some open problems. Part of my work in the thesis has appeared in the papers [83, 84, 157]. iii Acknowledgements First, I wish to thank my supervisor Je®rey O. Shallit, who is a great scholar, a nice friend of mine, and a good teacher who introduced to me the non-commutative Frobenius problem that ¯nally became the topic of this thesis. I owe him a great deal for his valuable suggestions in our regular discussions and for his patience in reading my poorly-written manuscripts and in improving my presentation skills. I cannot ¯nd enough words to express my gratitude for his help in all aspects in my PhD life. I also wish to thank my temporary supervisor professor Richard Trefler and all my friends in the WatForm group for their kindness that made my ¯rst year in Waterloo an enjoyable memory. I wish to thank professor Janusz Brzozowski, professor Jonathan Buss, professor Ond·rejLhot¶ak,professor Ming Li, all my friends in the Algorithm and Complexity group, and all the people who have ever helped me during my stay at University of Waterloo. Without their favors, my progress in the PhD program could not have proceeded so smoothly. I wish to thank Dr. Narad Rampersad for reading my thesis thoroughly and providing helpful comments. I wish to thank the members of my examining committee, professor Richard Cleve, professor Ming Li, professor Kai Salomaa, and professor Edlyn Teske for their precious time in reviewing my thesis, providing comments, and attending my defense. I particularly want to thank my parents and my sister for their endless love and selfless support. Without that, I could not have gone so far in my career. The research in the thesis was partly supported by David R. Cheriton Graduate Scholarships, the International Doctoral Student Award from University of Water- loo, and ¯nancial support from the David R. Cheriton School of Computer Science at the University of Waterloo. iv Dedication 献给我的父亲母亲 (To my parents) v Contents List of Tables ix List of Figures x 1 Introduction 1 1.1 Introduction to the Frobenius problem . 1 1.1.1 Number theory preliminaries . 1 1.1.2 Integer Frobenius problem . 2 1.2 Research on the FP . 5 1.2.1 Formulae for the Frobenius number . 5 1.2.2 Bounds on the Frobenius number . 9 1.2.3 Variations on the FP . 11 1.2.4 The FP in special sequential bases . 16 1.2.5 Algorithm for and computational complexity of the FP . 18 1.3 Applications and related problems of the FP . 19 1.3.1 Sylver coinage . 19 1.3.2 Quadratic residues . 20 1.3.3 Local postage-stamp problem . 20 1.3.4 (g0; g1; : : : ; gk)-tree . 21 1.3.5 Shellsort algorithm . 21 1.3.6 Tiling problem . 22 1.4 Shallit's non-commutative generalization . 24 1.4.1 Generalizations of the FP . 24 1.4.2 Free monoids and the FP . 25 1.5 Organization of the thesis . 28 vi 2 General theory of the FPFM 29 2.1 The Frobenius problem in a free monoid . 29 2.1.1 De¯nition of the FPFM . 29 2.1.2 Relations of the FPFM and the Frobenius number . 32 2.1.3 Twins proposition in the FPFM . 35 2.2 Various measures for the FPFM . 35 2.2.1 Measures of the input . 36 2.2.2 Measures of the output . 37 2.2.3 Constraints on the problem . 37 2.3 Bounds on the longest omitted words . 38 2.4 The FPFM for two lengths | the 2FPFM . 41 2.4.1 De¯nition of the 2FPFM . 42 2.4.2 The First and Second Lemmas of the 2FPFM . 42 2.4.3 Bounds on the longest omitted words for the 2FPFM . 48 2.5 Combinatorics on words in the 2FPFM . 49 2.5.1 Boosting the length of omitted words . 49 2.5.2 The structure of omitted words . 51 2.5.3 An equivalent condition on co-¯niteness . 53 2.6 The de Bruijn graph in the 2FPFM . 57 2.6.1 Word graphs of the 2FPFM . 57 2.6.2 Another equivalent condition on co-¯niteness . 60 2.6.3 The de Bruijn graph and a generalization . 62 2.6.4 Spectrum theorem for the 2FPFM . 67 2.6.5 Bounds on the size of the basis in the 2FPFM . 70 2.7 The FPFM with basis of special sequential lengths . 72 3 Variations on the FPFM and related problems 77 3.1 Concatenation of words with ¯xed order . 78 3.2 Variations with di®erent measures . 78 3.2.1 State complexity of the generated language . 78 3.2.2 Input in other forms . 85 3.2.3 Output in other forms . 89 3.3 Variations with di®erent aspects . 90 vii 3.3.1 Number of words and number of symbols . 90 3.3.2 Coverage of words as solutions . 93 3.3.3 The number of di®erent factorizations . 95 3.4 General form of the Frobenius problem of words . 97 3.4.1 In¯nite words . 97 3.4.2 Concatenation with overlap . 104 3.4.3 Other variations . 113 3.5 Generalized local postage-stamp problem . 115 4 Examples of the FPFM 121 4.1 Exponential length of the longest words 62 S¤ . 121 4.1.1 Examples of the 2FPFM with 0 < m < n < 2m . 121 4.1.2 Examples of the 2FPFM with 0 < 2m < n . 130 4.2 Doubly-exponential number of words 62 S¤ . 133 4.3 Experiment statistics . 136 5 Computational Complexity of the FPFM 139 5.1 Algorithm for the FPFM . 139 5.2 Algorithm for the 2FPFM . 140 5.3 Algorithm for the case of in¯nite words . 142 5.4 Algorithm for the case of concatenation with overlap . 143 5.5 Computational Complexity . 144 6 Conclusion 149 6.1 Summary of results on the FPFM and variations . 149 6.2 Open problems . 151 References 154 Index 165 viii List of Tables 1.1 An integer Frobenius problem example | g(3; 5) = 7 . 4 1.2 Relation between quadratic residues of 3; 5 and x 2 N n h3; 5i . 20 1.3 Comparison of the original FP and the FPFM . 27 2.1 Characteristics of the FPFM with bases S1, S2, and S3 . 34 2.2 Measures of a list of words x1; x2; : : : ; xk as the input . 36 2.3 Measures of the longest omitted words and other characteristics . 37 2.4 Conditions to be satis¯ed and additional constraints . 38 2.5 The length of longest words and the size of computing models . 39 2.6 All the words in f 0; 1 g¤ n (f 0; 1 g3 [ f 0; 1 g5 n f 00001 g)¤ . 43 2.7 Di®erent types of walks in a digraph .