Papers
Topics
Authors
Recent
Search
2000 character limit reached

Expected Codeword Overlap Analysis

Updated 5 July 2026
  • Expected Codeword Overlap is the quantitative study of prefix–suffix coincidences between equal-length codewords, using metrics like shortest and longest overlaps.
  • The analysis reveals that while the expected shortest overlap remains bounded as blocklength increases, the expected longest overlap diverges asymptotically.
  • Zero-overlap and restricted-overlap codes are examined through combinatorial techniques to balance codebook size against the risk of codeword collisions.

Expected codeword overlap is the quantitative study of prefix–suffix coincidences between codewords, usually for ordered pairs of equal-length words over a finite alphabet. In the recent literature, this notion is formalized through several distinct but closely related objects: borders and correlations of ordered pairs, shortest and longest overlap lengths, extremal code families that forbid prescribed overlap lengths, and, in overlapped arithmetic coding, the expected number of same-coset neighbors at a given Hamming distance. Taken together, these models show that “expected overlap” is not a single invariant: the expected shortest overlap is bounded, the expected longest overlap diverges, and zero-overlap design imposes sharp cardinality penalties on codebooks (Rivals et al., 2024, Gabric, 2020, Stanovnik, 2024).

1. Core definitions and overlap models

Fix a finite alphabet Σ\Sigma of size σ\sigma, and let Σn\Sigma^n denote the set of words of length nn. For an ordered pair (u,v)Σn×Σn(u,v)\in\Sigma^n\times\Sigma^n, a border of the pair is a non-empty word zz that is both a suffix of uu and a prefix of vv. The overlap relation is directional: borders of (u,v)(u,v) and (v,u)(v,u) are counted separately. The longest-border random variable is

σ\sigma0

with σ\sigma1 representing the absence of a non-empty overlap (Rivals et al., 2024).

The same overlap structure can be encoded by the correlation vector

σ\sigma2

A σ\sigma3 at position σ\sigma4 records a border of length σ\sigma5, and the leftmost σ\sigma6 determines the longest border. A central structural fact is

σ\sigma7

where σ\sigma8 is the set of autocorrelations of words of length σ\sigma9. Thus every pair-correlation is a shifted autocorrelation of its longest border (Rivals et al., 2024).

A complementary formalization focuses on the shortest overlap. For words Σn\Sigma^n0, Σn\Sigma^n1 is the shortest right-border of Σn\Sigma^n2 if one exists, and Σn\Sigma^n3 otherwise; Σn\Sigma^n4, with Σn\Sigma^n5 if there is no right-border. Gabric also distinguishes left- and right-borders, and calls a pair mutually bordered if it has both a right-border and a left-border (Gabric, 2020).

These viewpoints are not interchangeable. The longest-border model emphasizes the full overlap profile of an ordered pair, while the shortest-overlap model isolates the first non-trivial prefix–suffix coincidence. A common conflation is to treat them as having the same asymptotic behavior; the current literature shows that they do not.

2. Expected shortest overlap

For the shortest-overlap model, the relevant combinatorial quantity is the number Σn\Sigma^n6 of unbordered words of length Σn\Sigma^n7. A key lemma states that the shortest overlap word is unbordered: if Σn\Sigma^n8 is both a proper suffix of Σn\Sigma^n9 and a proper prefix of nn0, then nn1 if and only if nn2 is unbordered. This reduces the distribution of shortest overlaps to unbordered-word counting (Gabric, 2020).

Let nn3 for two independently and uniformly chosen words nn4. If nn5 denotes the number of ordered pairs with nn6, then

nn7

Consequently,

nn8

and

nn9

As (u,v)Σn×Σn(u,v)\in\Sigma^n\times\Sigma^n0,

(u,v)Σn×Σn(u,v)\in\Sigma^n\times\Sigma^n1

and the series converges. Hence the expected shortest overlap is (u,v)Σn×Σn(u,v)\in\Sigma^n\times\Sigma^n2, with the constant depending on the alphabet size (u,v)Σn×Σn(u,v)\in\Sigma^n\times\Sigma^n3 (Gabric, 2020).

The paper also gives numerical values for the limiting expectation.

(u,v)Σn×Σn(u,v)\in\Sigma^n\times\Sigma^n4 (u,v)Σn×Σn(u,v)\in\Sigma^n\times\Sigma^n5
2 1.156
3 0.605
4 0.395
5 0.290
10 0.121
100 0.010

These values show that the expected shortest suffix–prefix overlap is small even for binary alphabets and decreases rapidly with alphabet size. The same work also proves that the number (u,v)Σn×Σn(u,v)\in\Sigma^n\times\Sigma^n6 of mutually bordered pairs satisfies

(u,v)Σn×Σn(u,v)\in\Sigma^n\times\Sigma^n7

so a constant fraction of pairs are mutually bordered, although the shortest overlap itself has bounded expectation (Gabric, 2020).

3. Expected longest overlap and correlation populations

The longest-overlap problem is substantially richer because it depends on the entire correlation vector rather than on the first admissible border alone. For a correlation (u,v)Σn×Σn(u,v)\in\Sigma^n\times\Sigma^n8, the population

(u,v)Σn×Σn(u,v)\in\Sigma^n\times\Sigma^n9

counts ordered pairs with exactly that overlap pattern. If zz0 with zz1, then the one-sided population size is

zz2

because the first zz3 symbols of the right word must realize the autocorrelation zz4, while the remaining zz5 symbols are free (Rivals et al., 2024).

The key reduction embeds a pair into a single word zz6 of length zz7. If zz8 is the set of length-zz9 words whose autocorrelation has uu0 as a suffix, then for uu1,

uu2

This transfers pair-overlap enumeration to autocorrelation counting, where Guibas–Odlyzko recurrences apply. The resulting framework yields explicit formulas for the number uu3 of pairs whose longest border has exactly length uu4, and therefore for

uu5

This resolved an open question raised by Gabric in 2022 (Rivals et al., 2024).

The asymptotic conclusion is striking. Let uu6 be the length of the longest border of a random pair uu7. Then

uu8

Thus the expected longest overlap between two random words diverges with uu9. The proof uses asymptotic bounds for population ratios of the form

vv0

which imply that, for each fixed overlap structure vv1, the corresponding correlation class occupies a positive asymptotic fraction of all ordered pairs (Rivals et al., 2024).

This creates a sharp contrast with the shortest-overlap theory. In the same random-pair model, the expected shortest overlap converges to a finite constant, while the expected longest overlap diverges. The divergence is slower for larger alphabets, but it persists for every fixed vv2.

4. Zero-overlap codes and codes with restricted overlaps

A block code vv3 is non-overlapping if for every pair of not necessarily distinct codewords vv4 and every vv5, no length-vv6 prefix of one equals a length-vv7 suffix of the other in either direction. In such a code, if two codewords are chosen independently and uniformly from vv8, the probability of a non-trivial prefix–suffix overlap is exactly zero (Stanovnik et al., 2023).

The central extremal parameter is

vv9

Known exact results include

(u,v)(u,v)0

and the Blackburn construction is maximum when (u,v)(u,v)1. Recent work characterizes maximal non-overlapping codes through a recursive partition system (u,v)(u,v)2 and formulates the maximum-size problem as an integer optimization problem (Stanovnik et al., 2023).

Restricted-overlap codes interpolate between unrestricted random codebooks and non-overlapping codes. A code is (u,v)(u,v)3-overlap-free if no two not necessarily distinct codewords have a (u,v)(u,v)4-overlap for (u,v)(u,v)5. Important special cases are (u,v)(u,v)6-overlap-free codes, which prohibit overlaps of lengths (u,v)(u,v)7, and (u,v)(u,v)8-overlap-free codes, which prohibit medium-to-long overlaps (Stanovnik, 2024).

The maximum size (u,v)(u,v)9 of a (v,u)(v,u)0-overlap-free code satisfies the general upper bound

(v,u)(v,u)1

and when (v,u)(v,u)2,

(v,u)(v,u)3

For (v,u)(v,u)4-overlap-free codes with (v,u)(v,u)5, one has

(v,u)(v,u)6

where (v,u)(v,u)7 is the number of primitive words of length (v,u)(v,u)8 (Stanovnik, 2024).

