ArticleslgStudy

mathematics

Normalized compression distance

Normalized compression distance is a mathematics 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 Normalized compression distance rather than just read about it. In short: Normalized compression distance (NCD) is a way of measuring the similarity between two objects, be it two documents, two letters, two emails, two music scores, two languages, two programs, two pictures, two systems, two genomes, to name a few. Such a measurement should not be application dependent or arbitrary.

Key takeaways

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

Reference excerpt

Normalized compression distance (NCD) is a way of measuring the similarity between two objects, be it two documents, two letters, two emails, two music scores, two languages, two programs, two pictures, two systems, two genomes, to name a few. Such a measurement should not be application dependent or arbitrary. A reasonable definition for the similarity between two objects is how difficult it is to transform them into each other. It can be used in information retrieval and data mining for cluster analysis.

Information distance We assume that the objects one talks about are finite strings of 0s and 1s. Thus we mean string similarity. Every computer file is of this form, that is, if an object is a file in a computer it is of this form. One can define the information distance between strings x {\displaystyle x} and y {\displaystyle y} as the length of the shortest program p {\displaystyle p} that computes x {\displaystyle x} from y {\displaystyle y} and vice versa. This shortest program is in a fixed programming language. For technical reasons one uses the theoretical notion of Turing machines. Moreover, to express the length of p {\displaystyle p} one uses the notion of Kolmogorov complexity. Then, it has been shown

| p | = max { K ( x ∣ y ) , K ( y ∣ x ) } {\displaystyle |p|=\max\{K(x\mid y),K(y\mid x)\}}

up to logarithmic additive terms which can be ignored. This information distance is shown to be a metric (it satisfies the metric inequalities up to a logarithmic additive term), is universal (it minorizes every computable distance as computed for example from features up to a constant additive term).

Normalized information distance (similarity metric) The information distance is absolute, but if we want to express similarity, then we are more interested in relative ones. For example, if two strings of length 1,000,000 differ by 1000 bits, then we consider that those strings are relatively more similar than two strings of 1000 bits that differ by 1000 bits. Hence we need to normalize to obtain a similarity metric. This way one obtains the normalized information distance (NID),

N I D ( x , y ) = max { K ( x ∣ y ) , K ( y ∣ x ) } max { K ( x ) , K ( y ) } , {\displaystyle NID(x,y)={\frac {\max\{K{(x\mid y)},K{(y\mid x)}\}}{\max\{K(x),K(y)\}}},}

where K ( x ∣ y ) {\displaystyle K(x\mid y)} is algorithmic information of x {\displaystyle x} given y {\displaystyle y} as input. The NID is called the similarity metric. Since the function N I D ( x , y ) {\displaystyle NID(x,y)} has been shown to satisfy the basic requirements for a metric distance measure. However, it is not computable or even semicomputable.

Normalized compression distance While the NID metric is not computable, it has an abundance of applications. Simply approximating K {\displaystyle K} by real-world compressors, Vitanyi and Cilibrasi rewrote the NID to obtain the Normalized Compression Distance (NCD). If Z ( x ) {\displaystyle Z(x)} is the binary length of file x {\displaystyle x} compressed with compressor Z {\displaystyle Z} (for example "gzip", "bzip2", "PPMZ") and Z ( x y ) {\displaystyle Z(xy)} denotes compressing the concatenation of x {\displaystyle x} and y {\displaystyle y} :

N C D Z ( x , y ) = Z ( x y ) − min { Z ( x ) , Z ( y ) } max { Z ( x ) , Z ( y ) } {\displaystyle NCD_{Z}(x,y)={\frac {Z(xy)-\min\{Z(x),Z(y)\}}{\max\{Z(x),Z(y)\}}}} The NCD is actually a family of distances parametrized with the compressor Z. The better Z is, the closer the NCD approaches the NID, and the better the results are.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Normalized compression distance

Start with the simplest possible case. Write down what Normalized compression distance claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, 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 Normalized compression distance 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 Normalized compression distance 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 Normalized compression distance

In research
Normalized compression distance appears in mathematics 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 Normalized compression distance 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
Normalized compression distance is common in secondary-school and first-year university syllabi. It links to neighbouring topics Statistical distance, so understanding it makes those chapters shorter.
In everyday life
Look for Normalized compression distance 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.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Normalized compression distance in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Normalized compression distance 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 Normalized compression distance out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Normalized compression distance in simple terms?

Normalized compression distance (NCD) is a way of measuring the similarity between two objects, be it two documents, two letters, two emails, two music scores, two languages, two programs, two pictures, two systems, two genomes, to name a few. Such a measurement should not be application dependent…

Why does Normalized compression distance matter?

Because it connects several mathematics 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 Normalized compression distance?

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 Normalized compression distance.

Tags

  • Statistical distance

Keep exploring