Type of errors detected by Bacode scheme
First, let us see what happens when a singular error occurs (an error in just one digit). When we make a mistake in a digit in a odd position \((x_{1}, x_{3}, ...)\) it is obvious that the check digit of the new number code will be diferent. The same happens in case of digits in even positions \((x_{2}, x_{4}, ...)\), since the weight \(3\) is a number prime with \(10\). Observe an example: suppose that instead of the barcode \(1\;\;234567 \;\;89123C\), we write \(1\;\;234557\;\;89123C\). What happens in the checksum with respect to the part corresponding to \(x_{6}\)? In the correct barcode it is equal to \(6 \times 3 = 8 (\mbox{mod }10)\), while in the wrong one we have \(5 \times 3 = 5 (\mbox{mod }10)\). It may be easily checked that, whatever digit different from \(6\) comes in position 6, the part corresponding to \(x_{6}\) in the cheksum will change and, therefore, the check digit \(C\) will change. Hence , any singular error is detected by this check digit.
What about adjacent transpositions (permutation of two consecutive digits)? Let us check the case of the first two digits of the barcode. The following table depicts the sum of the addends correspondent to \(x_{1}\) and \(x_{2}\) (modulus \(10\)), as well as the sum in case the two digits are interchanged (in brackets).
\[x_{2}\] | |||||||||||
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ||
\(x_{1}\) | 0 | 0 (0) | 3 (1) | 6 (2) | 9 (3) | 2 (4) | 5 (5) | 8 (6) | 1 (7) | 4 (8) | 7 (9) |
1 | 1 (3) | 4 (4) | 7 (5) | 0 (6) | 3 (7) | 6 (8) | 9 (9) | 2 (0) | 5 (1) | 8 (2) | |
2 | 2 (6) | 5 (7) | 8 (8) | 1 (9) | 4 (0) | 7 (1) | 0 (2) | 3 (3) | 6 (4) | 9 (5) | |
3 | 3 (9) | 6 (0) | 9 (1) | 2 (2) | 5 (3) | 8 (4) | 1 (5) | 4 (6) | 7 (7) | 0 (8) | |
4 | 4 (2) | 7 (3) | 0 (4) | 3 (5) | 6 (6) | 9 (7) | 2 (8) | 5 (9) | 8 (0) | 1 (1) | |
5 | 5 (5) | 8 (6) | 1 (7) | 4 (8) | 7 (9) | 0 (0) | 3 (1) | 6 (2) | 9 (3) | 2 (4) | |
6 | 6 (8) | 9 (9) | 2 (0) | 5 (1) | 8 (2) | 1 (3) | 4 (4) | 7 (5) | 0 (6) | 3 (7) | |
7 | 7 (1) | 0 (2) | 3 (3) | 6 (4) | 9 (5) | 2 (6) | 5 (7) | 8 (8) | 1 (9) | 4 (0) | |
8 | 8 (4) | 1 (5) | 4 (6) | 7 (7) | 0 (8) | 3 (9) | 6 (0) | 9 (1) | 2 (2) | 5 (3) | |
9 | 9 (7) | 2 (8) | 5 (9) | 8 (0) | 1 (1) | 4 (2) | 7 (3) | 0 (4) | 3 (5) | 6 (6) |
It shows that there are a few transpositions that will not be detected by the check digit system, namely the following transpositions: \(05\) ↔ \(50\), \(16\) ↔ \(61\), \(27\) ↔ \(72\), \(38\) ↔ \(83\), and \(49\) ↔ \(94\).
To check the detection rate of these two types of errors (or simply if you want to know if a barcode of some product you bought is correct) click here.
To know more about error detection in these identification systems, click here.
Beyond this example, check digits are used in many other systems like, for instance, Identity Cards, Bank Account Numbers, Visa Cards, banknotes,...