55,162 research outputs found

    Counting distinct squares in partial words

    Get PDF
    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

    Abelian-Square-Rich Words

    Full text link
    An abelian square is the concatenation of two words that are anagrams of one another. A word of length nn can contain at most Θ(n2)\Theta(n^2) distinct factors, and there exist words of length nn containing Θ(n2)\Theta(n^2) distinct abelian-square factors, that is, distinct factors that are abelian squares. This motivates us to study infinite words such that the number of distinct abelian-square factors of length nn grows quadratically with nn. More precisely, we say that an infinite word ww is {\it abelian-square-rich} if, for every nn, every factor of ww of length nn contains, on average, a number of distinct abelian-square factors that is quadratic in nn; and {\it uniformly abelian-square-rich} if every factor of ww contains a number of distinct abelian-square factors that is proportional to the square of its length. Of course, if a word is uniformly abelian-square-rich, then it is abelian-square-rich, but we show that the converse is not true in general. We prove that the Thue-Morse word is uniformly abelian-square-rich and that the function counting the number of distinct abelian-square factors of length 2n2n of the Thue-Morse word is 22-regular. As for Sturmian words, we prove that a Sturmian word sαs_{\alpha} of angle α\alpha is uniformly abelian-square-rich if and only if the irrational α\alpha has bounded partial quotients, that is, if and only if sαs_{\alpha} has bounded exponent.Comment: To appear in Theoretical Computer Science. Corrected a flaw in the proof of Proposition
    corecore