Type of errors detected by Visa card scheme

Consider first the case of singular errors (a mistake in a single digit): suppose that, instead of writing the VISA number \(1234\;\;5678\;\;9123\;\;456C\), we write \(1234\;\;5618\;\;9123\;\;456C\). Let us see what happens to the part corresponding to digit \(x_{7}\) in the checksum. In the given (corrected) Visa number, we have \(2 \times 7 = 14\), which is replaced by \(14 - 9 = 5\), while in the wrong number we have \(2 \times 1 = 2\). Hence, the check digit of the wrong number should be different from \(C\). It may be easily proved that this happens in any other singular error and, therefore, that this error-detecting code detects every singular erro.

What about transpositions of adjacent digits? In the case of the transposition of the first two digits \(x_{1}\) and \(x_{2}\), the following table shows the corresponding values (modulus 10) in the checksum of the original corrected number and, in brackets, of the number after the transposition:

\[x_{2}\]
0 1 2 3 4 5 6 7 8 9
\(x_{1}\) 0 0 (0) 2 (1) 4 (2) 6 (3) 8 (4) 1 (5) 3 (6) 5 (7) 7 (8) 9 (9)
1 1 (2) 3 (3) 5 (4) 7 (5) 9 (6) 2 (7) 4 (8) 6 (9) 8 (0) 0 (1)
2 2 (4) 4 (5) 6 (6) 8 (7) 0 (8) 3 (9) 5 (0) 7 (1) 9 (2) 1 (3)
3 3 (6) 5 (7) 7 (8) 9 (9) 1 (0) 4 (1) 6 (2) 8 (3) 0 (4) 2 (5)
4 4 (8) 6 (9) 8 (0) 0 (1) 2 (2) 5 (3) 7 (4) 9 (5) 1 (6) 3 (7)
5 5 (1) 7 (2) 9 (3) 1 (4) 3 (5) 6 (6) 8 (7) 0 (8) 2 (9) 4 (0)
6 6 (3) 8 (4) 0 (5) 2 (6) 4 (7) 7 (8) 9 (9) 1 (0) 3 (1) 5 (2)
7 7 (5) 9 (6) 1 (7) 3 (8) 5 (9) 8 (0) 0 (1) 2 (2) 4 (3) 6 (4)
8 8 (7) 0 (8) 2 (9) 4 (0) 6 (1) 9 (2) 1 (3) 3 (4) 5 (5) 7 (6)
9 9 (9) 1 (0) 3 (1) 5 (2) 7 (3) 0 (4) 2 (5) 4 (6) 6 (7) 8 (8)

You may conclude from the table that all adjacent transpositions are detected with one exception: the transposition \(09\) → \(90\) and vice-versa. Indeed, the part of the number checksum corresponding to the pair \(09\) is equal to \(2 \times 9 + 0 = 18\), which is replaced by \(18 - 9 = 9\), and the part corresponding to the pair \(90\) is equal to \(2 \times 0 + 9 = 9\), the same value.

To check the detection rate of these two types of errors (or simply if you want to check your Visa Card), click here.

To know more about error detection in these identification systems, click here.

Note: To avoid the shortcomings of the check digit presented above, Visa cards have currently three check digits, printed on the back of the card.

Beyond this example, check digits are used in many other systems like, for instance, Identity Cards, barcodes, Bank Account Numbers, banknotes, ...