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.
