automata and nested recurrences
play

Automata and nested recurrences Jeffrey Shallit School of Computer - PowerPoint PPT Presentation

Automata and nested recurrences Jeffrey Shallit School of Computer Science University of Waterloo Waterloo, Ontario N2L 3G1 Canada shallit@cs.uwaterloo.ca http://www.cs.uwaterloo.ca/~shallit Joint work with Jean-Paul Allouche. 1 / 22


  1. Automata and nested recurrences Jeffrey Shallit School of Computer Science University of Waterloo Waterloo, Ontario N2L 3G1 Canada shallit@cs.uwaterloo.ca http://www.cs.uwaterloo.ca/~shallit Joint work with Jean-Paul Allouche. 1 / 22

  2. Hofstadter’s recurrence Douglas Hofstadter, G¨ odel, Escher, Bach , 1979: Q ( n ) = Q ( n − Q ( n − 1)) + Q ( n − Q ( n − 2)) for n ≥ 2 and Q (1) = Q (2) = 1. 2 / 22

  3. 1st differences of Hofstadter’s Q-sequence Larger and larger hedgehogs 3 / 22

  4. Hofstadter and Huber Hofstadter and Huber (1999): Q r , s ( n ) = Q r , s ( n − Q r , s ( n − r )) + Q r , s ( n − Q r , s ( n − s )) for n > s > r . Balamohan, Kuznetsov and Tanny (2007): a nearly complete analysis of the sequence Q 1 , 4 (called V in their paper). It is defined by V (1) = V (2) = V (3) = V (4) = 1 , and ∀ n > 4 , V ( n ) := V ( n − V ( n − 1)) + V ( n − V ( n − 4)) . 4 / 22

  5. The V-sequence n 1 2 3 4 5 6 7 8 9 10 11 12 13 14 V ( n ) 1 1 1 1 2 3 4 5 5 6 6 7 8 8 5 / 22

  6. The V -sequence ◮ is monotone increasing ◮ successive terms differ by 0 or 1 ◮ no number appears more than four times (and only 1 appears that many) ◮ grows approximately like n / 2 V ( n ) − n / 2 6 / 22

  7. Frequency sequence n 1 2 3 4 5 6 7 8 9 10 11 12 13 14 V ( n ) 1 1 1 1 2 3 4 5 5 6 6 7 8 8 Balamohan, Kuznetsov, and Tanny (2007): a precise description of the “frequency” sequence F ( n ) defined by F ( a ) := # { n : V ( n ) = a } . n 1 2 3 4 5 6 7 8 9 10 11 12 13 14 F ( n ) 4 1 1 1 2 2 1 2 2 1 3 2 1 2 7 / 22

  8. Explicit description Theorem (Balamohan, Kuznetsov, Tanny) There exist two (explicit) maps g , h, with g , h : { 1 , 2 , 3 } 4 → { 1 , 2 , 3 } , such that, for all a > 3 F (2 a ) = g ( F ( a − 2) , F ( a − 1) , F ( a ) , F ( a + 1)) F (2 a + 1) = h ( F ( a − 2) , F ( a − 1) , F ( a ) , F ( a + 1)) . 8 / 22

  9. Corollary of our main result Theorem. (Allouche & JOS, 2012) The sequence ( F ( n )) n ≥ 1 is 2-automatic. ◮ This means that F ( n ) can be computed “in a simple way” from the base-2 representation of n . ◮ In particular, it can be computed in O (log n ) time. ◮ Furthermore, we can compute the automaton explicitly. 9 / 22

  10. What is an automatic sequence? ◮ An infinite sequence a = a 0 a 1 a 2 · · · over a finite alphabet of letters, generated by a finite-state machine (automaton) ◮ The automaton, given n as input, computes a n as follows: ◮ n is represented in some fixed integer base k ≥ 2 ◮ The automaton moves from state to state according to this input ◮ Each state has an output letter associated with it ◮ The output on input n is the output associated with the last state reached 10 / 22

  11. The canonical example: the Thue-Morse automaton 0 0 1 0 1 1 This automaton generates the Thue-Morse sequence t = ( t n ) n ≥ 0 = 0110100110010110 · · · . 11 / 22

  12. Why automatic sequences? ◮ A nontrivial class of self-similar sequences ◮ Many “naturally-occurring” sequences are automatic ◮ Halfway between periodic and chaotic ◮ Provide canonical examples for various kinds of avoidance problems ◮ Statistics like the limiting frequency of occurrence of any letter are easy to compute 12 / 22

  13. The main result Theorem. If a sequence F satisfies a recurrence “like” F (2 a ) = g ( F ( a − 2) , F ( a − 1) , F ( a ) , F ( a + 1)) F (2 a + 1) = h ( F ( a − 2) , F ( a − 1) , F ( a ) , F ( a + 1)) . then F is 2-automatic. Proof idea. Find a finite class of sequences of which F is a member, and which is closed under the transformations n → 2 n ; n → 2 n + 1 . The proof is explicit, but the automaton it constructs in our case is too large to deal with. 13 / 22

  14. Constructing the automaton We constructed the automaton by “guessing” it and checking it. The states are named by binary strings. We guess that x and y correspond to the same state if F ([ xz ]) and F ([ yz ]) are the same for all the z we can reasonably test (say | z | ≤ 20). Actually, this is not quite good enough; we actually deal with the 4-tuple ( F ([ x ] − 2) , F ([ x ] − 1) , F ([ x ]) , F ([ x ] + 1)) . This gives us a 33-state automaton that we can now verify by a very tedious induction on | x | , using the recurrence we know. Now, throwing away all but the 3rd of 4 outputs for each state, we get a smaller automaton by minimization. 14 / 22

  15. A conjecture Conjecture. V ′ , the first difference sequence of V ( n ), is also 2-automatic. For example, up to the limit we have checked (tens of thousands of terms) V ′ ([10110 x ]) V ′ ([10001 x ]) = V ′ ([11000 x ]) V ′ ([10011 x ]) = V ′ ([100011 x ]) V ′ ([11110 x ]) = V ′ ([101010 x ]) V ′ ([100000 x ]) = V ′ ([101011 x ]) V ′ ([100001 x ]) = V ′ ([101110 x ]) V ′ ([100100 x ]) = V ′ ([101111 x ]) V ′ ([100101 x ]) = However, if it is 2-automatic, then the smallest automaton (msd first) has at least 900 states. 15 / 22

  16. Morphic sequences: a generalization of automatic sequences A morphism is a map h from a finite alphabet Σ ∗ → ∆ ∗ satisfying h ( xy ) = h ( x ) h ( y ) for all strings x , y . If Σ = ∆ we can iterate h . If h ( a ) = ax for a letter a then h ω ( a ) = a x h ( x ) h 2 ( x ) . . . . Note that h ω ( a ) is a fixed point of h . If a sequence arises by applying a coding (a renaming of the letters) to h ω ( a ) then it is called morphic . 16 / 22

  17. Slow sequences Recently Allouche has proposed studying “slow” sequences, that is, sequences of natural numbers where the first differences are either 0 or 1. Theorem. Let x = ( x n ) n ≥ 1 be a slow sequence. Then the corresponding frequency sequence F ( x ) is bounded and morphic iff the the first difference sequence ∆ x is morphic and 1’s appear there with bounded gaps. Corollary The first difference sequence of V is morphic. 17 / 22

  18. Proof of the theorem i − 1 � �� � Proof. Apply the morphism that sends i to 1 0 0 · · · 0 to the frequency sequence. Example: original sequence x is 1 1 1 1 2 3 4 5 5 6 6 78 8 9 9 10 11 11 11 · · · Frequency sequence is 41112212213 · · · Apply morphism to that to get 10001111010110101100 · · · , which, except for the first term, is ∆ x . 18 / 22

  19. Proof of the other direction For the other direction, apply a finite-state transducer that measures the distance between consecutive 1’s: Example: if the first difference sequence is (1)00011110101101011001 · · · , then the transducer outputs 41112212213 · · · . However, these implications need not hold for k -automatic sequences... 19 / 22

  20. Example 1 Suppose the frequency sequence F ( x ) = ( f ( n )) n ≥ 1 is given by � 2 , if n is one less than a power of 2; f ( n ) = 1 , otherwise. So ( f ( n )) n ≥ 1 is 21211121111111211111111111111121 · · · Then x is 1 1 2 3 3 4 5 6 7 7 8 9 10 11 12 13 14 15 15 16 17 · · · and the first difference of this is 01101111011111111011111111111111 · · · with 0’s in positions 1 4 9 18 35 68 · · · and generally in positions 2 n + n − 2. This is not 2-automatic. 20 / 22

  21. Example 2 On the other hand if we define the first difference sequence by � 0 , if n is a power of 2; g ( n ) = 1 , otherwise. Then ( g ( n )) n ≥ 1 is automatic and equals 00101110111111101111 · · · so the original sequence is 1 1 1 2 2 3 4 5 5 6 7 8 9 10 11 12 12 13 14 15 16 17 18 19 · · · and the corresponding frequency sequence is 321121111112111111111111112 · · · with 2’s in positions 2 5 12 27 58 · · · and in general 2 n − n , so this is not automatic either. 21 / 22

  22. For further reading 1. J.-P. Allouche and J. Shallit, A variant of Hofstadter’s sequence and finite automata, J. Aust. Math. Soc. 93 (2012), 1–8. 2. B. Balamohan, A. Kuznetsov, and S. Tanny, On the behavior of a variant of Hofstadter’s Q -sequence, J. Integer Seq. 10 (2007) Article 07.7.1. 3. K. Pinn, Order and chaos in Hofstadter’s Q ( n ) sequence, Complexity 4 (1999), 41–46. 22 / 22

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend