An efficient algorithm to decide periodicity of b-recognisable sets using MSDF convention
Given an integer base $b>1$, a set of integers is represented in base $b$ by a language over ${0,1,…,b-1}$. The set is said to be $b$-recognisable if its representation is a regular language. It is known that eventually periodic sets are $b$-recognisable in every base $b$, and Cobham’s theorem implies the converse: no other set is $b$-recognisable in every base $b$. We are interested in deciding whether a $b$-recognisable set of integers (given as a finite automaton) is eventually periodic. Honkala showed that this problem decidable in 1986 and recent developments give efficient decision algorithms. However, they only work when the integers are written with the least significant digit first. In this work, we consider the natural order of digits (Most Significant Digit First) and give a quasi-linear algorithm to solve the problem in this case.
💡 Research Summary
The paper addresses the problem of deciding whether a set of natural numbers, represented in base b by a regular language (i.e., a b‑recognisable set), is ultimately periodic. While Cobham’s theorem tells us that only ultimately periodic sets are b‑recognisable in every base, the algorithmic question of testing periodicity for a given b‑recognisable set has a long history. Honkala proved decidability in 1986, but his method has exponential worst‑case complexity. More recent work by Leroux and by Marsault‑Sakarovitch gave quasi‑linear O(b·n·log n) algorithms, but these rely on the least‑significant‑digit‑first (LSDF) convention, where the input word is read from the least significant digit. Converting an automaton that reads most‑significant‑digit‑first (MSDF) into LSDF by reversal and determinisation can cause an exponential blow‑up in the number of states, making it impractical.
The authors therefore develop a direct MSDF algorithm that retains the quasi‑linear bound. The key technical ingredients are:
-
Automaton morphisms and pseudo‑morphisms – formalising structure‑preserving maps between deterministic finite automata (DFA) and their minimisations (Myhill‑Nerode theorem).
-
Ultimate‑equivalence – a new equivalence relation on states: two states s and s′ are m‑ultimately‑equivalent if, for every word of length at least m, the runs from s and s′ end in the same state. This relation can be computed by building a graph on state pairs and checking reachability of strongly connected components. Using the Béal‑Crochemore algorithm, the authors achieve O(b·n·log n) time.
-
Purely periodic automata A(p,R) – for a period p and a set R⊆{0,…,p−1}, the automaton A(p,R) has state set ℤ/pℤ and transition δ(n,a) = (n·b + a) mod p. It recognises exactly those base‑b representations whose numeric value has remainder in R modulo p. The automaton is not minimal in general, but its structure can be decomposed using the Chinese Remainder Theorem: write p = k·d where k is coprime with b and d divides a power of b. Then A(p,?) ≅ A(k,?) × A(d,?), where A(k,?) is a group automaton (each letter induces a permutation on the k‑states) and A(d,?) is strongly connected.
The decision procedure proceeds as follows:
-
Step 1 – Compute ultimate‑equivalence classes of the input DFA A and quotient A by this relation, obtaining a smaller automaton Â. This step runs in O(b·n·log n).
-
Step 2 – Analyse the transition graph of  to identify its strongly connected components (SCCs). For each SCC, check whether its transition structure matches that of a product A(k,?) × A(d,?) for some (k,d) derived from a candidate period p.
-
Step 3 – Verify group‑automaton property for the k‑part: each input symbol must act as a permutation on the k‑states. This is a simple linear scan of the transition table.
-
Step 4 – Reconstruct the period parameters (p,R) from the SCC decomposition. If a consistent (p,R) exists, the original automaton accepts, “by value”, an ultimately periodic set; otherwise it does not.
All these operations are bounded by O(b·n·log n), yielding the main theorem: given a deterministic n‑state automaton over the alphabet {0,…,b−1} that reads digits MSDF, one can decide in O(b·n·log n) time whether it recognises an ultimately periodic set of integers.
Beyond integers, the authors show how the same technique extends to real numbers encoded as a finite integer prefix, a separator, and an infinite fractional suffix. The integer part is handled by the MSDF algorithm; the fractional part, when recognised by a weak deterministic automaton, has a very restricted structure that can be checked in linear time. Consequently, the overall procedure remains quasi‑linear for real‑valued sets.
Finally, the paper discusses possible extensions to more general numeration systems (e.g., those based on linear recurrent sequences such as Pisot numeration). While Honkala’s decidability results extend to many morphic words, no efficient algorithm is known for these broader settings. The authors suggest that the notions of ultimate‑equivalence and group‑automaton behaviour could serve as a foundation for future work in that direction.
In summary, the contribution is a clean, deterministic, quasi‑linear algorithm for the periodicity decision problem under the natural MSDF digit order, eliminating the need for costly reversal‑determinisation, and opening the way to efficient analysis of both integer and real number sets, as well as providing a conceptual framework that may be adaptable to more exotic numeration systems.
Comments & Academic Discussion
Loading comments...
Leave a Comment