On the Maximal Number of Cubic Subwords in a String

We investigate the problem of the maximum number of cubic subwords (of the form www) in a given word. We also consider square subwords (of the form ww). The problem of the maximum number of squares in a word is not well understood. Several new results related to this problem are produced in the paper. We consider two simple problems related to the maximum number of subwords which are squares or which are highly repetitive; then we provide a nontrivial estimation for the number of cubes. We show that the maximum number of squares xx such that x is not a primitive word (nonprimitive squares) in a word of length n is exactly $\left\lfloor \frac{n}{2}\right\rfloor - 1$, and the maximum number of subwords of the form x k , for k ? 3, is exactly n ? 2. In particular, the maximum number of cubes in a word is not greater than n ? 2 either. Using very technical properties of occurrences of cubes, we improve this bound significantly. We show that the maximum number of cubes in a word of length n is between $\frac{45}{100}\;n$ and $\frac{4}{5}\;n$.

[1]  Robin Milner An Action Structure for Synchronous pi-Calculus , 1993, FCT.

[2]  Grzegorz Rozenberg,et al.  Developments in Language Theory II , 2002 .

[3]  Wojciech Rytter,et al.  The Number of Runs in Sturmian Words , 2008, CIAA.

[4]  Franco P. Preparata,et al.  Optimal Off-Line Detection of Repetitions in a String , 1983, Theor. Comput. Sci..

[5]  Gregory Kucherov,et al.  On Maximal Repetitions in Words , 1999, FCT.

[6]  Lucian Ilie,et al.  A note on the number of squares in a word , 2007, Theor. Comput. Sci..

[7]  Aviezri S. Fraenkel,et al.  How Many Squares Can a String Contain? , 1998, J. Comb. Theory, Ser. A.

[8]  Lucian Ilie,et al.  Towards a Solution to the "Runs" Conjecture , 2008, CPM.

[9]  Haruo Hosoya,et al.  Multi-Return Macro Tree Transducers , 2008, PLAN-X.

[10]  Lucian Ilie,et al.  Maximal repetitions in strings , 2008, J. Comput. Syst. Sci..

[11]  Wojciech Rytter,et al.  On the Maximal Number of Cubic Runs in a String , 2010, LATA.

[12]  Lucian Ilie,et al.  A simple proof that a word of length n has at most 2n distinct squares , 2005, J. Comb. Theory A.

[13]  H. Wilf,et al.  Uniqueness theorems for periodic functions , 1965 .

[14]  Wojciech Rytter,et al.  Jewels of stringology , 2002 .

[15]  Gregory Kucherov,et al.  Finding maximal repetitions in a word in linear time , 1999, 40th Annual Symposium on Foundations of Computer Science (Cat. No.99CB37039).

[16]  Wojciech Rytter,et al.  Asymptotic Behaviour of the Maximal Number of Squares in Standard Sturmian Words , 2012, Int. J. Found. Comput. Sci..

[17]  William F. Smyth,et al.  How many runs can a string contain? , 2008, Theor. Comput. Sci..

[18]  Maxime Crochemore,et al.  An Optimal Algorithm for Computing the Repetitions in a Word , 1981, Inf. Process. Lett..

[19]  M. Lothaire,et al.  Applied Combinatorics on Words , 2005 .

[20]  David Damanik,et al.  Powers in Sturmian sequences , 2003, Eur. J. Comb..

[21]  Wojciech Rytter,et al.  The number of runs in a string , 2007, Inf. Comput..

[22]  Wojciech Rytter,et al.  Squares, cubes, and time-space efficient string searching , 1995, Algorithmica.

[23]  Michael G. Main,et al.  Detecting leftmost maximal periodicities , 1989, Discret. Appl. Math..

[24]  Costas S. Iliopoulos,et al.  A Characterization of the Squares in a Fibonacci String , 1997, Theor. Comput. Sci..

[25]  Mathieu Giraud,et al.  Not So Many Runs in Strings , 2008, LATA.

[26]  Maxime Crochemore,et al.  Bounds on Powers in Strings , 2008, Developments in Language Theory.

[27]  M. Lothaire,et al.  Combinatorics on words: Frontmatter , 1997 .

[28]  Michael G. Main,et al.  An O(n log n) Algorithm for Finding All Repetitions in a String , 1984, J. Algorithms.

[29]  Wojciech Rytter,et al.  The Number of Runs in a String: Improved Analysis of the Linear Upper Bound , 2006, STACS.