The Bar Code

Our numbering system consists of 10 digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) with which we can write any number. This system is called decimal base. We can demonstrate any number by applying powers of base 10. Look:
47 621 = 4 x 104 + 7 x 10³ + 6 x 10² + 2 x 10¹ + 1 x 100
In the binary system (base 2), numbers are written using 0 and 1 and powers of 2.
Look:
21(base 10) = 10101(base 2)
Transforming the number in base 2 to base 10. Watch:
10101(base 2) = 1 x 24 + 0 x 2³ + 1 x 2² + 0 x 2¹ + 1 x 20 (according to the position of 0 and 1 we raise base 2 to the proper exponent)

10101 Base 2
1 Position 4: 24
0 Position 3: 2³
1 Position 2: 2²
0 Position 1: 2¹
1 Position 0: 20

1 x 24 + 0 x 2³ + 1 x 2² + 0 x 2¹ + 1 x 20
16 + 0 + 4 + 0 + 1
21
In the barcode, the black bar means 1 and the white one means 0. The number 10100001101, in base 2 is a simplified barcode.
The prices of products in commerce shown in barcode are more complex, but we can establish the barcode below in base 10.

Do not stop now... There's more after the advertising ;)

10100001101base2 = 1 x 210 + 0 x 29 + 1 x 28 + 0 x 27 + 0 x 26 + 0 x 25 + 0 x 24 + 1 x 2³ + 1 x 2² + 0 x 2¹ + 1 x 20
1 x 1024 + 0 x 512 + 1 x 256 + 0 x 128 + 0 x 64 + 0 x 32 + 0 x 16 + 1 x 8 + 1 x 4 + 0 x 2 + 1 x 1 
1024 + 0 + 256 + 0 + 0 + 0 + 0 + 8 + 4 + 0 + 1 
1293
The number 1293 is the code for a particular product. The cashier's barcode reader optically scans the codes and in fractions of seconds performs the calculations, reaching the number 1293. Accessing a list of products, look for which was registered with this number, recording the value on the coupon.

by Mark Noah
Graduated in Mathematics
Brazil School Team

Curiosities - Brazil School

Would you like to reference this text in a school or academic work? Look:

SILVA, Marcos Noé Pedro da. "The Bar Code"; Brazil School. Available in: https://brasilescola.uol.com.br/curiosidades/o-codigo-barras.htm. Accessed on June 27, 2021.

Stalactites and stalagmites: speleothems

Stalactites and stalagmites: speleothems

Imagine a cave...What comes to mind?You probably thought of those sharp horizontal shapes, some p...

read more
Area Affected by Oil

Area Affected by Oil

In Brazil, most of the existing oil platforms are in deep water. When an oil accident occurs or o...

read more
How the names of hurricanes and typhoons are chosen

How the names of hurricanes and typhoons are chosen

One of the phenomena of nature most feared by man is the tropical cyclone,which occurs when winds...

read more