Anda di halaman 1dari 15

Bar codes have a lot to do with math. A string of numbers has to be represented by bars.

How many bars does it take to represent one number and what different widths of bars?

Also, because bar code readers might make a mistake, error-checking bars are used to check the answer. This is the same as any other string of numbers. The last number on a credit card number is a check digit used to decide whether the number is typed in correctly or not, and the last digit on an ISBN number (serial numbers for books) is a check digit. Bar codes have both parity bars (some for each digit) and a check digit. But how do you calculate a check digit? And what is the smallest check digit that provides a certain probability of catching an error?

A check digit can't catch all the errors. To be completely accurate the check would have to be the exact same size as the rest of the number, and thats inefficient. So if a bar code is 9 digits and there is one check digit, the probability of the number and size of errors it will catch has to do with how it's calculated.

There are many ways to calculate check digits. Credit cards use the Luhn code, computers use polynomial CRC values, and bar codes use a wide variety of different schemes: POSTNET, Code 39, Codabar, Interleaved 2 of 5, Code 128 (sets A, B and C), UPC-A, EAN-13, EAN-8, EAN-128, UCC-128, MSI / Plessy, Code 11, RM4SCC, PLANET, 4-State, SSCC-18 and SCC-14 are just some of them!

For a math fair you could describe how the check digits are calculated, do some analysis to see which offers the best error checking ability, and so on.

Investigate the maths behind bar codes and QR codes.

How many digits does a bar code have on an item you might buy in a supermarket? Where were the first bar codes used and why? What is the difference between a 1D bar-code and a 2D bar code? Universal Product Codes (UPC) that can be scanned on consumer goods have been around since 1974. What was the first package to carry one?

the current bar coding system on point of sale consumer goods is called EAN13. Find out what each block of numbers represents.

Look at a bar code in detail. Use a magnifying glass if necessary. Where are the long lines and where are the short lines? (Answers at the bottom!)

Cracking the code of Control Numbers are for and how they work The control number in an EAN bar code is the last digit. It just tells you whether the bar code on the tin of beans you have just bought was scanned properly. Sometimes the control number is the same size as the other digits. Sometimes it is a little smaller or moved to the right. The control number is calculated from all the other digits. Each of the other 12 digits is weighted alternately by 1 or 3, with the last number being weighted by a 3. The weighted numbers are summed and subtracted from the nearest multiple of 10 which is equal or higher. Get groups working on representing this as a series of mathematical statements, first in words using symbols.

The nearest multiple of 10 that is equal or higher than the sum is 90. So 90 89 = 1. This will be the last digit of the bar code.

The reason for saying that the last number must be a 3 is that some bar code systems other than EAN13 have more or fewer digits. In these cases you count the digits backwards from the right to determine whether to begin with a x3 or x1. (So it follows that a code with an even number of digits starts with a x1 weighting but an odd number of digits starts with a x3 weighting. ) You could ask children to collect examples of e.g EAN8 bar codes and say why they think certain products have a bar code with fewer numbers (It is a system primarily designed for small products like chewing gum or cigarettes where the packaging simply does not have room for a longer number!) Bar code sums

Each child to bring in an item with a bar code. Ask them to calculate the control number and use the actual last digit of the bar code printed on their item to check if their answer was right. Ask them to make a record of the control number. Then ask them to hide the control number e.g by blacking it out with a pen. Then they can swap their barcoded item with a friend and see if they can work out the hidden control number. You can also do this in groups where everyone records their control number before blacking it out and then all the items are put in the middle and everyone has to complete the sum. Another variation that we quite like is that the teacher takes in several pairs of items e.g 2 identical tins of beans, 2 tins of sardines, 2 packets of sweets etc. Black out the control number for one of each pair and distribute these on each table. (You need at least one item per table). Let them work out the control numbers and write it on a piece of paper. Put the other items of the pair in a row on the teachers desk with the control number visible.

As soon as they have finished, they can run up and check their answer against the same item on the teachers desk. Make sure that one of the items is a tube of smarties which can be used as a reward! (recording their answer on a piece of paper is to make sure they are not cheating!) You can either do this as a speed competition to see which group can do it fastest or, to give them more practice, as soon as they get an answer, they give their item to the next table and start again. How do control numbers identify scanning mistakes? Ask them for any suggestions as to how they thing control numbers can check for errors. Then give them a problem to solve e.g

