Start the Lab | Math Alive | Welcome Page |
After you have worked the examples on the Hamming Code (which tells you if you are correct or not), try the following:
Answer:
4 bit combination 7 bit Hamming codeword 0011 1001 0001 1101 1111
Problem 2. Proof of 4-7 Hamming Code.
Let us now try to detect some errors. You can of course try to find a correct codeword by inspecting the full list of codewords, each with their 7 digits, and selecting the closest one.
Or you can do the following (where means "parity addition"):
Compute d1 = b1
b2
b3
b5
d2 = b1
b3
b4
b6
d3 = b2
b3
b4
b7
If d1, d2 and d3 are all equal to zero, then this is already a codeword - nothing to correct.
If only one of d1, d2, d3 is different from zero, then you must correct one of the last three bits (b5 if d1=1, b6 if d2=1, b7 if d3=1).
If two of d1, d2, d3 are different from zero, then you must correct the bit that occurs in the definitions of the two d-bits that are 1, but not in the other one. for instance: if d1=d2=1, but d3=0, then we must correct b1, because it occurs in both d1 and d2, but not in d3.
If d1, d2, d3 are all three different from zero, then you must correct b3.
Can you explain why this procedure must work? That is, please show that no matter which bit is flipped, that the procedure corrects that flip. Don't forget to show that that when no flips occur, the procedure still works.
Answer:
Problem 3. Correcting Errors using Hamming Codes.
Now try correcting the following examples - the 4 bit string asked in the last column is the string (b1 b2 b3 b4) from which we started the encoding; you find this by deleting the last 3 bits from the Hamming codeword:
Answer:
7 bit string closest Hamming codeword 4 bit string 1001011 0110000 1011001 1111000 1111100 1011111
Problem 4. A Guessing Game.
I am thinking of a number between 1 and 16. You can ask me 7 "yes or no" question; I don't have to give a truthful answer to each of your 7 questions but I can lie at most once. Design the strategy to guess my number. (Hint. the Hamming code has 16 codewords, and its codewords are 7 bits long.)
Answer: