How many squares can a string contain?
Journal of Combinatorial Theory Series A
Partial words and a theorem of Fine and Wilf
Theoretical Computer Science
A simple proof that a word of length n has at most 2n distinct squares
Journal of Combinatorial Theory Series A
A note on the number of squares in a word
Theoretical Computer Science
Algorithmic Combinatorics on Partial Words (Discrete Mathematics and Its Applications)
Algorithmic Combinatorics on Partial Words (Discrete Mathematics and Its Applications)
The three-squares lemma for partial words with one hole
Theoretical Computer Science
Squares in binary partial words
DLT'12 Proceedings of the 16th international conference on Developments in Language Theory
The maximum number of squares in a tree
CPM'12 Proceedings of the 23rd Annual conference on Combinatorial Pattern Matching
The hardness of counting full words compatible with partial words
Journal of Computer and System Sciences
Hi-index | 0.01 |
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.