Abstract
We consider the streaming version of the following problem: given an input string s of length n, find the maximum exponent of a substring of s. We prove that any algorithm deciding, w.h.p., whether a string contains a square, uses memory of size \(\varOmega (n)\), and thus does not satisfy the limitations of the streaming model. Thus the considered problem has no exact solution in the streaming model. Our main result is a Monte Carlo algorithm which computes the maximum exponent up to an additive error \(\varepsilon <1/2\): it outputs a number \(\alpha \) such that s has a substring of exponent \(\alpha \) but no substrings of exponent \(\alpha +\varepsilon \) or higher. The algorithm uses \(\mathcal {O}(\frac{\log ^2 n}{\varepsilon })\) words of memory and performs \(\mathcal {O}(\log n)\) operations, including dictionary operations, per input symbol.
Similar content being viewed by others
References
Andersson, A., Thorup, M.: Dynamic ordered sets with exponential search trees. J. ACM 54(3), 13 (2007)
Arbitman, Y., Naor, M., Segev, G.: De-amortized cuckoo hashing: Provable worst-case performance and experimental results. In: 36th International Colloquium Automata, Languages and Programming, ICALP 2009, Lecture Notes in Computer Science, vol. 5555, pp. 107–118. Springer (2009)
Badkobeh, G., Crochemore, M., Toopsuwan, C.: Computing the maximal-exponent repeats of an overlap-free string in linear time. In: Proceedings 19th International Symposium String Processing and Information Retrieval, SPIRE 2012, Lecture Notes in Computer Science, vol. 7608, pp. 61–72. Springer (2012)
Brandenburg, F.J.: Uniformly growing \(k\)-th power-free homomorphisms. Theoret. Comput. Sci. 23, 69–82 (1983)
Breslauer, D., Galil, Z.: Real-time streaming string-matching. In: Combinatorial pattern matching. LNCS, vol. 6661, pp. 162–172. Springer, Berlin (2011)
Crochemore, M., Iliopoulos, C.S., Kociumaka, T., Kundu, R., Pissis, S.P., Radoszewski, J., Rytter, W., Walen, T.: Near-optimal computation of runs over general alphabet via non-crossing LCE queries. In: 23rd International Symposium String Processing and Information Retrieval, SPIRE 2016, Lecture Notes in Computer Science, vol. 9954, pp. 22–34 (2016)
Crochemore, M., Kolpakov, R., Kucherov, G.: Optimal bounds for computing \(\alpha \)-gapped repeats. Inf. Comput. 268, 104434 (2019)
Dietzfelbinger, M., auf der Heide, F.M.: Dynamic hashing in real time. In: Informatik, pp. 95–119. Springer (1992)
Fredman, M.L., Willard, D.E.: Surpassing the information theoretic bound with fusion trees. J. Comput. Syst. Sci. 47(3), 424–436 (1993)
Karp, R.M., Rabin, M.O.: Efficient randomized pattern-matching algorithms. IBM J. Res. Dev. 31(2), 249–260 (1987)
Knuth, D.E., Morris, J., Pratt, V.: Fast pattern matching in strings. SIAM J. Comput. 6, 323–350 (1977)
Kolpakov, R., Podolskiy, M., Posypkin, M., Khrapov, N.: Searching of gapped repeats and subrepetitions in a word. In: Proceedings 25th Annual Symposium Combinatorial Pattern Matching, CPM 2014, Moscow, Russia, June 16-18, 2014, Lecture Notes in Computer Science, vol. 8486, pp. 212–221. Springer (2014)
Kolpakov, R.M., Kucherov, G.: Finding maximal repetitions in a word in linear time. IEEE Comput. Soc. 99, 596–604 (1999)
Merkurev, O., Shur, A.M.: Searching long repeats in streams. In: 30th Annual Symposium on Combinatorial Pattern Matching CPM 2019, LIPIcs, vol. 128, pp. 1–14 (2019)
Merkurev, O., Shur, A.M.: Searching runs in streams. In: Proceedings 26th International Symposium String Processing and Information Retrieval, SPIRE 2019, Lecture Notes in Computer Science, vol. 11811, pp. 203–220. Springer (2019)
Porat, B., Porat, E.: Exact and approximate pattern matching in the streaming model. In: 50th Annual IEEE Symposium on Foundations of Computer Science, 2009. FOCS’09. pp. 315–323. IEEE (2009)
Shur, A.M.: Growth of power-free languages over large alphabets, vol. 6072, pp. 350–361. Springer, Berlin (2010)
Shur, A.M.: Growth properties of power-free languages. Comput. Sci. Rev. 6, 187–208 (2012)
Thue, A.: Über unendliche Zeichenreihen. Norske vid. Selsk. Skr. Mat. Nat. Kl. 7, 1–22 (1906)
Thue, A.: Über die gegenseitige Lage gleicher Teile gewisser Zeichenreihen. Norske vid. Selsk. Skr. Mat. Nat. Kl. 1, 1–67 (1912)
Yao, A.: Probabilistic computations: toward a unified measure of complexity. In: Proceedings of the 18th IEEE Symposium on Foundations of Computer Science (FOCS), pp. 222–227 (1977)
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Merkurev, O., Shur, A.M. Computing The Maximum Exponent in a Stream. Algorithmica 84, 742–756 (2022). https://doi.org/10.1007/s00453-021-00883-y
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00453-021-00883-y