Supposing there was an error such as an 8 being read as a 3 what would happen? Check this out with a real life example. Supposing 12 got read as 21 what would happen? So what are the black lines above the numbers? Explain that the numbers are represented by the long black lines above them. The lines are the same length except for the longer pair at either end and in the middle, which just tell the scanner when to start and stop reading the bar code. Each digit from 0-9 is represented by a series of lines of different thicknesses.

There are 95 lines in a standard bar code. Ask why they think all these lines are needed? The answer is because each number has to be converted into binary. If you have worked with binary numbers, you could ask each group to write the numbers 0-9 in binary then add up all the 0s and 1s. Watch the following video on bar codes. Making a reader and play the game Each child makes a slot in the middle of a piece of card (does not have to be exact!) about the width of their finger and about a cm in length. This is fiddly so you may have to do it. Get each child to write down the numbers 1-15 in binary, if they can do it. Otherwise give them a chart or use on on-line converter.

Let everyone practice making binary numbers with their fingers. It doesnt matter which hand you use as long as you start with the finger on the left and keep the back of the hand towards the person

making the number and the viewer. A zero is finger up, a 1 is finger down. This is great fun to practice and can be a game in itself as in what number is this?. Then play the game in pairs. Both children sit at a table. One child chooses a binary number and represents that number by placing the right number and position of fingers on the edge of table. (Using the edge of a table makes it easy to keep fingers not in use tucked out of the way.) They should hide the number of fingers with their other hand or ask their partner to keep their eyes shut. They then place the card, with the longer side of slot orientated along the length of the finger on the left. The second child is the bar reader and slowly moves the slot from left to right and works out the number. Here are our answers to some of the quiz.

13 in total. 12 are EANs European Article Numbers and one is a control Railway trucks so that people did not have to climb in to look to see what was inside Originally barcodes represented data by varying the widths and spacings of parallel lines, and may be referred to as linear or one-dimensional (1D). Later they evolved into rectangles, dots, hexagons and other geometric patterns in two dimensions (2D). Although 2D systems use a variety of symbols, they are generally referred to as barcodes as well.

Wrigleys chewing gum However, there are lots of people who would legitimately answer that some of these are wrong. Everything depends on definitions, interpretations, claims and counterclaims! But this is part of the fun give the same children the same questions and depending on their sources, there will be a range of answers. This can generate heated discussion and makes the interest board far more interesting. Take the opportunity to talk about searching, reliability of data etc.

Barcode Maths
May 4, 2012

Here is standupmaths comic Matt Parker doing calculations in his head including a bar code calculation.
Thanks to Matt making the barcode calculations look EASY Mathspig spent about 12 hours blowing steam out her ears and tearing up packaging trying to get the barcode maths to work.

This is THE absolute best exercise to test accuracy in simple calculations including transcribing numbers, which are so easily misread. It also shows you how BARCODES work.

The cash register pings if the BARCODE CHECK DIGIT Algorithm matches the CHECK DIGIT, which is the last digit in the barcode. This is how the cash register computer checks that the data in the barcode has been transferred correctly. All data transfers have some sort of data check algorithm. The PING is KING!!!!!!!!

Mathspigs, you can check your maths skills by picking up the nearest product with a 13-digit barcode and calculating the CHECK DIGIT. The answer is at the end of the barcode. You can find explanation here. an alternative

If your calculations wont work use the online CHECK DIGIT CALCULATOR (EAN 13). If it is right check your calculations again!!!!!!

Application in information technology

Information technology refers to the use of computers and software to convert, store, protect, process, transmit, and retrieve information. Computational theory, algorithm analysis, formal methods and data representation are just some computing techniques that require the use of mathematics.

Computational theory and algorithm analysis deals with whether and how efficiently a computer is able to solve problems. Formal methods are mathematically based techniques for the specification, development and verification of software and hardware systems.

Data representation refers to how computers exchange and process information using the ones and zeros of binary, rather than the more inconvenient ten-digit decimal system. Binary basically means composed of two parts. The binary number system was started by Gottfried Leibniz back in 1666. It makes information processing simpler. For a processing system to work there must be at least two symbols therefore binary is the smallest numeral system that is usable. A CPU can only recognize two states, on or off, but from this on-off state, everything works.

Anda mungkin juga menyukai