FANDOM


In error detection, the Damm algorithm is a check digit algorithm that detects all single-digit errors and all adjacent transposition errors. It was presented by H. Michael Damm in 2004. Its essential part is a quasigroup of order 10 (i.e. having a 10×10 Latin square as operation table) with the special feature of being totally anti-symmetric.[1][2][lower-roman 1][lower-roman 2] Damm revealed several methods to create such totally anti-symmetric quasigroups of order 10 and gave some examples in his doctoral dissertation.[1][lower-roman 1] With this, Damm also disproved an old conjecture that totally anti-symmetric quasigroups of order 10 do not exist.[3]

Algorithm

The validity of a digit sequence containing a check digit is defined over a quasigroup. A quasigroup table ready for use can be taken from Damm's dissertation (pages 98, 106, 111).[1] It is useful to use a totally anti-symmetric quasigroup where each diagonal entry is 0, because it simplifies the check digit calculation.

Validating a number against the included check digit

  1. Set up an interim digit and initialize it to 0.
  2. Process the number digit by digit: Use the number's digit as column index and the interim digit as row index, take the table entry and replace the interim digit with it.
  3. The number is valid if and only if the resulting interim digit has the value of 0.

Calculating the check digit

Prerequisite: The diagonal entries of the table are 0.

  1. Set up an interim digit and initialize it to 0.
  2. Process the number digit by digit: Use the number's digit as column index and the interim digit as row index, take the table entry and replace the interim digit with it.
  3. The resulting interim digit gives the check digit and will be appended as trailing digit to the number.

Example

The totally anti-symmetric quasigroup is taken from Damm's doctoral dissertation page 111.[1] It is modified by rearranging the columns and changing the entries correspondingly. This does not work on all cases.

0 1 2 3 4 5 6 7 8 9
0 0317598642
1 7092154863
2 4206871359
3 1750983426
4 6123045978
5 3674209581
6 5869720134
7 8945362017
8 9438617205
9 2581436790

Suppose we choose the number (digit sequence) 572.

Calculating the check digit

digit to be processed → column index 5 7 2
old interim digit → row index 0 9 7
table entry → new interim digit 9 7 4

The resulting interim digit is 4. This is the calculated check digit. We append it to the number and obtain 5724.

Validating a number against the included check digit

digit to be processed → column index 5 7 2 4
old interim digit → row index 0 9 7 4
table entry → new interim digit 9 7 4 0

The resulting interim digit is 0, hence the number is valid.

Graphical illustration

File:Check digit TA quasigroup dhmd111rr illustration eg5724.svg

Strengths and weaknesses

The Damm algorithm is similar to the Verhoeff algorithm. It too will detect all occurrences of altering one single digit and all occurrences of transposing two adjacent digits. (These are the two most frequently appearing types of transcription errors.)[4] But the Damm algorithm has the benefit that it makes do without the dedicatedly constructed permutations and its position specific powers being inherent in the Verhoeff scheme. Furthermore, a table of inverses can be dispensed with provided all diagonal entries of the operation table are zero.

The Damm algorithm does not suffer from exceeding the number of 10 possible values, resulting in the need for using a non-digit character (as the X in the 10-digit ISBN check digit scheme).

Prepending leading zeros does not affect the check digit.

There are totally anti-symmetric quasigroups that detect all phonetic errors associated with the English language (13 ↔ 30, 14 ↔ 40, ..., 19 ↔ 90). The table used in the illustrating example above represents an instance of such kind.

Despite its desirable properties in typical contexts where similar algorithms are used, the Damm algorithm is largely unknown and scarcely used in practice.

References

External links

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.