Find the two missing digits in 10-ISBN code

1.2k Views Asked by At

We know that we have lost one digit in an ISBN code, we can easily find it using the relation: $x_{10 } \equiv \sum_{i =1}^{9} i x_i \bmod 11$. For example, if we have the ISBN number $0-13-1a9139-9$ using the previous formula, $x_5=3$ (if my calculations are ok).

But, happens if we have 2 missing digits?

For example: $ 0-02-32ab80-0$.

How do we find $ a,b$?

Thank you.

4

There are 4 best solutions below

0
On

Take $a$ arbitrary, between $0$ and $9$, and then solve for $b$. Sadly, this will give you a non-unique solution - one such $b$ for each $a$.

1
On

Usually you can't. There are $100$ choices for the two digits and the $\bmod 11$ reduces it by a factor $11$, so you will usually have $9$ options left. If you want to restore more than one digit you need more check digits to provide enough information.

0
On

Observe for instance that $$(6\cdot a+7\cdot b)\bmod11=(6\cdot 3+7\cdot 4)\bmod11=(6\cdot 9+7\cdot 2)\bmod11=2.$$ This shows that the solution is not always unique.

In fact you have a single equation in two unknowns, and undeterminacy is expected.

0
On

If you are missing two digits, then the solution is not unique. In particular, for the isbn

$$0−02−32ab80−0,$$

you can confirm that every possible assignment where $a=b$ is a valid solution:

0−02−320080−0
0−02−321180−0
0−02−322280−0
0−02−323380−0
0−02−324480−0
0−02−325580−0
0−02−326680−0
0−02−327780−0
0−02−328880−0
0−02−329980−0


To see this more generally:

  1. Let $S$ be the weighted sum of the digits you know: $S = \sum_{i=0}^{9} i\cdot x_i$ (where $x_i=0$ if you don't know that digit).
  2. Letting $a$ and $b$ denote the missing digits at positions $n_a$ and $n_b$, the checksum formula becomes: $$S+n_aa+n_bb \pmod{11} = x_{10}$$

    or, putting it another way, $$n_aa+n_bb \pmod{11} = (x_{10}-S) \pmod{11}$$

  3. Hence by increasing $a$, you may be able to decrease $b$ to keep the sum $n_aa+n_bb$ constant; hence there are generally multiple solutions.

  4. For the isbn 0−02−32ab80−0, we have that the weighted sum of the digits we know is $S = 2\cdot 2 + 3\cdot 3 + 4\cdot 2 + 7\cdot 8 = 77$.

    And the checksum formula is: $5a+6b = (0-77)\pmod{11} = 0\pmod{11}$

    But note that because 5+6 = 11, any solution where $a=b$ will have $$5a+6b = 5a+6a = 11a = 0 \pmod{11}$$