[Paper Review] On the number of squares in a finite word
This paper proves that the number of distinct nonempty square factors in a finite word $ w $ is bounded by $ |w| - |\text{Alph}(w)| + 1 $, confirming a long-standing conjecture by Fraenkel and Simpson. The authors use Rauzy graphs and small circuits to construct an injective mapping from square factors to these circuits, leveraging combinatorial properties of conjugacy and periodicity in words.
A fundamental concept related to strings is that of repetitions. It has been extensively studied in many versions, from both purely combinatorial and algorithmic angles. One of the most basic questions is how many distinct squares, i.e., distinct strings of the form UU, a string of length n can contain as fragments. It turns out that this is always 𝒪(n), and the bound cannot be improved to sublinear in n [Fraenkel and Simpson, JCTA 1998]. Several similar questions about repetitions in strings have been considered, and by now we seem to have a good understanding of their repetitive structure. For higher-dimensional strings, the basic concept of periodicity has been successfully extended and applied to design efficient algorithms - it is inherently more complex than for regular strings. Extending the notion of repetitions and understanding the repetitive structure of higher-dimensional strings is however far from complete. Quartics were introduced by Apostolico and Brimkov [TCS 2000] as analogues of squares in two dimensions. Charalampopoulos, Radoszewski, Rytter, Waleń, and Zuba [ESA 2020] proved that the number of distinct quartics in an n×n 2D string is 𝒪(n²log²n) and that they can be computed in 𝒪(n²log²n) time. Gawrychowski, Ghazawi, and Landau [SPIRE 2021] constructed an infinite family of n×n 2D strings with Ω(n²log n) distinct quartics. This brings the challenge of determining asymptotically tight bounds. Here, we settle both the combinatorial and the algorithmic aspects of this question: the number of distinct quartics in an n×n 2D string is 𝒪(n²log n) and they can be computed in the worst-case optimal 𝒪(n²log n) time. As expected, our solution heavily exploits the periodic structure implied by occurrences of quartics. However, the two-dimensional nature of the problem introduces some technical challenges. Somewhat surprisingly, we overcome the final challenge for the combinatorial bound using a result of Marcus and Tardos [JCTA 2004] for permutation avoidance on matrices.
Motivation & Objective
- To resolve the 1998 conjecture by Fraenkel and Simpson that the number of distinct nonempty squares in a finite word is at most its length.
- To establish a tighter upper bound on square complexity than previously known, improving upon bounds like $ \frac{3}{2}|w| $ and $ \frac{11}{6}|w| $.
- To develop a structural framework using Rauzy graphs and small circuits to analyze square factors in finite words.
- To demonstrate that the number of distinct square factors is fundamentally constrained by word length and alphabet size, not just length alone.
Proposed method
- Construct Rauzy graphs $ \Gamma_n(w) $ for each $ n \leq |w| $, where vertices are length-$ n $ factors of $ w $, and edges represent overlaps.
- Define 'small circuits' in Rauzy graphs as cycles corresponding to repeated patterns of the form $ uu $, where $ u $ is a primitive word.
- Group square factors into classes based on conjugacy of their root words, and define the 'index' of a class as the maximum number of times a root's power appears as a factor.
- Establish an injective mapping from each distinct square factor to a unique small circuit in the union of Rauzy graphs, using properties of conjugacy and periodicity.
- Use the cyclomatic number of the union of Rauzy graphs to bound the total number of small circuits, which upper bounds the number of distinct squares.
- Leverage the Fine and Wilf lemma and Lyndon-Sch"utzenberger results to analyze periodic structures and ensure injectivity of the mapping.
Experimental results
Research questions
- RQ1Can the number of distinct nonempty square factors in a finite word be bounded more tightly than by its length?
- RQ2Is the Fraenkel-Simpson conjecture—that the number of distinct squares is at most $ |w| $—true, and can it be strengthened to include alphabet size?
- RQ3Can the structure of Rauzy graphs and small circuits be used to injectively map square factors to graph features, thereby enabling counting?
- RQ4How does the number of distinct letters in a word affect the maximum number of distinct square factors it can contain?
- RQ5What is the precise relationship between the root word's conjugacy class and the number of times its square appears as a factor?
Key findings
- The number of distinct nonempty square factors $ S(w) $ in a finite word $ w $ satisfies $ S(w) \leq |w| - |\text{Alph}(w)| + 1 $, proving the conjecture.
- The bound is strictly tighter than previous results such as $ \frac{3}{2}|w| $, and it incorporates alphabet size as a key parameter.
- An injective mapping is constructed from the set of distinct nonempty squares to the set of small circuits in the union of Rauzy graphs of $ w $, proving the bound.
- The total number of small circuits across all Rauzy graphs is bounded by $ |w| - |\text{Alph}(w)| $, which directly limits the number of distinct squares.
- For words with a small alphabet, the bound becomes significantly tighter, e.g., for unary words, only one square exists.
- The proof relies on structural properties of conjugacy classes and periodicity, with injectivity ensured by unique edge sequences in small circuits.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.