Counting distinct squares in partial words

  • Authors:
  • F. Blanchet-Sadri;Robert Mercas;Geoffrey Scott

  • Affiliations:
  • Department of Computer Science, University of North Carolina, Greensboro, NC;GRLMC, Universitat Rovira i Virgili, Tarragona, Spain and MOCALC Research Group, Faculty of Mathematics and Computer Science, University of Bucharest, Bucharest, Romania;Department of Mathematics, Dartmouth College, Hanover, NH

  • Venue:
  • Acta Cybernetica
  • Year:
  • 2009

Quantified Score

Hi-index 0.01

Visualization

Abstract

A well known result of Fraenkel and Simpson states that the number of distinct squares in a word of length n is bounded by 2n since at each position there are at most two distinct squares whose last occurrence start. In this paper, we investigate the problem of counting distinct squares in partial words, or sequences over a finite alphabet that may have some "do not know" symbols or "holes" (a (full) word is just a partial word without holes). A square in a partial word over a given alphabet has the form uu′ where u′ is compatible with u, and consequently, such square is compatible with a number of full words over the alphabet that are squares. We consider the number of distinct full squares compatible with factors in a partial word with h holes of length n over a k-letter alphabet, and show that this number increases polynomially with respect to k in contrast with full words, and give bounds in a number of cases. For partial words with one hole, it turns out that there may be more than two squares that have their last occurrence starting at the same position. We prove that if such is the case, then the hole is in the shortest square. We also construct a partial word with one hole over a k-letter alphabet that has more than k squares whose last occurrence start at position zero.