Another issue that occupies computer scientist is correcting errors in data. Computer hardware can have tiny faults that result in bits flipping from 1 to 0 or 0 to 1.
When data is transmitted bits are even more likely to flip due to irregularities on the transmission lines. A change in just one bit can lead to disaster, for example it might be the 30th bit in a financial amount that is worth 2^30 in currency (over 1 billion), or it might be data from a life-support or missile delivery system.
When data comes from outer space it is likely to be full of errors because the signals across millions of miles are so weak. Error correction helps to prevent mistakes like these.
Look at the spreadsheet. Teacher will add an extra row and an extra column of binary numbers. Teacher will then turn away while someone flips one of the numbers. Teacher will then turn round and tell the class which number was flipped. Magic? Or just a trick?
Additional Work
Write down the binary codes for the characters A, B, C, D, E, F. Can you work out a simple way of checking whether these codes have been transmitted accurately? What are the flaws with this method? Can you think of a better way of detecting errors? What should be done if an error is detected? When is it not possible to take action if an error is discovered?
Many products in the modern world are identified with a unique code so that information about them can be stored in a computer system and quickly retrieved. Books, for example, are identified by a unique 10 (or 13) digit code known as the ISBN (International Standard Book Number). Other products such as baked beans and bread are identified by a UPC (Universal Product Code), practically every item in a modern supermarket has its own unique UPC.
These unique numerical identifiers come in handy when checking out of a supermarket or ordering a book and scanning devices have been invented to read the numbers quickly and efficiently. This involves the representation of the numbers as bar codes and scanning with a bar-code scanner. But what if a number is mis-read? What if a loaf of bread is identified as a bottle of champagne? ISBN and UPC codes have a built-in error check so such a mistake can be spotted and the item can be re-scanned. These provide fairly simple examples of error-checking mechanisms.
Example: ISBN 1-85626-646-X
Enter this code into the search bar of Amazon or Google. Try changing the digits, for example 856 to 865 (an easily-made error when typing) or 646-9. How does this checking work?
The last digit is the check digit. In this case the check 'digit' is 'X' which stands for 10 (as in Roman numerals). The other check digits are 0-9 and the check digit is derived by a process that involves dividing by 11. The full method is as follows:
Write down the first 9 digits in a column or row.
Write the numbers 10-2 under these numbers.
Multiply the pairs of numbers i.e. 1*10, 2*8, 3*5 and so on.
Add up these products.
Divide the total by 11 and note the remainder
Subtract the remainder from 11 - this is the check digit.
When the check digit in the ISBN is multiplied by 1 the sum of the products will divide exactly by 11 with zero remainder.
UPC codes have a similar check digit method. Did you ever wonder why you can't make up credit card numbers for on-line transactions? There are checks on those too so they can't be made up.