Skip to main content

Minimum Hamming distance; find k and n

Short answer

Minimum Hamming distance d_min is the smallest distance between any two codewords, enabling detection of d_min−1 and correction of ⌊(d_min−1)/2⌋ errors. A dataword is the k-bit message; a codeword is the n-bit encoded block with redundancy. For Hamming code with d_min=3 and k≥11: use r=4 parity bits, n=2^r−1=15, k=n−r=11, giving C(15,11).

What is the minimum Hamming distance? Differentiate between dataword and codeword. We need a dataword of at least 11 bits. Find the values of (k) and (n) in the Hamming code C(n,k) with dmin = 3.

Minimum Hamming distance

The minimum Hamming distance d_min of a code is the smallest Hamming distance between any two distinct codewords. It decides the capability: a code detects up to d_min − 1 errors and corrects up to ⌊(d_min − 1)/2⌋ errors.

Dataword vs codeword

PointDatawordCodeword
MeaningOriginal message blockEncoded block sent on channel
Lengthk bitsn bits (n > k)
ContentInformation onlyInformation + redundant bits
Number2ᵏ possible2ᵏ valid out of 2ⁿ

Finding k and n

For a Hamming code with d_min = 3: n = 2ʳ − 1, k = n − r, where r is the number of parity bits. We need k ≥ 11.

  • r = 3: n = 7, k = 4 (too small)
  • r = 4: n = 15, k = 11 (k ≥ 11 satisfied)

Check: 2ʳ ≥ k + r + 1 → 16 ≥ 11 + 4 + 1 = 16 ✓.

Answer: n = 15, k = 11, i.e. the Hamming code C(15, 11) with 4 parity bits.

✓ Answer checked by Claude Sonnet 5.5

All Data Communication chapter 8 questions →