In mathematics and theoretical computer science, an automatic sequence (also called a k-automatic sequence or a k-recognizable sequence when one wants to indicate that the base of the numerals used is k) is an infinite sequence of terms characterized by a finite automaton. The n-th term of an automatic sequence a(n) is a mapping of the final state reached in a finite automaton accepting the digits of the number n in some fixed base k. [1] [2]
An automatic set is a set of non-negative integers S for which the sequence of values of its characteristic function χS is an automatic sequence; that is, S is k-automatic if χS(n) is k-automatic, where χS(n) = 1 if n S and 0 otherwise. [3] [4]
Automatic sequences may be defined in a number of ways, all of which are equivalent. Four common definitions are as follows.
Let k be a positive integer, and let D = (Q, Σk, δ, q0, Δ, τ) be a deterministic finite automaton with output, where
Extend the transition function δ from acting on single digits to acting on strings of digits by defining the action of δ on a string s consisting of digits s1s2...st as:
Define a function a from the set of positive integers to the output alphabet Δ as follows:
where s(n) is n written in base k. Then the sequence a = a(1)a(2)a(3)... is a k-automatic sequence. [1]
An automaton reading the base k digits of s(n) starting with the most significant digit is said to be direct reading, while an automaton starting with the least significant digit is reverse reading. [4] The above definition holds whether s(n) is direct or reverse reading. [5]
Let be a k-uniform morphism of a free monoid and let be a coding (that is, a -uniform morphism), as in the automata-theoretic case. If is a fixed point of —that is, if —then is a k-automatic sequence. [6] Conversely, every k-automatic sequence is obtainable in this way. [4] This result is due to Cobham, and it is referred to in the literature as Cobham's little theorem. [2] [7]
Let k ≥ 2. The k-kernel of the sequence s(n) is the set of subsequences
In most cases, the k-kernel of a sequence is infinite. However, if the k-kernel is finite, then the sequence s(n) is k-automatic, and the converse is also true. This is due to Eilenberg. [8] [9] [10]
It follows that a k-automatic sequence is necessarily a sequence on a finite alphabet.
Let u(n) be a sequence over an alphabet Σ and suppose that there is an injective function β from Σ to the finite field Fq, where q = pn for some prime p. The associated formal power series is
Then the sequence u is q-automatic if and only if this formal power series is algebraic over Fq(X). This result is due to Christol, and it is referred to in the literature as Christol's theorem. [11]
Automatic sequences were introduced by Büchi in 1960, [12] although his paper took a more logico-theoretic approach to the matter and did not use the terminology found in this article. The notion of automatic sequences was further studied by Cobham in 1972, who called these sequences "uniform tag sequences". [7]
The term "automatic sequence" first appeared in a paper of Deshouillers. [13]
The following sequences are automatic:
The Thue–Morse sequence t(n) ( OEIS: A010060 ) is the fixed point of the morphism 0 → 01, 1 → 10. Since the n-th term of the Thue–Morse sequence counts the number of ones modulo 2 in the base-2 representation of n, it is generated by the two-state deterministic finite automaton with output pictured here, where being in state q0 indicates there are an even number of ones in the representation of n and being in state q1 indicates there are an odd number of ones. Hence, the Thue–Morse sequence is 2-automatic.
The n-th term of the period-doubling sequence d(n) ( OEIS: A096268 ) is determined by the parity of the exponent of the highest power of 2 dividing n. It is also the fixed point of the morphism 0 → 01, 1 → 00. [14] Starting with the initial term w = 0 and iterating the 2-uniform morphism φ on w where φ(0) = 01 and φ(1) = 00, it is evident that the period-doubling sequence is the fixed-point of φ(w) and thus it is 2-automatic.
The n-th term of the Rudin–Shapiro sequence r(n) ( OEIS: A020985 ) is determined by the number of consecutive ones in the base-2 representation of n. The 2-kernel of the Rudin–Shapiro sequence [15] is
Since the 2-kernel consists only of r(n), r(2n + 1), r(4n + 3), and r(8n + 3), it is finite and thus the Rudin–Shapiro sequence is 2-automatic.
Both the Baum–Sweet sequence [16] ( OEIS: A086747 ) and the regular paperfolding sequence [17] [18] [19] ( OEIS: A014577 ) are automatic. In addition, the general paperfolding sequence with a periodic sequence of folds is also automatic. [20]
Automatic sequences exhibit a number of interesting properties. A non-exhaustive list of these properties is presented below.
Given a candidate sequence , it is usually easier to disprove its automaticity than to prove it. By the k-kernel characterization of k-automatic sequences, it suffices to produce infinitely many distinct elements in the k-kernel to show that is not k-automatic. Heuristically, one might try to prove automaticity by checking the agreement of terms in the k-kernel, but this can occasionally lead to wrong guesses. For example, let
be the Thue–Morse word. Let be the word given by concatenating successive terms in the sequence of run-lengths of . Then begins
It is known that is the fixed point of the morphism
The word is not 2-automatic, but certain elements of its 2-kernel agree for many terms. For example,
but not for . [30]
Given a sequence that is conjectured to be automatic, there are a few useful approaches to proving it actually is. One approach is to directly construct a deterministic automaton with output that gives the sequence. Let written in the alphabet , and let denote the base- expansion of . Then the sequence is -automatic if and only each of the fibres
is a regular language. [31] Checking regularity of the fibres can often be done using the pumping lemma for regular languages.
If denotes the sum of the digits in the base- expansion of and is a polynomial with non-negative integer coefficients, and if , are integers, then the sequence
is -automatic if and only if or . [32]
k-automatic sequences are normally only defined for k ≥ 2. [1] The concept can be extended to k = 1 by defining a 1-automatic sequence to be a sequence whose n-th term depends on the unary notation for n; that is, (1)n. Since a finite state automaton must eventually return to a previously visited state, all 1-automatic sequences are ultimately periodic.
Automatic sequences are robust against variations to either the definition or the input sequence. For instance, as noted in the automata-theoretic definition, a given sequence remains automatic under both direct and reverse reading of the input sequence. A sequence also remains automatic when an alternate set of digits is used or when the base is negated; that is, when the input sequence is represented in base −k instead of in base k. [33] However, in contrast to using an alternate set of digits, a change of base may affect the automaticity of a sequence.
The domain of an automatic sequence can be extended from the natural numbers to the integers via two-sided automatic sequences. This stems from the fact that, given k ≥ 2, every integer can be represented uniquely in the form where . Then a two-sided infinite sequence a(n)n is (−k)-automatic if and only if its subsequences a(n)n ≥ 0 and a(−n)n ≥ 0 are k-automatic. [34]
The alphabet of a k-automatic sequence can be extended from finite size to infinite size via k-regular sequences. [35] The k-regular sequences can be characterized as those sequences whose k-kernel is finitely-generated. Every bounded k-regular sequence is automatic. [36]
For many 2-automatic sequences , the map has the property that the first-order theory is decidable. Since many non-trivial properties of automatic sequences can be written in first-order logic, it is possible to prove these properties mechanically by executing the decision procedure. [37]
For example, the following properties of the Thue–Morse word can all be verified mechanically in this way:
The software Walnut, [40] [41] developed by Hamoon Mousavi, implements a decision procedure for deciding many properties of certain automatic words, such as the Thue–Morse word. This implementation is a consequence of the above work on the logical approach to automatic sequences.
In theoretical computer science and formal language theory, a regular language is a formal language that can be defined by a regular expression, in the strict sense in theoretical computer science.
In mathematics, the Thue–Morse or Prouhet–Thue–Morse sequence is the binary sequence that can be obtained by starting with 0 and successively appending the Boolean complement of the sequence obtained thus far. It is sometimes called the fair share sequence because of its applications to fair division or parity sequence. The first few steps of this procedure yield the strings 0, 01, 0110, 01101001, 0110100110010110, and so on, which are the prefixes of the Thue–Morse sequence. The full sequence begins:
In abstract algebra, the free monoid on a set is the monoid whose elements are all the finite sequences of zero or more elements from that set, with string concatenation as the monoid operation and with the unique sequence of zero elements, often called the empty string and denoted by ε or λ, as the identity element. The free monoid on a set A is usually denoted A∗. The free semigroup on A is the subsemigroup of A∗ containing all elements except the empty string. It is usually denoted A+.
In the theory of computation, a branch of theoretical computer science, a deterministic finite automaton (DFA)—also known as deterministic finite acceptor (DFA), deterministic finite-state machine (DFSM), or deterministic finite-state automaton (DFSA)—is a finite-state machine that accepts or rejects a given string of symbols, by running through a state sequence uniquely determined by the string. Deterministic refers to the uniqueness of the computation run. In search of the simplest models to capture finite-state machines, Warren McCulloch and Walter Pitts were among the first researchers to introduce a concept similar to finite automata in 1943.
In automata theory, a finite-state machine is called a deterministic finite automaton (DFA), if
In mathematics, a Sturmian word, named after Jacques Charles François Sturm, is a certain kind of infinitely long sequence of characters. Such a sequence can be generated by considering a game of English billiards on a square table. The struck ball will successively hit the vertical and horizontal edges labelled 0 and 1 generating a sequence of letters. This sequence is a Sturmian word.
A Fibonacci word is a specific sequence of binary digits. The Fibonacci word is formed by repeated concatenation in the same way that the Fibonacci numbers are formed by repeated addition.
In combinatorics, a square-free word is a word that does not contain any squares. A square is a word of the form XX, where X is not empty. Thus, a square-free word can also be defined as a word that avoids the pattern XX.
In mathematics the Baum–Sweet sequence is an infinite automatic sequence of 0s and 1s defined by the rule:
In mathematics, the Rudin–Shapiro sequence, also known as the Golay–Rudin–Shapiro sequence, is an infinite 2-automatic sequence named after Marcel Golay, Harold S. Shapiro, and Walter Rudin who investigated its properties.
Combinatorics on words is a fairly new field of mathematics, branching from combinatorics, which focuses on the study of words and formal languages. The subject looks at letters or symbols, and the sequences they form. Combinatorics on words affects various areas of mathematical study, including algebra and computer science. There have been a wide range of contributions to the field. Some of the first work was on square-free words by Axel Thue in the early 1900s. He and colleagues observed patterns within words and tried to explain them. As time went on, combinatorics on words became useful in the study of algorithms and coding. It led to developments in abstract algebra and answering open questions.
In mathematics, a locally catenative sequence is a sequence of words in which each word can be constructed as the concatenation of previous words in the sequence.
In computer science, the complexity function of a word or string is the function that counts the number of distinct factors of that string. More generally, the complexity function of a formal language counts the number of distinct words of given length.
In mathematics and computer science, a morphic word or substitutive word is an infinite sequence of symbols which is constructed from a particular class of endomorphism of a free monoid.
In mathematics and theoretical computer science, a pattern is an unavoidable pattern if it is unavoidable on any finite alphabet.
In mathematics, a recurrent word or sequence is an infinite word over a finite alphabet in which every factor occurs infinitely many times. An infinite word is recurrent if and only if it is a sesquipower.
In mathematics and computer science, the critical exponent of a finite or infinite sequence of symbols over a finite alphabet describes the largest number of times a contiguous subsequence can be repeated. For example, the critical exponent of "Mississippi" is 7/3, as it contains the string "ississi", which is of length 7 and period 3.
In mathematics and theoretical computer science, a k-regular sequence is a sequence satisfying linear recurrence equations that reflect the base-k representations of the integers. The class of k-regular sequences generalizes the class of k-automatic sequences to alphabets of infinite size.
In mathematics and theoretical computer science, a k-synchronized sequence is an infinite sequence of terms s(n) characterized by a finite automaton taking as input two strings m and n, each expressed in some fixed base k, and accepting if m = s(n). The class of k-synchronized sequences lies between the classes of k-automatic sequences and k-regular sequences.
Cobham's theorem is a theorem in combinatorics on words that has important connections with number theory, notably transcendental numbers, and automata theory. Informally, the theorem gives the condition for the members of a set S of natural numbers written in bases b1 and base b2 to be recognised by finite automata. Specifically, consider bases b1 and b2 such that they are not powers of the same integer. Cobham's theorem states that S written in bases b1 and b2 is recognised by finite automata if and only if S differs by a finite set from a finite union of arithmetic progressions. The theorem was proved by Alan Cobham in 1969 and has since given rise to many extensions and generalisations.