Abstract

A word of the form WW for some word Win varSigma ^* is called a square. A partial word is a word possibly containing holes (also called don’t cares). The hole is a special symbol lozenge notin varSigma which matches any symbol from varSigma cup {lozenge }. A p-square is a partial word matching at least one square WW without holes. Two p-squares are called equivalent if they match the same set of squares. A p-square is called here unambiguous if it matches exactly one square WW without holes. Such p-squares are natural counterparts of classical squares. Let mathrm {PSQUARES}_k(n) and mathrm {USQUARES}_k(n) be the maximum number of non-equivalent p-squares and non-equivalent unambiguous p-squares in T over all partial words T of length n with at most k holes. We show asymptotically tight bounds: PSQUARESk(n)=Θ(min(nk2,n2)),USQUARESk(n)=Θ(nk).\\documentclass[12pt]{minimal}\t\t\t\t\\usepackage{amsmath}\t\t\t\t\\usepackage{wasysym}\t\t\t\t\\usepackage{amsfonts}\t\t\t\t\\usepackage{amssymb}\t\t\t\t\\usepackage{amsbsy}\t\t\t\t\\usepackage{mathrsfs}\t\t\t\t\\usepackage{upgreek}\t\t\t\t\\setlength{\\oddsidemargin}{-69pt}\t\t\t\t\\begin{document}$$\\begin{aligned} \\mathrm {PSQUARES}_k(n) = \\varTheta (\\min (nk^2,\\, n^2)),\\ \\ \\mathrm {USQUARES}_k(n) = \\varTheta (nk). \\end{aligned}$$\\end{document}We present an algorithm that reports all non-equivalent p-squares in mathcal {O}(nk^3) time for a partial word of length n with k holes, for an integer alphabet. In particular, it runs in linear time for k=mathcal {O}(1) and its time complexity near-matches the asymptotic bound for mathrm {PSQUARES}_k(n). We also show an mathcal {O}(n)-time algorithm that reports all non-equivalent p-squares of a given length. The paper is a full and improved version of Charalampopoulos et al. (in Cao Y, Chen Y (eds) Proceedings of the 23rd international conference on computing and combinatorics, COCOON 2017; Springer, 2017).

Highlights

  • A word is a sequence of letters from a given alphabet Σ

  • We introduce the notion of equivalence of p-square factors in partial words

  • Note that two psquare factors of a partial word W are equivalent in this sense iff they correspond to exactly the same sets of square subwords

Read more

Summary

Introduction

A word is a sequence of letters from a given alphabet Σ. Note that two psquare factors of a partial word W are equivalent in this sense iff they correspond to exactly the same sets of square subwords. Our work is devoted to enumeration of non-equivalent p-square factors of a partial word with a given number k of holes. Previous study of p-squares in partial words was mostly focused on their combinatorics It started with the case of k = 1 hole [8], in which case different square subwords correspond to non-equivalent p-square factors. As for a larger number of holes, the study was devoted mainly to counting the number of different square subwords of a partial word [8,2] or all occurrences of p-square factors [4,2]. Other work includes avoidance of squares [18,3] or abelian squares [5] in partial words

Our Results
Periodicity of Words and Partial Words
Combinatorial Bounds
Computing Q-runs
Computing Pseudoruns
Reporting Squares
Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.