Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Encoding and Encrypting Information: Understanding UPCs and ISBNs, Study notes of Mathematics

How universal product codes (upcs) and international standard book numbers (isbns) encode and verify information to ensure accuracy and prevent errors. Learn about the calculation of check digits for upcs and isbns, and the importance of these identification systems.

Typology: Study notes

Pre 2010

Uploaded on 08/09/2009

koofers-user-na4
koofers-user-na4 🇺🇸

1

(1)

10 documents

1 / 25

Toggle sidebar

Related documents


Partial preview of the text

Download Encoding and Encrypting Information: Understanding UPCs and ISBNs and more Study notes Mathematics in PDF only on Docsity! Encoding and Encrypting Information Information is often encoded numerically. By using some mathematics to encode information in an appropriate way, we can overcome problems encountered in dealing with the information. Different situations have different problems. We will consider three different ways to encode information to overcome three different types of problems. Each type we will introduce with one type of situation. 2 Commercial products, such as grocery store items, are identified with a universal product code. This 12 digit numerical code uniquely identifies an item. It appears on the item both as a number and as a bar code. 5 The UPC The first string of digits (after the first) identify the manufacturer, and the second string of digits identify the item. The last digit is the one we will focus on. It is called the check digit. Its purpose is to detect errors. We shall see that if one single digit in the UPC is misread, then the resulting sequence will be determined to be invalid. 6 To see if a 12 digit sequence of digits is a valid UPC perform the following computation: multiply the first, third, fifth,..., digits by 3, and the others by 1. Add up the resulting numbers. If the sum is evenly divisible by 10, then the sequence is a valid UPC. For example, consider the sequence 7 18908 14447 3. 7 weights digits product 3 1 3 1 3 1 3 1 3 1 3 1 Sum 7 1 8 9 0 8 1 4 4 4 7 3 21 1 24 9 0 8 3 4 12 4 21 3 110 Suppose 0 25192 59452 ? is to be a UPC. What should be the check digit? We repeat the calculation to check for validity. 10 weights digits 3 1 3 1 3 1 3 1 3 1 3 1 sum 0 2 5 1 9 2 5 9 4 5 2 ? 0 2 15 1 27 2 15 9 12 5 6 ? 94 + ? This sum needs to be divisible by 10, and ? must be a digit. The only digit that works is 6; the sum is then 100. So, the check digit is 6, and the full UPC is 0 25192 59452 6. Another way to find the check digit is to take the sum of 94, divide by 10. 10 goes into 94 nine times with 4 left over. Subtract the left over from 10 to get the check digit The numbers 3 and 1 used in the calculation are called weights. We shall see other weights in other identification number schemes. 11 To summarize, to find the check digit for a UPC, take the first part of the number, multiply each digit by the corresponding weight number (3 or 1), add up all the terms. Either divide the result by 10, and subtract the remainder from 10 to get the check digit. Alternatively, find the digit (0 through 9) which when added to the sum results in a number evenly divisible by 10. There is a unique digit which will make the calculation work above. 12 To Find the Check Digit for a UPC 2. If 0 12569 50162 x is to be a valid UPC, what should be the value of x? x must then be 1 in order for the sum to be divisible by 10. The UPC is then 0 12569 50162 1. 15 3 1 3 1 3 1 3 1 3 1 3 1 Sum 0 1 2 5 6 9 5 0 1 6 2 x 0 1 6 5 18 9 15 0 3 6 6 x 69 + x The purpose of the check digit is to detect an error in one of the digits. If a UPC is read and any single digit is read incorrectly, then the resulting sequence will not be valid. For example, if 7 18908 14447 3 is read as 7 19908 14447 3 by misreading the third digit as 9 rather than 8, then when one performs the calculation, one gets the resulting sum is not evenly divisible by 10, so the sequence is not valid. 16 weights digits 3 1 3 1 3 1 3 1 3 1 3 1 Sum 7 1 9 9 0 8 1 4 4 4 7 3 21 1 27 9 0 8 3 4 12 4 21 3 113 A similar result will occur if any of the digits is changed. However, this scheme does not always detect multiple errors. For example, if 7 18908 14447 3 is read as 7 19608 14447 3, then the resulting calculation yields and the sequence would be considered to be a valid UPC. This sort of scheme is then useful only when it is very unlikely to make multiple errors. 17 weights digits 3 1 3 1 3 1 3 1 3 1 3 1 Sum 7 1 9 6 0 8 1 4 4 4 7 3 21 4 27 6 0 8 3 4 12 4 21 3 110 To verify if a sequence is a valid ISBN, we perform the following calculation, which we illustrate with the ISBN 0-387-94753-1 If the sum is evenly divisible by 11, then the sequence is valid. Since 264 / 11 = 24, a whole number, the sequence is indeed valid. In other words, you multiply the first digit by 10, the second digit by 9, the third by 8, and so on, and then add all terms. The sequence is valid if the sum is evenly divisible by 11. 20 10 9 8 7 6 5 4 3 2 1 Sum 0 3 8 7 9 4 7 5 3 1 0 27 64 49 54 20 28 15 6 1 264 Use of the check digit allows us to detect single errors in an ISBN. For example, if we take the ISBN 0-387-94753-1 and change the 8th digit from 5 to 6, obtaining 0-387-94763-1, and perform the calculation to check validity, we get Dividing 267 by 11 gives 24.27, not a whole number. So, 0-387-94763-1 is not a valid ISBN. 21 10 9 8 7 6 5 4 3 2 1 Sum 0 3 8 7 9 4 7 6 3 1 0 27 64 49 54 20 28 18 6 1 267 Finding the check digit for an ISBN is similar to that of a UPC. However, there is one difference that using 11, rather than 10, forces. For example, suppose that 0-14-010867 is to be the first part of an ISBN. What is the check digit? We compute If we divide 111 by 11, we see that 11 goes into 111 ten times with a remainder of 1. If we subtract the remainder from 11, we will get the check digit. However, this gives 10. To handle this case, the check digit is written as X. So, the full ISBN is 0-14-010867-X. 22 weights digits 10 9 8 7 6 5 4 3 2 1 Sum 0 1 4 0 1 0 8 6 7 ? 0 9 32 0 6 0 32 18 14 ? 111 + ?
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved