views:

260

answers:

2

I have recently been reading about Error Correction for a job interview and have written a number of programs that use n-ary BCH (Bose, Chaudhuri, Hocquenghem) cyclic codes and have now written a script that will generate phone numbers once given an "area code" for a given user (encoding) and will decode it and will repair up to two errors (and detect more).

I would like to now be able to repair one of the phone numbers given if it is missing some digits (two seems doable). After researching ISBN codes it appears that it is possible to repair a ISBN code if two random digits have been removed.

+1  A: 

I do not believe phone numbers confirm to a restriction making it harder to get the wrong number right.

Also I belive ISBN-numbers only have a modulus check which only can detect that one digit is wrong (more than one may cancel each other out).

In other words, you simply cannot do reliably what you want to do.

Thorbjørn Ravn Andersen
Sorry, my question was somewhat confusing. I'm not encoding and decoding phone numbers but code numbers of the same size and look. The program is written as a "phone number repair program", but it takes a encoded string of six digits and creates four extra digits. The decoding then handles errors within the ten digit numbers if they arise. What I want to do is handle a situation where one of my encoded 10 digit numbers is passed, but missing one or two of its digits, then to be able to repair that number.
AlexT
You should look into "error correcting codes" as this explains how to calculate and insert enough information to correct a given number of incorrect digits. Be warned. IIRC you get the best performance for large number of digits per block.
Thorbjørn Ravn Andersen
A: 

In your Decoding class you state that the syndrome digit determine whether there is an error or not. Why not replace the two missing digits with x and y and change them throughout the number to find every possible space for them where each syndrome digit is 0?

The problem is finding the location of these errors. As you've stated, just sticking in digits left, right and centre won't really do much as it'll return the wrong codes.

EnderMB