Check codes are designed to pick up common errors such as transposing two digits or miscopying a single digit.
A person types the code number into a machine which decides whether it is a valid code or not. If someone types in a
US Postal Service Money Order number and makes a single error, just one mistake in one digit, will the machine pick
up every error of this type? Will a machine always pick up an error in a single digit for an airline ticket number?
US Postal Service Money Order: This is an eleven digit number using digits 1,2,...9 where the sum of the
first ten digits is congruent to the eleventh digit modulo 9.
That is
where
mod
.
Airline tickets: This number can be any length. It uses the digits 0 to 9 and the last digit is a check digit.
The number formed by omitting the check digit must be congruent to the check digit modulo 7.
That is
where
mod 7.