k-regular sequence

From HandWiki
Short description: Mathematical sequence


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.

Definition

There exist several characterizations of k-regular sequences, all of which are equivalent. Some common characterizations are as follows. For each, we take R′ to be a commutative Noetherian ring and we take R to be a ring containing R′.

k-kernel

Let k ≥ 2. The k-kernel of the sequence [math]\displaystyle{ s(n)_{n \geq 0} }[/math] is the set of subsequences

[math]\displaystyle{ K_{k}(s) = \{s(k^e n + r)_{n \geq 0} : e \geq 0 \text{ and } 0 \leq r \leq k^e - 1\}. }[/math]

The sequence [math]\displaystyle{ s(n)_{n \geq 0} }[/math] is (R′, k)-regular (often shortened to just "k-regular") if the [math]\displaystyle{ R' }[/math]-module generated by Kk(s) is a finitely-generated R′-module.[1]

In the special case when [math]\displaystyle{ R' = R = \mathbb{Q} }[/math], the sequence [math]\displaystyle{ s(n)_{n \geq 0} }[/math] is [math]\displaystyle{ k }[/math]-regular if [math]\displaystyle{ K_k(s) }[/math] is contained in a finite-dimensional vector space over [math]\displaystyle{ \mathbb{Q} }[/math].

Linear combinations

A sequence s(n) is k-regular if there exists an integer E such that, for all ej > E and 0 ≤ rjkej − 1, every subsequence of s of the form s(kejn + rj) is expressible as an R′-linear combination [math]\displaystyle{ \sum_{i} c_{ij} s(k^{f_{ij}}n + b_{ij}) }[/math], where cij is an integer, fijE, and 0 ≤ bijkfij − 1.[2]

Alternatively, a sequence s(n) is k-regular if there exist an integer r and subsequences s1(n), ..., sr(n) such that, for all 1 ≤ ir and 0 ≤ ak − 1, every sequence si(kn + a) in the k-kernel Kk(s) is an R′-linear combination of the subsequences si(n).[2]

Formal series

Let x0, ..., xk − 1 be a set of k non-commuting variables and let τ be a map sending some natural number n to the string xa0 ... xae − 1, where the base-k representation of x is the string ae − 1...a0. Then a sequence s(n) is k-regular if and only if the formal series [math]\displaystyle{ \sum_{n \geq 0} s(n) \tau (n) }[/math] is [math]\displaystyle{ \mathbb{Z} }[/math]-rational.[3]

Automata-theoretic

The formal series definition of a k-regular sequence leads to an automaton characterization similar to Schützenberger's matrix machine.[4][5]

History

The notion of k-regular sequences was first investigated in a pair of papers by Allouche and Shallit.[6] Prior to this, Berstel and Reutenauer studied the theory of rational series, which is closely related to k-regular sequences.[7]

Examples

Ruler sequence

Let [math]\displaystyle{ s(n) = \nu_2(n+1) }[/math] be the [math]\displaystyle{ 2 }[/math]-adic valuation of [math]\displaystyle{ n+1 }[/math]. The ruler sequence [math]\displaystyle{ s(n)_{n \geq 0} = 0, 1, 0, 2, 0, 1, 0, 3, \dots }[/math] (OEISA007814) is [math]\displaystyle{ 2 }[/math]-regular, and the [math]\displaystyle{ 2 }[/math]-kernel

[math]\displaystyle{ \{s(2^e n + r)_{n \geq 0} : e \geq 0 \text{ and } 0 \leq r \leq 2^e - 1\} }[/math]

is contained in the two-dimensional vector space generated by [math]\displaystyle{ s(n)_{n \geq 0} }[/math] and the constant sequence [math]\displaystyle{ 1, 1, 1, \dots }[/math]. These basis elements lead to the recurrence relations

[math]\displaystyle{ \begin{align} s(2 n) &= 0, \\ s(4 n + 1) &= s(2 n + 1) - s(n), \\ s(4 n + 3) &= 2 s(2 n + 1) - s(n), \end{align} }[/math]

which, along with the initial conditions [math]\displaystyle{ s(0) = 0 }[/math] and [math]\displaystyle{ s(1) = 1 }[/math], uniquely determine the sequence.[8]

Thue–Morse sequence

The Thue–Morse sequence t(n) (OEISA010060) is the fixed point of the morphism 0 → 01, 1 → 10. It is known that the Thue–Morse sequence is 2-automatic. Thus, it is also 2-regular, and its 2-kernel

[math]\displaystyle{ \{t(2^e n + r)_{n \geq 0} : e \geq 0 \text{ and } 0 \leq r \leq 2^e - 1\} }[/math]

consists of the subsequences [math]\displaystyle{ t(n)_{n \geq 0} }[/math] and [math]\displaystyle{ t(2 n + 1)_{n \geq 0} }[/math].

Cantor numbers

The sequence of Cantor numbers c(n) (OEISA005823) consists of numbers whose ternary expansions contain no 1s. It is straightforward to show that

[math]\displaystyle{ \begin{align} c(2n) &= 3c(n), \\ c(2n+1) &= 3c(n) + 2, \end{align} }[/math]

and therefore the sequence of Cantor numbers is 2-regular. Similarly the Stanley sequence

0, 1, 3, 4, 9, 10, 12, 13, 27, 28, 30, 31, 36, 37, 39, 40, ... (sequence A005836 in the OEIS)

of numbers whose ternary expansions contain no 2s is also 2-regular.[9]

Sorting numbers

A somewhat interesting application of the notion of k-regularity to the broader study of algorithms is found in the analysis of the merge sort algorithm. Given a list of n values, the number of comparisons made by the merge sort algorithm are the sorting numbers, governed by the recurrence relation

[math]\displaystyle{ \begin{align} T(1) &= 0, \\ T(n) &= T(\lfloor n / 2 \rfloor) + T(\lceil n / 2 \rceil) + n - 1, \ n \geq 2. \end{align} }[/math]

As a result, the sequence defined by the recurrence relation for merge sort, T(n), constitutes a 2-regular sequence.[10]

Other sequences

If [math]\displaystyle{ f(x) }[/math] is an integer-valued polynomial, then [math]\displaystyle{ f(n)_{n \geq 0} }[/math] is k-regular for every [math]\displaystyle{ k \geq 2 }[/math].

The Glaisher–Gould sequence is 2-regular. The Stern–Brocot sequence is 2-regular.

Allouche and Shallit give a number of additional examples of k-regular sequences in their papers.[6]

Properties

k-regular sequences exhibit a number of interesting properties.

  • Every k-automatic sequence is k-regular.[11]
  • Every k-synchronized sequence is k-regular.
  • A k-regular sequence takes on finitely many values if and only if it is k-automatic.[12] This is an immediate consequence of the class of k-regular sequences being a generalization of the class of k-automatic sequences.
  • The class of k-regular sequences is closed under termwise addition, termwise multiplication, and convolution. The class of k-regular sequences is also closed under scaling each term of the sequence by an integer λ.[12][13][14][15] In particular, the set of k-regular power series forms a ring.[16]
  • If [math]\displaystyle{ s(n)_{n \ge 0} }[/math] is k-regular, then for all integers [math]\displaystyle{ m \ge 1 }[/math], [math]\displaystyle{ (s(n) \bmod{m})_{n \ge 0} }[/math] is k-automatic. However, the converse does not hold.[17]
  • For multiplicatively independent kl ≥ 2, if a sequence is both k-regular and l-regular, then the sequence satisfies a linear recurrence.[18] This is a generalization of a result due to Cobham regarding sequences that are both k-automatic and l-automatic.[19]
  • The nth term of a k-regular sequence of integers grows at most polynomially in n.[20]
  • If [math]\displaystyle{ F }[/math] is a field and [math]\displaystyle{ x \in F }[/math], then the sequence of powers [math]\displaystyle{ (x^n)_{n \ge 0} }[/math] is k-regular if and only if [math]\displaystyle{ x = 0 }[/math] or [math]\displaystyle{ x }[/math] is a root of unity.[21]

Proving and disproving k-regularity

Given a candidate sequence [math]\displaystyle{ s = s(n)_{n \ge 0} }[/math] that is not known to be k-regular, k-regularity can typically be proved directly from the definition by calculating elements of the kernel of [math]\displaystyle{ s }[/math] and proving that all elements of the form [math]\displaystyle{ (s(k^r n + e))_{n \ge 0} }[/math] with [math]\displaystyle{ r }[/math] sufficiently large and [math]\displaystyle{ 0 \le e \lt 2^r }[/math] can be written as linear combinations of kernel elements with smaller exponents in the place of [math]\displaystyle{ r }[/math]. This is usually computationally straightforward.

On the other hand, disproving k-regularity of the candidate sequence [math]\displaystyle{ s }[/math] usually requires one to produce a [math]\displaystyle{ \mathbb{Z} }[/math]-linearly independent subset in the kernel of [math]\displaystyle{ s }[/math], which is typically trickier. Here is one example of such a proof.

Let [math]\displaystyle{ e_0(n) }[/math] denote the number of [math]\displaystyle{ 0 }[/math]'s in the binary expansion of [math]\displaystyle{ n }[/math]. Let [math]\displaystyle{ e_1(n) }[/math] denote the number of [math]\displaystyle{ 1 }[/math]'s in the binary expansion of [math]\displaystyle{ n }[/math]. The sequence [math]\displaystyle{ f(n) := e_0(n)-e_1(n) }[/math] can be shown to be 2-regular. The sequence [math]\displaystyle{ g = g(n) := |f(n)| }[/math] is, however, not 2-regular, by the following argument. Suppose [math]\displaystyle{ (g(n))_{n \ge 0} }[/math] is 2-regular. We claim that the elements [math]\displaystyle{ g(2^k n) }[/math] for [math]\displaystyle{ n \ge 1 }[/math] and [math]\displaystyle{ k \ge 0 }[/math] of the 2-kernel of [math]\displaystyle{ g }[/math] are linearly independent over [math]\displaystyle{ \mathbb{Z} }[/math]. The function [math]\displaystyle{ n \mapsto e_0(n)-e_1(n) }[/math] is surjective onto the integers, so let [math]\displaystyle{ x_m }[/math] be the least integer such that [math]\displaystyle{ e_0(x_m)-e_1(x_m) = m }[/math]. By 2-regularity of [math]\displaystyle{ (g(n))_{n \ge 0} }[/math], there exist [math]\displaystyle{ b \ge 0 }[/math] and constants [math]\displaystyle{ c_i }[/math] such that for each [math]\displaystyle{ n \ge 0 }[/math],

[math]\displaystyle{ \sum_{0 \le i \le b} c_i g(2^i n) = 0. }[/math]

Let [math]\displaystyle{ a }[/math] be the least value for which [math]\displaystyle{ c_a \ne 0 }[/math]. Then for every [math]\displaystyle{ n \ge 0 }[/math],

[math]\displaystyle{ g(2^a n) = \sum_{a+1 \le i \le b} -(c_i/c_a) g(2^i n). }[/math]

Evaluating this expression at [math]\displaystyle{ n = x_m }[/math], where [math]\displaystyle{ m = 0,-1,1,2,-2 }[/math] and so on in succession, we obtain, on the left-hand side

[math]\displaystyle{ g(2^a x_m) = |e_0(x_m)-e_1(x_m)+a| = |m+a|, }[/math]

and on the right-hand side,

[math]\displaystyle{ \sum_{a+1 \le i \le b} -(c_i/c_a)|m+i|. }[/math]

It follows that for every integer [math]\displaystyle{ m }[/math],

[math]\displaystyle{ |m+a| = \sum_{a+1 \le i \le b} -(c_i/c_a) |m+i|. }[/math]

But for [math]\displaystyle{ m \ge -a-1 }[/math], the right-hand side of the equation is monotone because it is of the form [math]\displaystyle{ Am+B }[/math] for some constants [math]\displaystyle{ A,B }[/math], whereas the left-hand side is not, as can be checked by successively plugging in [math]\displaystyle{ m = -a-1 }[/math], [math]\displaystyle{ m = -a }[/math], and [math]\displaystyle{ m = -a+1 }[/math]. Therefore, [math]\displaystyle{ (g(n))_{n \ge 0} }[/math] is not 2-regular.[22]

Notes

  1. Allouche and Shallit (1992), Definition 2.1.
  2. 2.0 2.1 Allouche & Shallit (1992), Theorem 2.2.
  3. Allouche & Shallit (1992), Theorem 4.3.
  4. Allouche & Shallit (1992), Theorem 4.4.
  5. Schützenberger, M.-P. (1961), "On the definition of a family of automata", Information and Control 4 (2–3): 245–270, doi:10.1016/S0019-9958(61)80020-X .
  6. 6.0 6.1 Allouche & Shallit (1992, 2003).
  7. Berstel, Jean; Reutenauer, Christophe (1988). Rational Series and Their Languages. EATCS Monographs on Theoretical Computer Science. 12. Springer-Verlag. ISBN 978-3-642-73237-9. 
  8. Allouche & Shallit (1992), Example 8.
  9. Allouche & Shallit (1992), Examples 3 and 26.
  10. Allouche & Shallit (1992), Example 28.
  11. Allouche & Shallit (1992), Theorem 2.3.
  12. 12.0 12.1 Allouche & Shallit (2003) p. 441.
  13. Allouche & Shallit (1992), Theorem 2.5.
  14. Allouche & Shallit (1992), Theorem 3.1.
  15. Allouche & Shallit (2003) p. 445.
  16. Allouche and Shallit (2003) p. 446.
  17. Allouche and Shallit (2003) p. 441.
  18. Bell, J. (2006). "A generalization of Cobham's theorem for regular sequences". Séminaire Lotharingien de Combinatoire 54A. 
  19. Cobham, A. (1969). "On the base-dependence of sets of numbers recognizable by finite automata". Math. Systems Theory 3 (2): 186–192. doi:10.1007/BF01746527. 
  20. Allouche & Shallit (1992) Theorem 2.10.
  21. Allouche and Shallit (2003) p. 444.
  22. Allouche and Shallit (1993) p. 168–169.

References