Type of errors detected by the Portuguese ID Card scheme
(if it had been designed correctly...)
First, it is necessary to identify what are the most common errors people make when they are dealing with the transcription of numbers with many digits(of course, no one makes mistakes in EVERY digit, unless on purpose!). The most common error is a mistake on a single digit (singular error); for example, instead of writing the number \(12345678\) (with check digit \(9\)), one writes \(12345978\) (the corresponding check digit would be \(8\)). Note that this type of error is detected in 100% of cases, since we are multiplying each of the digits of the number by different weights. In the example above, the sixth addend in the checksum becomes \(4 \times 9 = 36\) instead of the original \(4 \times 6 = 24\). The fact that \(11\) (the modulus) is a prime number ensures that when you do this type of error, the check digit will detect it. Another frequent error is a transposition of two consecutive digits; for example, instead of writing \(12345678\) (with check digit \(9\)), suppose one writes \(12345768\) (the check digit of this number will be \(8\)). In this case, the check digit also detects the change (simply because consecutive digits have different weights). In the example above, we are swapping \(4 \times 6 + 3 \times 7 = 45\) by \(4 \times 7 + 3 \times 6 = 46\) in the check sum. It is now easy to see that this system detects all transpositions, even when digits are not adjacent!.
To check the detection rate of these two types of errors (or simply if you want to know if your Identity Card number is correct), click here.
To know more about error detection in these identification systems, click here.
Note that even other types of errors (much less frequent than the other two presented above) can be detected with this check digit system. For example, consider the swap \(12345678\) (\(9\)) → \(12345558\) (\(8\)). The difference is that not all such errors are detected - for example, consider the swap \(12345678\) (\(9\)) →\(12345888\) (\(9\)). This example illustrates that for a number to be correctly transcribed it is necessary that the check digit is correct, but the converse is not true. That is, the fact that the check digit is correct does not imply that the transcript of the number was done correctly.
Beyond this example, check digits are used in many other systems like, for instance, barcodes, banknotes, Visa Cards, Bank Account Numbers, ...