Walking on Words

Author Ian Pratt-Hartmann

Thumbnail PDF


  • Filesize: 0.75 MB
  • 17 pages

Document Identifiers

Author Details

Ian Pratt-Hartmann
  • Department of Computer Science, University of Manchester, United Kingdom
  • Instytut Informatyki, Uniwersytet Opolski, Opole, Poland


The author wishes to thank Prof. V. Berthé and Prof. L. Tendera for their valuable help, and Mr. D. Kojelis for his many suggestions, in particular the much-improved reformulation of Theorem 4.

Cite AsGet BibTex

Ian Pratt-Hartmann. Walking on Words. In 35th Annual Symposium on Combinatorial Pattern Matching (CPM 2024). Leibniz International Proceedings in Informatics (LIPIcs), Volume 296, pp. 25:1-25:17, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2024)


Any function f with domain {1, … , m} and co-domain {1, … , n} induces a natural map from words of length n to those of length m: the ith letter of the output word (1 ≤ i ≤ m) is given by the f(i)th letter of the input word. We study this map in the case where f is a surjection satisfying the condition |f(i+1)-f(i)| ≤ 1 for 1 ≤ i < m. Intuitively, we think of f as describing a "walk" on a word u, visiting every position, and yielding a word w as the sequence of letters encountered en route. If such an f exists, we say that u generates w. Call a word primitive if it is not generated by any word shorter than itself. We show that every word has, up to reversal, a unique primitive generator. Observing that, if a word contains a non-trivial palindrome, it can generate the same word via essentially different walks, we obtain conditions under which, for a chosen pair of walks f and g, those walks yield the same word when applied to a given primitive word. Although the original impulse for studying primitive generators comes from their application to decision procedures in logic, we end, by way of further motivation, with an analysis of the primitive generators for certain word sequences defined via morphisms.

Subject Classification

ACM Subject Classification
  • Mathematics of computing → Combinatorics on words
  • word combinatorics
  • palindrome
  • Rauzy morphism


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Bartosz Bednarczyk, Daumantas Kojelis, and Ian Pratt-Hartmann. On the Limits of Decision: the Adjacent Fragment of First-Order Logic. In Kousha Etessami, Uriel Feige, and Gabriele Puppis, editors, 50th International Colloquium on Automata, Languages, and Programming (ICALP 2023), volume 261 of Leibniz International Proceedings in Informatics (LIPIcs), pages 111:1-111:21, Dagstuhl, Germany, 2023. Schloss Dagstuhl - Leibniz-Zentrum für Informatik. Google Scholar
  2. M. Crochemore and W. Rytter. Jewels of stringology. World Scientific, Singapore and River Edge, NJ, 2002. Google Scholar
  3. N. Pytheas Fogg. Substitutions in Dynamics, Arithmetics and Combinatorics. Number 1794 in Lecture Notes in Mathematics, edited by V. Berthé, S. Ferenczi, C. Mauduit, and A. Siegel. Springer Verlag, Berlin, Heidelberg, New York, 2002. Google Scholar
  4. M. Lothaire. Applied Combinatorics on Words. Encyclopedia of Mathematics and its Applications. Cambridge University Press, Cambridge, 2005. Google Scholar
  5. Ian Pratt-Hartmann. Walking on words (v.2), 2024. URL: https://arxiv.org/abs/2208.08913.
  6. Gérard Rauzy. Nombres algébriques et substitutions. Bulletin de la Société Mathématique de France, 110:147-178, 1982. Google Scholar