---
title: "Minimum Hamming distance; find k and n"
subject: "Data Communication"
chapter: 8
key: "semester_5/data_communication:min-hamming-k-n"
source: https://www.bctengineer.com/q/semester_5/data_communication/min-hamming-k-n
site: BCT Engineering
---

# Minimum Hamming distance; find k and n

Data Communication · Chapter 8: Information Theory and Coding

- Asked in: 2070 Asar, 2+4 marks
- Video: [Minimum Hamming Distance, Error Detection Capability, and Error Correction Capability Explained](https://www.youtube.com/watch?v=hrc8kXoBdlw) — Engineering Funda
- Answer checked by Claude Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/data_communication/min-hamming-k-n
- Whole chapter: https://www.bctengineer.com/md/semester_5/data_communication/chapter-8

## Question

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.

## 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).

## Answer

#### 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
| Point | Dataword | Codeword |
|---|---|---|
| Meaning | Original message block | Encoded block sent on channel |
| Length | k bits | n bits (n > k) |
| Content | Information only | Information + redundant bits |
| Number | 2ᵏ possible | 2ᵏ 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.**

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is d_min of a code?
   A. Largest distance between codewords
   B. Smallest Hamming distance between any two distinct codewords
   C. Number of parity bits
   D. Length of the codeword
   Answer: B. d_min is the smallest distance between distinct codewords and determines detection and correction capability. (Key point: Minimum Hamming distance)

2. How many valid codewords are there for k-bit datawords and n-bit codewords?
   A. 2^n valid out of 2^k
   B. 2^k valid out of 2^n possible
   C. k valid out of n
   D. 2^(n-k) only
   Answer: B. There is one codeword per dataword, so 2^k valid codewords among 2^n possible n-bit words. (Key point: Dataword vs codeword)

## Related in Data Communication

- [Dataword vs codeword; error coding techniques](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Adataword-codeword-error-coding) — Data Communication, chapter 8
- [Capability of a code with dmin = 4](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ahamming-distance-dmin4) — Data Communication, chapter 8
- [Hamming distance and minimum distance](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ahamming-distance-define) — Data Communication, chapter 8, asked 2×
- [(6,3) block code words, weights, dmin](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ablock-code-63-matrix-weights) — Data Communication, chapter 8
- [Redundancy, Hamming distance, linear vs cyclic](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Aredundancy-hamming-linear-cyclic) — Data Communication, chapter 8
- [Construct a (7,4) Hamming code](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Ahamming-74-construct) — Data Communication, chapter 8

## Related in other subjects

- [Significance of dmin; (7,4) cyclic code for 1101 with g(x) = 1 + x + x²](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Admin-cyclic-7-4-1101) — Communication Systems, chapter 8
- [Hamming weight and distance; (7,4) cyclic code for 1011](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Ahamming-weight-cyclic-1011) — Communication Systems, chapter 8, asked 2×
- [Hamming distance and weight; (6,3) code check for 100101](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Ahamming-6-3-h-100101) — Communication Systems, chapter 8
- [Hamming weight and distance; validate code 100011](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Ahamming-6-3-h-100011) — Communication Systems, chapter 8
