When a product gets scanned at a checkout, how does it scan the barcode accurately?
Find an item that has a 12 or 13 digit product code on it, such as a can or box from the kitchen. Make sure you don’t show me the product code.
You may want to have a product with you already so you can show them what you mean by the product code, and how to count the digits.
How many digits are there under the bar code?
For this to work, there need to be either 12 or 13 digits (most products will have this many, such as the one shown here with 12 digits, although occasionally they will have 8, and some may have no barcode). Make sure they have counted all the digits - often there is one on its own to the left and/or to the right.
We’ve given illustrations here for both cases; continue with the current instructions if the product has 12 digits, otherwise skip below to the instructions for 13 digits at step 12.
Please read me the digits underneath the bar code starting at the left, but do not tell me the last number.
Write down the digits on alternating lines as follows...
Write the digits on two lines, putting every second digit on the other line. The example here is for the 12-digit product shown above (the child should read 0 48001 20802 for that example).
Remember to keep the last digit secret!
Continue writing the digits on alternating lines; as you get to the 11th digit (6th digit on the first row), remind them to not read the last one. There will be 6 digits on the first line, and 5 digits on the second line. The digits shown here are for the product code 0 4800120802 5.
I’ll add up the two lines of numbers.
Calculate the total of each line.
Let’s multiply the first sum by 3.
Multiply the total of the first line by 3.
We’ll add that to the total of the next line.
Add the value you just calculated to the total of the second line.
What number should I add to that to get a multiple of 10?
Work out the single digit number that will make your calculation add up to a number ending with 0. In the example it is 5; but if the calculation had been 83, the result would be 7; if it had been 70, then the result would be 0.
From reading your mind (or using some computer science!) I’ve worked out what the last digit is on the product... am I right?
Check that the number (circled) matches the digit that was kept secret. If it doesn’t, it’s possible that the digits were read out incorrectly, but it would pay to check your calculation as well. If the digits were read incorrectly, this is a good learning point, as this is exactly the reason that this calculation is done on product codes!
Use these instructions if the chosen product code has 13 digits.
Please read me the digits underneath the bar code starting at the left, but do not tell me the last number.
Write down the digits on alternating lines as follows... The product in this example has the code 9 300644 103213.
Write the digits on two lines, putting every second digit on the other line. The example here is for the 13-digit product shown above (the child should read 9 300644 10321 for that example).
Remember to keep the last digit secret!
Continue writing the digits on alternating lines; as you get to the 12th digit (6th digit on the second row), remind them to not read the last one. There will be 6 digits on the first line, and 6 digits on the second line. The digits shown here are for the product code 9 300644 103213.
I’ll add up the two lines of numbers.
Calculate the total of each line.
Let’s multiply the second sum by 3.
Multiply the total of the second line by 3.
We’ll add that to the total of the first line.
Add the value you just calculated to the total of the first line.
What number should I add to that to get a multiple of 10?
Work out the single digit number that will make your calculation add up to a number ending with 0. In the example it is 3; but if the calculation had been 83, the result would be 7; if it had been 70, then the result would be 0.
From reading your mind (or using some computer science!) I’ve worked out what the last digit is on the product... am I right?
Check that the number matches the digit that was kept secret. If it doesn’t, it’s possible that the digits were read out incorrectly, but it would pay to check your calculation as well. If the digits were read incorrectly, this is a good learning point, as this is exactly the reason that this calculation is done on product codes!
Note that you can make this calculation a bit easier by keeping only the ones digits after each calculation (this is called modulo 10 arithmetic). For example, 8 + 4 = 12, but you just keep the 2; or 9 x 3 = 27, and you can just keep the 7. It will give the same result if you discard the 10s digit, and with practice, you may even be able to do the calculation in your head!
Also, both the 12- and 13-digit calculations are basically the same - the only difference is which line is multiplied by three. A way to remember the difference is that the total you multiply by 3 is for the line that you last wrote a digit on.
The digit you calculated is called a checksum, and it is used to make sure that the other digits have been read correctly when the product is scanned or the numbers are typed into a computer. The people who create the barcodes follow this algorithm every time they create a new barcode, and a supermarket checkout computer does the calculation every time it scans in a barcode. The real magic when you scan a product is that if any of the digits are read incorrectly, the check digit will come out wrong, and the computer knows to warn you that the barcode didn’t read in correctly - perhaps the packet is damaged or has some ice covering the barcode. Without the check digit, it would just get the wrong code, and charge you for the wrong product.
This is called an error detection code. This one is very visible, and can be calculated by hand. Almost all data that is stored on computers or sent over the internet has extra digits added to make sure we can be confident that it didn’t get changed accidentally.
Click here to view Arnold's challenges:
Arnold's Challenges