Error-Correcting Codes
Distance Is the Error Budget of a Code
A codeword is an allowed transmitted string, not just any string of the right length. The Hamming distance between two equal-length strings is the number of positions in which they differ. It measures how many single-symbol changes are needed to turn one word into the other.
The central quantity is the minimum Hamming distance dmin between distinct codewords. If fewer than dmin symbols change, a received word cannot equal a different valid codeword, so those errors are detectable. Unique nearest-codeword correction is guaranteed for at most ⌊(dmin−1)/2⌋ errors, because the radius balls around different codewords must remain disjoint.
A parity check is the simplest redundancy rule. With even parity, the appended bit makes the total count of ones even. A one-bit change reverses that parity and is detected. A lone parity bit does not identify which position changed, and two changes can restore the parity, so detection and correction are different promises.
The hat-problem intuition is that a public coding rule can let a participant infer an otherwise missing bit from a controlled parity relation.
The rule works because it constrains the possible strings; it is not a cryptographic secrecy mechanism. When decoding, state what is guaranteed by the distance and what would require additional facts about the actual code.
Mark Yourself Question
- Grab a piece of paper and try this problem yourself.
- When you're done, check the "I have answered this question" box below.
- View the solution and report whether you got it right or wrong.
A receiver obtains 11001 while the intended candidate codeword is 11011. What is their Hamming distance, and what does that comparison alone establish?
Mark Yourself Question
- Grab a piece of paper and try this problem yourself.
- When you're done, check the "I have answered this question" box below.
- View the solution and report whether you got it right or wrong.
Use an even-parity check bit appended to the right.
- What bit should be appended to 1011001?
- If exactly one transmitted bit flips, what happens to the parity check? Does that locate the flipped position?