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.

What is the Hamming distance between 101101 and 100111?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Mark Yourself Question

  1. Grab a piece of paper and try this problem yourself.
  2. When you're done, check the "I have answered this question" box below.
  3. 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?

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Mark Yourself Question

  1. Grab a piece of paper and try this problem yourself.
  2. When you're done, check the "I have answered this question" box below.
  3. View the solution and report whether you got it right or wrong.

Use an even-parity check bit appended to the right.

  1. What bit should be appended to 1011001?
  2. If exactly one transmitted bit flips, what happens to the parity check? Does that locate the flipped position?

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors