Expected Codeword Overlap Analysis
- 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 of size , and let denote the set of words of length . For an ordered pair , a border of the pair is a non-empty word that is both a suffix of and a prefix of . The overlap relation is directional: borders of and are counted separately. The longest-border random variable is
0
with 1 representing the absence of a non-empty overlap (Rivals et al., 2024).
The same overlap structure can be encoded by the correlation vector
2
A 3 at position 4 records a border of length 5, and the leftmost 6 determines the longest border. A central structural fact is
7
where 8 is the set of autocorrelations of words of length 9. 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 0, 1 is the shortest right-border of 2 if one exists, and 3 otherwise; 4, with 5 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 6 of unbordered words of length 7. A key lemma states that the shortest overlap word is unbordered: if 8 is both a proper suffix of 9 and a proper prefix of 0, then 1 if and only if 2 is unbordered. This reduces the distribution of shortest overlaps to unbordered-word counting (Gabric, 2020).
Let 3 for two independently and uniformly chosen words 4. If 5 denotes the number of ordered pairs with 6, then
7
Consequently,
8
and
9
As 0,
1
and the series converges. Hence the expected shortest overlap is 2, with the constant depending on the alphabet size 3 (Gabric, 2020).
The paper also gives numerical values for the limiting expectation.
| 4 | 5 |
|---|---|
| 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 6 of mutually bordered pairs satisfies
7
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 8, the population
9
counts ordered pairs with exactly that overlap pattern. If 0 with 1, then the one-sided population size is
2
because the first 3 symbols of the right word must realize the autocorrelation 4, while the remaining 5 symbols are free (Rivals et al., 2024).
The key reduction embeds a pair into a single word 6 of length 7. If 8 is the set of length-9 words whose autocorrelation has 0 as a suffix, then for 1,
2
This transfers pair-overlap enumeration to autocorrelation counting, where Guibas–Odlyzko recurrences apply. The resulting framework yields explicit formulas for the number 3 of pairs whose longest border has exactly length 4, and therefore for
5
This resolved an open question raised by Gabric in 2022 (Rivals et al., 2024).
The asymptotic conclusion is striking. Let 6 be the length of the longest border of a random pair 7. Then
8
Thus the expected longest overlap between two random words diverges with 9. The proof uses asymptotic bounds for population ratios of the form
0
which imply that, for each fixed overlap structure 1, 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 2.
4. Zero-overlap codes and codes with restricted overlaps
A block code 3 is non-overlapping if for every pair of not necessarily distinct codewords 4 and every 5, no length-6 prefix of one equals a length-7 suffix of the other in either direction. In such a code, if two codewords are chosen independently and uniformly from 8, the probability of a non-trivial prefix–suffix overlap is exactly zero (Stanovnik et al., 2023).
The central extremal parameter is
9
Known exact results include
0
and the Blackburn construction is maximum when 1. Recent work characterizes maximal non-overlapping codes through a recursive partition system 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 3-overlap-free if no two not necessarily distinct codewords have a 4-overlap for 5. Important special cases are 6-overlap-free codes, which prohibit overlaps of lengths 7, and 8-overlap-free codes, which prohibit medium-to-long overlaps (Stanovnik, 2024).
The maximum size 9 of a 0-overlap-free code satisfies the general upper bound
1
and when 2,
3
For 4-overlap-free codes with 5, one has
6
where 7 is the number of primitive words of length 8 (Stanovnik, 2024).
Earlier bounds already showed the same tradeoff in interval-forbidden models. If 9 is 00-overlap-free, then
01
and if 02 is 03-overlap-free with 04, then
05
In the binary case, explicit constructions give
06
and for 07 a power of two,
08
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 09 such that no suffix of a word in 10 coincides with a prefix of a word in 11. Writing
12
Zakharov proves that
13
More precisely, if 14 is the set of words that do not overlap with any element of 15, and
16
then
17
which yields the product bound above (Zakharov, 23 Feb 2026).
This inequality is an isoperimetric constraint on zero-overlap design. If 18 and 19 are viewed as two codebooks and a random pair 20 is drawn uniformly from 21, then the overlap probability is exactly zero by construction, but the joint density of the support satisfies
22
In the balanced case 23, each codebook can occupy at most about a 24 fraction of the ambient space.
The bound is sharp up to a factor of 25. The paper gives constructions for which
26
so that
27
A plausible implication is that the 28 law is the correct asymptotic scale for two-codebook zero-overlap design, even though the exact optimal constant remains between 29 and 30 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 31 is mapped many-to-one into a syndrome 32, producing cosets
33
The code-level Hamming Distance Spectrum is
34
where 35 counts the number of sequences in the same coset as 36 and at Hamming distance 37. This quantity is the expected number of same-coset neighbors at distance 38, and it is therefore a natural expected-overlap metric in the Hamming domain (Fang, 2023).
The Coset Cardinality Spectrum 39 describes asymptotic normalized coset sizes. Its relation to HDS is summarized by
40
Hence 41 is a scalar measure of coset unevenness, and larger values increase total expected overlap across Hamming distances. For large distances 42, the bridge result gives
43
Thus CCS controls HDS both globally, through 44, and in the high-distance tail, through 45 (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 46 at small 47 signals many near-collisions within a coset, while large 48 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 49 and 50 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.