Advanced Topics · Lesson 10
Autocorrelation and the Guibas–Odlyzko Formula
The autocorrelation word
The avoidance automaton keeps track of every partial match. A second approach records only the ways in which the whole pattern can overlap itself.
For a nonempty pattern , define its autocorrelation word by
So exactly when the length- prefix and suffix agree. We include , so . Write
The autocorrelation word records where a prefix and suffix of 01001 of the same
length agree. A 1 marks an overlap; a 0 marks a mismatch.
| r | prefix | suffix | α[r] |
|---|---|---|---|
| 1 | 0 | 1 | 0 |
| 2 | 01 | 01 | 1 |
| 3 | 010 | 001 | 0 |
| 4 | 0100 | 1001 | 0 |
| 5 | 01001 | 01001 | 1 |
01001 B(P) = {2, 5} RP(X) = X + X⁴For 01001, the only proper border is 01, so and . Two copies of 010 can overlap in a single 0, but not in two positions, because 01 ≠ 10 — that is .
The autocorrelation polynomial, indexed by overlap length, is
For 01001, .
Two counting identities
Recall that counts the length- words avoiding . Let count the length- words containing exactly one occurrence of , which must appear at the end (the first occurrence ends at position ).
For the first identity, take a word of length that avoids . Appending any of the letters either keeps the result avoiding or creates exactly one occurrence, ending at the new final position. Deleting the last letter inverts this, proving .
For the second, append the whole pattern to . In , look at the shortest prefix ending in , say . The word is a nonempty prefix of the appended and also a suffix of the occurrence at the end, so is both a prefix and a suffix of . If , then and is counted by . Summing over all such gives the identity.
For 01001, since , the second identity reads
With , , whose shortest prefix ending in is 01001 = x01. Thus and .
Practice
Find the autocorrelation word
What is the autocorrelation word of 0011? Write a 0/1 string.
What is the autocorrelation word of 1110101011? Write a 0/1 string.
Practice this topic →Every quiz from this lesson, at four difficulties.