The check didgit of barcodes

The check digit in barcodes is the rightmost digit \(C\) and is calculated from the remaining twelve digits in the following way:

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

where \(x_{1}\) is the first digit of barcode, \(x_{2}\) is the second one, \(x_{3}\) is the third one, etc.



Note that we are using Modular Arithmetic.



Does this algorithm avoid most errors?




Note: This barcode system is the EAN (European Article Number) that identifies each product by a number with 13 digits. One may also find in supermarkets many products (produced in the USA) with the UPC (Universal Product Code) barcode system. UPC numbers have only 12 digits but the algorithm for computing \(C\) is similar.