Earlier bounds already showed the same tradeoff in interval-forbidden models. If (v,u)(v,u)9 is σ\sigma00-overlap-free, then

σ\sigma01

and if σ\sigma02 is σ\sigma03-overlap-free with σ\sigma04, then

σ\sigma05

In the binary case, explicit constructions give

σ\sigma06

and for σ\sigma07 a power of two,

σ\sigma08

These results show that one can eliminate all overlaps in a prescribed length range while keeping the code size within a controlled factor of the ambient space (Blackburn et al., 2022).

5. Density limits for overlap-free codebook pairs

A bipartite version of the problem considers two sets σ\sigma09 such that no suffix of a word in σ\sigma10 coincides with a prefix of a word in σ\sigma11. Writing

σ\sigma12

Zakharov proves that

σ\sigma13

More precisely, if σ\sigma14 is the set of words that do not overlap with any element of σ\sigma15, and

σ\sigma16

then

σ\sigma17

which yields the product bound above (Zakharov, 23 Feb 2026).

This inequality is an isoperimetric constraint on zero-overlap design. If σ\sigma18 and σ\sigma19 are viewed as two codebooks and a random pair σ\sigma20 is drawn uniformly from σ\sigma21, then the overlap probability is exactly zero by construction, but the joint density of the support satisfies

σ\sigma22

In the balanced case σ\sigma23, each codebook can occupy at most about a σ\sigma24 fraction of the ambient space.

The bound is sharp up to a factor of σ\sigma25. The paper gives constructions for which

σ\sigma26

so that

σ\sigma27

A plausible implication is that the σ\sigma28 law is the correct asymptotic scale for two-codebook zero-overlap design, even though the exact optimal constant remains between σ\sigma29 and σ\sigma30 in the regimes analyzed.

6. Hamming-domain overlap in overlapped arithmetic codes

In overlapped arithmetic coding, “expected codeword overlap” is studied in a different sense. A binary source block σ\sigma31 is mapped many-to-one into a syndrome σ\sigma32, producing cosets

σ\sigma33

The code-level Hamming Distance Spectrum is

σ\sigma34

where σ\sigma35 counts the number of sequences in the same coset as σ\sigma36 and at Hamming distance σ\sigma37. This quantity is the expected number of same-coset neighbors at distance σ\sigma38, and it is therefore a natural expected-overlap metric in the Hamming domain (Fang, 2023).

The Coset Cardinality Spectrum σ\sigma39 describes asymptotic normalized coset sizes. Its relation to HDS is summarized by

σ\sigma40

Hence σ\sigma41 is a scalar measure of coset unevenness, and larger values increase total expected overlap across Hamming distances. For large distances σ\sigma42, the bridge result gives

σ\sigma43

Thus CCS controls HDS both globally, through σ\sigma44, and in the high-distance tail, through σ\sigma45 (Fang, 2023).

This model is distinct from prefix–suffix overlap, but it serves the same analytical purpose: it quantifies how strongly codewords collide under a specified decoding structure. In Slepian–Wolf applications, large σ\sigma46 at small σ\sigma47 signals many near-collisions within a coset, while large σ\sigma48 signals heavy overall collision concentration.

7. Conceptual synthesis

The current theory supports three main conclusions about expected codeword overlap. First, the answer depends on which overlap statistic is being averaged. For random pairs of words, the expected shortest overlap converges to a finite constant, while the expected longest overlap diverges with blocklength (Gabric, 2020, Rivals et al., 2024).

Second, zero-overlap guarantees are combinatorially expensive but quantitatively tractable. Non-overlapping and restricted-overlap codes suppress overlap events exactly, and the corresponding extremal functions σ\sigma49 and σ\sigma50 specify how much codebook size must be sacrificed to do so (Stanovnik et al., 2023, Stanovnik, 2024, Blackburn et al., 2022).

Third, overlap can be studied either as a prefix–suffix phenomenon or as a same-coset Hamming collision phenomenon. The former dominates the combinatorics-on-words and synchronization literature; the latter arises in overlapped arithmetic coding. The underlying methodological theme is the same in both cases: expected overlap is controlled by exact counting of admissible coincidence patterns, whether encoded as borders, correlations, forbidden overlap intervals, or coset spectra.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Expected Codeword Overlap.