Lattice representation of Delta(n) (also denoted ∆_n), the set of correlations for binary strings of length n = 4.

Counting overlapping pairs of strings

Abstract

A correlation is a binary vector that encodes all possible positions of overlaps of two words, where an overlap for an ordered pair of words (u,v) occurs if a suffix of word u matches a prefix of word v. As multiple pairs can have the same correlation, it is relevant to count how many pairs of words share the same correlation depending on the alphabet size and word length n. We exhibit recurrences to compute the number of such pairs – which is termed population size – for any correlation; for this, we exploit a relationship between overlaps of two words and self-overlap of one word. This theorem allows us to compute the number of pairs with a longest overlap of a given length and to show that the expected length of the longest border of two words asymptotically diverges, which solves two open questions raised by Gabric in 2022. Finally, we also provide bounds for the asymptotic of the population ratio of any correlation. Given the importance of word overlaps in areas like word combinatorics, bioinformatics, and digital communication, our results may ease analyses of algorithms for string processing, code design, or genome assembly.

The figure shows Delta(4), which is , the set of correlations for binary strings of length n = 4, and the table on the right displays the Pair population sizes on a binary alphabet for correlations of ∆_4, that is with σ = 2 and n = 4.

This work is part of Pengfei’s doctoral work, who is a member of the ALPACA project, which has received funding from the European Union’s Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No 956229.