ArticleslgStudy

computer science

Verhoeff algorithm

Verhoeff algorithm is a computer 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 Verhoeff algorithm rather than just read about it. In short: The Verhoeff algorithm is a checksum for error detection first published by Dutch mathematician Jacobus Verhoeff in 1969. It was the first decimal check digit algorithm that detects all single-digit errors, and all transposition errors involving two adjacent digits, which was at the time thought impossible with such a code.

Key takeaways

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

Reference excerpt

The Verhoeff algorithm is a checksum for error detection first published by Dutch mathematician Jacobus Verhoeff in 1969. It was the first decimal check digit algorithm that detects all single-digit errors, and all transposition errors involving two adjacent digits, which was at the time thought impossible with such a code. The method was independently discovered by H. Peter Gumm in 1985, this time including a formal proof and an extension to any base.

Goals Verhoeff had the goal of finding a decimal code—one where the check digit is a single decimal digit—which detected all single-digit errors and all transpositions of adjacent digits. At the time, supposed proofs of the nonexistence of these codes made base-11 codes popular, for example in the ISBN check digit. His goals were also practical, and he based the evaluation of different codes on live data from the Dutch postal system, using a weighted points system for different kinds of error. The analysis broke the errors down into a number of categories: first, by how many digits are in error; for those with two digits in error, there are transpositions (ab → ba), twins (aa → bb), jump transpositions (abc → cba), phonetic (1a → a0), and jump twins (aba → cbc). Additionally there are omitted and added digits. Although the frequencies of some of these kinds of errors might be small, some codes might be immune to them in addition to the primary goals of detecting all singles and transpositions. The phonetic errors in particular showed linguistic effects, because in Dutch, numbers are typically read in pairs; and also while 50 sounds similar to 15 in Dutch, 80 does not sound like 18. Taking six-digit numbers as an example, Verhoeff reported the following classification of the errors:.

Description The general idea of the algorithm is to represent each of the digits (0 through 9) as elements of the dihedral group D5. That is, map digits to D5, manipulate these, then map back into digits. Let this mapping be m : [0, 9] → D5

m = ( 0 1 2 3 4 5 6 7 8 9 e r r 2 r 3 r 4 s r s r 2 s r 3 s r 4 s ) {\displaystyle m={\begin{pmatrix}0&1&2&3&4&5&6&7&8&9\\e&r&r^{2}&r^{3}&r^{4}&s&rs&r^{2}s&r^{3}s&r^{4}s\end{pmatrix}}}

Let the nth digit be an and let the number of digits be k. For example given the code 942 then k is 3 and a3 = m(2) = r2. Now define the permutation f : D5 → D5

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Verhoeff algorithm

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

In research
Verhoeff algorithm appears in computer 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 Verhoeff algorithm 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
Verhoeff algorithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics 1969 introductions, Checksum algorithms, Error detection and correction, so understanding it makes those chapters shorter.
In everyday life
Look for Verhoeff algorithm 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 “Verhoeff algorithm” →

Affiliate

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

How to study Verhoeff algorithm in 20 minutes

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

Frequently asked questions

What is Verhoeff algorithm in simple terms?

The Verhoeff algorithm is a checksum for error detection first published by Dutch mathematician Jacobus Verhoeff in 1969. It was the first decimal check digit algorithm that detects all single-digit errors, and all transposition errors involving two adjacent digits, which was at the time thought im…

Why does Verhoeff algorithm matter?

Because it connects several computer 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 Verhoeff algorithm?

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 Verhoeff algorithm.

Tags

  • 1969 introductions
  • Checksum algorithms
  • Error detection and correction
  • Modular arithmetic

Keep exploring