Skip to main content

The Mathematics of ISBN Number




If you have ever bought a book, you might have noticed a barcode and a number on its back cover. This number is called the International Standard Book Number (ISBN) and it is used to uniquely identify a book and its publisher. ISBNs are also useful for libraries, booksellers, distributors and readers who want to find or order a specific book.

But did you know that ISBNs are not just random numbers? They are actually based on a mathematical formula that allows them to detect errors and prevent confusion. In this blog post, we will explore how ISBNs work and what kind of mathematics they use.

 What is an ISBN?

An ISBN is a numeric commercial book identifier that is intended to be unique. Publishers purchase or receive ISBNs from an affiliate of the International ISBN Agency. An ISBN is assigned to each separate edition and variation (except reprintings) of a publication. For example, an e-book, a paperback and a hardcover edition of the same book will each have a different ISBN. 

The ISBN is composed of four or five groups of digits, which are sometimes separated by hyphens. The groups encode information about the country or language, the publisher, the individual book and a check digit. The check digit is used to verify that the ISBN is correct and has no errors.

The ISBN was originally 10 digits long, but since 2007 it has been 13 digits long. The 13-digit ISBN always starts with 978 or 979, which are called prefixes. The rest of the digits are the same as the 10-digit ISBN, except for the check digit, which is calculated differently.

How is an ISBN calculated?

The ISBN is calculated using a specific mathematical formula that depends on whether it is 10 or 13 digits long. The formula uses a technique called weighted sum, which means that each digit is multiplied by a weight and then added together. The weights are different for each position of the digit.

For example, let's take the ISBN of the first edition of the printed version of MathWorld: 0-8493-9640-9. This is a 10-digit ISBN, so we use the following formula to calculate the check digit:

`d_10 = (1,2,3,4,5,6,7,8,9)*(d_1 + d_2 + d_3 + ... + d_9) mod 11`  where `a*b` denotes a dot product.

`d_10 = (d_1 + 2d_2 + 3d_3 + ... + 9d_9) mod 11`

where `d_i` is the i-th digit of the ISBN and `mod` means taking the remainder after dividing by 11. If the result is 10, we use X as the check digit (where X is the Roman numeral for 10.

Plugging in the digits of our example (0-8493-9640-9), we get:

`d_10 = (1,2,3,4,5,6,7,8,9)*(8,4,9,3,9,6,4,0) mod 11` where `a*b` denotes a dot product and `(0,8,4,...)` is the vector composed of the first 9 digits of the ISBN-10.

`d_10 = (0 + 2*8 + 3*4 + 4*9 + 5*3 + 6*9 + 7*6 + 8*4 + 9*0) mod 11`

`d_10 = (0 + 16 + 12 + 36 + 15 + 54 + 42 + 32 + 0) mod 11`

`d_10 = (207) mod 11`

`d_10 = 9`

So the check digit is 9, which matches our ISBN. 0-8493-9640-9. 

Now let's take the corresponding 13-digit ISBN: 978-0-8493-9640-3. This time we use a different formula for the check digit:

`d_10 = (1,3,1,3,1,3,1,3,1,3)*(d_1 + d_2 + d_3 + ... + d_9) mod 11`  where `a*b` denotes a dot product.

`d_13 = (10 - (d_1 + 3d_2 + d_3 + ... + d_12)) mod 10`

where `d_i` is the i-th digit of the ISBN and `mod` means taking the remainder after dividing by 10.

Plugging in the digits of our example 978-0-8493-9640-3, we get:

`d_13 = (10 - (1*9 + 3*7 +1*8+3*0+1*8+3*4+1*9+3*3+1*9+3*6+1*4+3*0)) mod 10`

`d_13 = (10 - (9+21+8+0+8+12+9+9+9+18+4+0)) mod 10`

`d_13 = (10 - (107)) mod 10`

`d_13 = (-97) mod 10`

`d_13 = 3 mod 10`

`d_13 =3`

So the check digit is 3, which matches our ISBN 978-0-8493-9640-3.


Why is an ISBN useful?

The ISBN is useful because it can detect some common errors that might occur when typing or scanning a barcode. For example, if we accidentally swap two digits or enter a wrong digit, the check digit will not match the formula and we will know that something is wrong.

The ISBN can detect any single-digit error, as well as most two-digit errors resulting from transposing two digits. However, it cannot correct the errors or identify which digits are wrong. It also cannot detect some errors that involve more than two digits or do not change the weighted sum.

For example, if we swap the first and last digits of our 10-digit ISBN, we get 9-8493-9640-0. This is a valid ISBN, but it belongs to a different book: "The Art of Computer Programming, Volume 4A" by Donald Knuth. The ISBN cannot tell us that we have the wrong book, because the weighted sum is the same:

`(9 + 2*8 + 3*4 + 4*9 + 5*3 + 6*9 + 7*6 + 8*4 + 9*0) mod 11 = (207) mod 11 = 9`

Similarly, if we change the second digit of our 13-digit ISBN from 7 to 8, we get 988-0-8493-9640-3. This is also a valid ISBN, but it belongs to a different prefix: 988 is used for books published in China. The ISBN cannot tell us that we have the wrong prefix, because the weighted sum is the same:

`(10 - (9 + 3*8 +8+0+3*8+4+3*9+3+3*6+4+3*0+0)) mod 10 = (10 - (138)) mod 10 = (-128) mod 10 = (2) mod 10 =2`

Therefore, the ISBN is not foolproof and we should always double-check the book title and other information before buying or ordering a book.

Conclusion

The ISBN is a fascinating example of how mathematics can be applied to real-world problems. By using a simple formula and a check digit, the ISBN can uniquely identify a book and its publisher, as well as detect some common errors. The ISBN also illustrates how different number systems and bases can be used to encode information.


If you want to learn more about the ISBN and its history, you can visit the following websites:

- [International ISBN Agency](https://www.isbn-international.org/)

- [ISBN - Wikipedia](https://en.wikipedia.org/wiki/ISBN)

- [ISBN -- from Wolfram MathWorld](https://mathworld.wolfram.com/ISBN.html)

- [Application: ISBN - Mathematics and Statistics | MAT](https://mathstats.uncg.edu/sites/pauli/112/HTML/secisbn.html)


I hope you enjoyed this blog post and learned something new. Thank you for reading!

Comments