Notes on Counting with Finite Machines

Author Dmitry Chistikov

Thumbnail PDF


  • Filesize: 470 kB
  • 12 pages

Document Identifiers

Author Details

Dmitry Chistikov

Cite AsGet BibTex

Dmitry Chistikov. Notes on Counting with Finite Machines. In 34th International Conference on Foundation of Software Technology and Theoretical Computer Science (FSTTCS 2014). Leibniz International Proceedings in Informatics (LIPIcs), Volume 29, pp. 339-350, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2014)


We determine the descriptional complexity (smallest number of states, up to constant factors) of recognizing languages {1^n} and {1^{t n} : t = 0, 1, 2, ...} with state-based finite machines of various kinds. This task is understood as counting to n and modulo n, respectively, and was previously studied for classes of finite-state automata by Kupferman, Ta-Shma, and Vardi (2001). We show that for Turing machines it requires log(n)/log(log(n)) states in the worst case, and individual values are related to Kolmogorov complexity of the binary encoding of n. For deterministic pushdown and counter automata, the complexity is log(n) and sqrt(n), respectively; for alternating counter automata, we show an upper bound of log(n). For visibly pushdown automata, i.e., if the stack movements are determined by input symbols, we consider languages {a^n b^n} and {a^{t n} b^{t n} : n t = 0, 1, 2, ...} and determine their complexity, of sqrt(n) and min(n_1 + n_2), respectively, with minimum over all factorizations n = n_1 n_2.
  • State complexity
  • Unary languages
  • Counting


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


  1. Rajeev Alur and P. Madhusudan. Adding nesting structure to words. J. ACM, 56(3):16:1-43, 2009. Revised version available at
  2. Jean-Camille Birget. Two-way automata and length-preserving homomorphisms. Mathematical Systems Theory, 29(3):191-226, 1996. Google Scholar
  3. Can one-way alternating automata with one-counter recognize some unary non-regular languages?, 2013-2014.
  4. Gregory J. Chaitin. On the length of programs for computing finite binary sequences. J. ACM, 13(4):547-569, 1966. Google Scholar
  5. Ashok K. Chandra, Dexter C. Kozen, and Larry J. Stockmeyer. Alternation. J. ACM, 28(1):114-133, 1981. Google Scholar
  6. Moses Charikar, Eric Lehman, Ding Liu, Rina Panigrahy, Manoj Prabhakaran, Amit Sahai, and abhi shelat. The smallest grammar problem. IEEE Transactions on Information Theory, 51(7):2554-2576, 2005. Google Scholar
  7. Dmitry Chistikov and Rupak Majumdar. Unary pushdown automata and straight-line programs. In ICALP'14, Part II, volume 8573 of LNCS, pages 146-157, 2014. Google Scholar
  8. Marek Chrobak. Finite automata and unary languages. Theor. Comput. Sci., 47(3):149-158, 1986. Google Scholar
  9. Yuval Filmus. Lower bounds for context-free grammars. Inf. Process. Lett., 111(18):895-898, 2011. Google Scholar
  10. Matthew M. Geller, Harry B. Hunt III, Thomas G. Szymanski, and Jeffrey D. Ullman. Economy of description by parsers, DPDA’s, and PDA’s. Theor. Comput. Sci., 4(2):143-153, 1977. Google Scholar
  11. Seymour Ginsburg and H. Gordon Rice. Two families of languages related to ALGOL. J. ACM, 9(3):350-371, 1962. Google Scholar
  12. Orna Kupferman, Amnon Ta-Shma, and Moshe Y. Vardi. Concurrency counts. Technical report, available at, 2001.
  13. Ernst L. Leiss. Succinct representation of regular languages by boolean automata. Theor. Comput. Sci., 13(3):323-330, 1981. Google Scholar
  14. Ming Li and Paul M. B. Vitányi. An introduction to Kolmogorov complexity and its applications. Texts and monographs in computer science. Springer, 1993. Google Scholar
  15. Markus Lohrey. Algorithmics on SLP-compressed strings: a survey. Groups Complexity Cryptology, 4(2):241-299, 2012. Google Scholar
  16. Albert R. Meyer and Michael J. Fischer. Economy of description by automata, grammars, and formal systems. In SWAT (FOCS) 1971, pages 188-191, 1971. Google Scholar
  17. Alexander Okhotin, Xiaoxue Piao, and Kai Salomaa. Descriptional complexity of input-driven pushdown automata. In Dassow Festschrift 2012, volume 7300 of LNCS, pages 186-206, 2012. Google Scholar
  18. Alexander Okhotin and Kai Salomaa. Complexity of input-driven pushdown automata. SIGACT News, 45(2):47-67, 2014. Google Scholar
  19. Giovanni Pighizzini. Deterministic pushdown automata and unary languages. Int. J. Found. Comput. Sci., 20(4):629-645, 2009. Google Scholar
  20. Giovanni Pighizzini, Jeffrey Shallit, and Ming-wei Wang. Unary context-free grammars and pushdown automata, descriptional complexity and auxiliary space lower bounds. J. Comput. Syst. Sci., 65(2):393-414, 2002. Google Scholar
  21. Wojciech Rytter. Grammar compression, LZ-encodings, and string algorithms with implicit input. In ICALP'04, volume 3142 of LNCS, pages 15-27, 2004. Google Scholar
  22. Kai Salomaa. Limitations of lower bound methods for deterministic nested word automata. Inf. Comput., 209(3):580-589, 2011. Google Scholar