The check digit of Portuguese ID Card

The check digit of the Portuguese Identity Card (BI) is the digit \(C\) computed from the identification number in the following way:

\[9x_{1}+8x_{2}+7x_{3}+6x_{4}+5x_{5}+4x_{6}+3x_{7}+2x_{8}+C=0 (\mbox{mod }11)\]

where \(x_{1}\) is the first digit of the identification number, \(x_{2}\) is the second one, \(x_{3}\) is the third, etc. In case of BI numbers with less than eight digits add zeros on the left for the missing digits. For example, the identification number \(123456\) corresponds to \(00123456\).

Note that the sum above is the sum of Modular Arithmetic.

Specifically, \(C\) is the number that added to \(9x_{1}+8x_{2}+...+2x_{8}\) is a multiple of 11, that is, number \(C\) is such that \(9x_{1}+8x_{2}+...+2x_{8}+C\) is divisible by 11.

What are the possible values of the check digit? Since we have a division by 11, \(C\) may take the value \(0\) (when the division of \(9x_{1}+8x_{2}+...+2x_{8}\) by 11 has remainder 0), the value \(1\) (when the division of \(9x_{1}+8x_{2}+...+2x_{8}\) by 11 has remainder \(10\)), the value \(2\) (when the remainder of the division is \(9\)), etc., and lastly the value \(10\) (in case the division has remainder \(1\)).

A problem arises: there are eleven possibilities for the check digit, \(0, 1, 2, 3, ...9, 10\), but as a digit it must be some number in \((0, 1, 2, 3, ..., 9)\). How is this solved? A possible solution is the one in ISBN (International Standard Book Number) system - the identification system used for edited books, which is very similar to BI with the only difference that it shifts the order of the weights of each digit: it replaces the check number \(10\) by letter \(X\) (the motivation is obvious: \(X\) is \(10\) in Roman numerals). This way, the problem of using only one character for each check digit is solved in such a way that any two different check digits are represented by different symbols.

What about BI? How was that solved? The use of symbol \(X\), very different from the other current ten digits, in about 9% of the BI's of the Portuguese population, was regarded as a kind of discrimination and it was simply decided to delete the digit 1 from number 10, that is, all BI cards that should have check digit 10, have indeed check digit 0!!! So half of the cards with check digit 0 are wrong and get confused with the right ones. This spoils part of the capacity of error detection of the system.

Even worse: The Portuguese fiscal identification number (NIF) is similar to BI, with the same mistake replied in check digits.

Forgetting this "small mistake", what is the efficiency rate of this system?