Add Me!Close Menu Navigation

ISBN Numbers

ISBN is an acronym for International Standard Book Number and is used as unique identifiers for published books. In this entry I will talk about how mathematics plays a role in the development and usage of the ISBN.

The Borders group recently filed for bankruptcy, and so in honor (or at least as an excuse) of their longstanding dedication to the improvement of the distribution of books and novels (you know, back when borrowing books from the library was just too lame), my mathematics professor decided to go over the basics of some of the mathematics essential to this industry in the last five minutes of lecture.

1. ISBN – International Standard Book Number

This is the sequence of numbers found on top of what appears to be the bar code of a book found within any bookstores.

There are two variants of the ISBN identification sequence. The initial proposal is composed of a 10 digit number in which the first nine digits are used to uniquely identify a book while the last digit is used as a checksum of sorts. A second variant introduces three additional digits at the beginning of the book to identify the industry under which the product is categorized in (The EAN number). I won’t go over every mundane detail of the composition of an ISBN number as the above diagram is pretty self explanatory. I’m here to explain what the purpose of that 10th digit is and why its design is “ingenious” (my professor’s words, not mine).

The ISBN was standardized all the way back in the 60’s, when price checks were still often either made by hand against a catalog or manually entered into a machine that checks the product against a database. Under most circumstances, the assumption was that the product will usually exist unless the ISBN itself was entered incorrectly. (You do not search books by its ISBN, at least not usually) The predecessor of the ISBN is a nine-digit code that works almost exactly like the ISBN. However, humans are prone to mistakes so a lot of time was wasted on product lookups for incorrectly entered entries. (Try entering nine digit numbers into a machine all day without making a single slipup). Now there were a few precursory safeguards against invalid entries. For example, entering a letter in place of a number is a pretty clear evidence that something’s not quite right. But beyond these primitive checks, there’s absolutely no way of telling whether an SSN number (SSN being the predecessor) is valid without doing an entire database lookup.

This was indeed a frustrating problem.

In 1966, professor Gordon Foster of Trinity College created a new publication identification technique that was 90% identical to its predecessor the SSN. However, rather than using only nine numbers, he decided to add a tenth number so that other people couldn’t claim that he blatantly ripped off someone else’s idea. But what should he do with this tenth number? He decided to use the tenth number as a checksum of sorts in order to decrease the frequency of false lookups, which were quite expensive in 1966 and were also very annoying to both the cashier and the customers.

Now Dr. Foster is a smart man, he knows that not only must the tenth digit checksum be trivial to implment and efficient (and not to mention, be a single digit), it must also be prone to human errors, otherwise its entire purpose will be nullified. He realized that most of the time when a cashier misenters the SSN number, the resulting entry is usually mostly correct with maybe two digits’ places exchanged or dropping or adding extra digits. Because such errors may occur anywhere, taking the modulus of 10 and using that as the checksum will fail most of the time.

Foster came up with an ingeniously simple algorithm to both produce the checksum and to check the validity of an ISBN number:

To check if the ISBN is valid, we follow the following algorithm:

10*x1 + 9*x2 + ... + 2*x9 + 1*x10 === 0 (mod 11)
(10*x1 + 9*x2 + ... + 2*x9 + 1*x10) % 11 = 0

Sample implementation:

ISBN = {a1, a2, ... a10}
function validate(ISBN)
    local checksum = 0
    for i=1,10 do
        checksum = checksum + ISBN[i]*(11-i)

    return checksum % 11 == 0

Because the first nine digits of the ISBN is already fixed, we can simply create the tenth digit via

function createISBN(SSN)
    local sum = 0
    for i=1,9 do
        sum = sum + ISBN[i]*(11-i)
    return 11 - (sum%11)

Because simple transpositions in the digits of the ISBN will often set off the safeguard, this prevents unnecessary lookups due to human errors. At the same time, this method does not restrict the structure of the first nine digits and is relatively easy and efficient to implement.

Now as an exercise to the reader, prove that a number and the sum of all of its digits are congruent with respect to modulus of 9. (AKA 10234 % 9 == 1+0+2+3+4 % 9) Why would using the sum of all of the digits mod 9 as the checksum be a bad idea?

Posted By Lee