ArticleslgStudy

science

Autocorrelation (words)

Autocorrelation (words) is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Autocorrelation (words) rather than just read about it. In short: In combinatorics, a branch of mathematics, the autocorrelation of a word is the set of periods of this word. More precisely, it is a sequence of values which indicate how much the end of a word looks likes the beginning of a word.

Key takeaways

  • Autocorrelation (words) belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Autocorrelation (words) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Autocorrelation (words) from memory before moving on to harder problems.

Reference excerpt

In combinatorics, a branch of mathematics, the autocorrelation of a word is the set of periods of this word. More precisely, it is a sequence of values which indicate how much the end of a word looks likes the beginning of a word. This value can be used to compute, for example, the average value of the first occurrence of this word in a random string.

Definition In this article, A is an alphabet, and w=w1…wn a word on A of length n. The autocorrelation of w can be defined as the correlation of w with itself. However, we redefine this notion below.

Autocorrelation vector The autocorrelation vector of w is c=(c0,…,cn−1), with ci being 1 if the prefix of length n−i equals the suffix of length n−i, and with ci being 0 otherwise. That is ci indicates whether wi+1…wn=w1…wn−i. For example, the autocorrelation vector of aaa is (1,1,1) since, clearly, for i being 0, 1 or 2, the prefix of length n−i is equal to the suffix of length n−i. The autocorrelation vector of abb is (1,0,0) since no strict prefix is equal to a strict suffix. Finally, the autocorrelation vector of aabbaa is 100011, as shown in the following table:

Note that c0 is always equal to 1, since the prefix and the suffix of length n are both equal to the word w. Similarly, cn−1 is 1 if and only if the first and the last letters are the same.

Autocorrelation polynomial The autocorrelation polynomial of w is defined as c(z)=c0z0+⋯+cn−1zn−1. It is a polynomial of degree at most n−1. For example, the autocorrelation polynomial of aaa is 1+z+z2 and the autocorrelation polynomial of abb is 1. Finally, the autocorrelation polynomial of aabbaa is 1+z4+z5.

Property We now indicate some properties which can be computed using the autocorrelation polynomial.

First occurrence of a word in a random string Suppose that you choose an infinite sequence s of letters of A, randomly, each letter with probability 1|A|, where |A| is the number of letters of A. Let us call E the expectation of the first occurrence of ?m in s? . Then E equals |A|nc(1|A|). That is, each subword v of w which is both a prefix and a suffix causes the average value of the first occurrence of w to occur |A||v| letters later. Here |v| is the length of v. For example, over the binary alphabet A={a,b}, the first occurrence of aa is at position 22(1+12)=6 while the average first occurrence of ab is at position 22(1)=4. Intuitively, the fact that the first occurrence of aa is later than the first occurrence of ab can be explained in two ways:

We can consider, for each position p, what are the requirement for w's first occurrence to be at p. The first occurrence of ab can be at position 1 in only one way in both case. If s starts with w. This has probability 14 for both considered values of w. The first occurrence of ab is at position 2 if the prefix of s of length 3 is aab or is bab. However, the first occurrence of aa is at position 2 if and only if the prefix of s of length 3 is baa. (Note that the first occurrence of aa in aaa is at position 1.). In general, the number of prefixes of length n+1 such that the first occurrence of aa is at position n is smaller for aa than for ba. This explain why, on average, the first aa arrive later than the first ab. We can also consider the fact that the average number of occurrences of w in a random string of length l is |A|l−n. This number is independent of the autocorrelation polynomial. An occurrence of w may overlap another occurrence in different ways. More precisely, each 1 in its autocorrelation vector correspond to a way for occurrence to overlap. Since many occurrences of w can be packed together, using overlapping, but the average number of occurrences does not change, it follows that the distance between two non-overlapping occurrences is greater when the autocorrelation vector contains many 1's.

Ordinary generating functions Autocorrelation polynomials allows to give simple equations for the ordinary generating functions (OGF) of many natural questions.

The OGF of the languages of words not containing w is c(z)zn+(1−|A|z)c(z). The OGF of the languages of words containing w is zn(1−|A|z)(zn+(1−|A|z)c(z)). The OGF of the languages of words containing a single occurrence of w, at the end of the word is znzn+(1−|A|z)c(z).

References Flajolet and Sedgewick (2010). Analytic Combinatorics. New York: Cambridge University Press. pp. 60-61. ISBN 978-0-521-89806-5. Rosen, Ned. "Expected waiting times for strings of coin flips" (PDF). Retrieved 3 December 2017. Odlyzko, A. M.; Guibas, L. J. (1981). "String overlaps, pattern matching, and nontransitive games". Journal of Combinatorial Theory. Series A 30 (2): 183–208. doi:10.1016/0097-3165(81)90005-4.

Worked examples

Example 1 — a first encounter with Autocorrelation (words)

Start with the simplest possible case. Write down what Autocorrelation (words) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Autocorrelation (words) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Autocorrelation (words) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Autocorrelation (words)

In research
Autocorrelation (words) appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Autocorrelation (words) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Autocorrelation (words) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Combinatorics on words, Formal languages, so understanding it makes those chapters shorter.
In everyday life
Look for Autocorrelation (words) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Autocorrelation (words)” →

How to study Autocorrelation (words) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Autocorrelation (words) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Autocorrelation (words) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Autocorrelation (words) in simple terms?

In combinatorics, a branch of mathematics, the autocorrelation of a word is the set of periods of this word. More precisely, it is a sequence of values which indicate how much the end of a word looks likes the beginning of a word.

Why does Autocorrelation (words) matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Autocorrelation (words)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Autocorrelation (words).

Tags

  • Combinatorics on words
  • Formal languages

Keep exploring