The theory of congruences created by Gauss long ago is used in error control coding or error correction. The theory of congruences is frequently used to append an extra check digit to identification numbers, in order to recognize transmission errors or forgeries. Personal identification numbers of some kind appear in passports, credit cards, bank accounts, and a variety of other settings.
Some banks use (perhaps) an eight-digit identification number together with a final check digit . The check digit is usually obtained by multiplying the digits for by certain “weights” and calculating the sum of the weighted products modulo 10. For instance, the check digit might be chosen to satisfy:
The identification number 815042169 would be printed on the cheque.
This weighting scheme for assigning cheque digits detects any single digit error in the identification number. For suppose that the digit is replaced by a different . By the manner in which the check digit is calculated, the difference between the correct and the new is
where k is 7, 3, or 9 depending on the position of . Because , it follows that and the error is apparent. Thus, if the valid number 81504216 were incorrectly entered as 81504316 into a computer programmed to calculate check digits, an 8 would come up rather than the expected 9.
The modulo 10 approach is not entirely effective, for it does not always detect the common error of transposing distinct adjacent entries a and b within the string of digits. To illustrate, the identification numbers 81504216 and 81504261 have the same check digit 9 when our example weights are used. (The problem occurs when ). More sophisticated methods are available, with larger moduli and different weights, that would prevent this possible error.