Consider a binary channel code in which each codeword has a fixed length of 5 bits. The Hamming distance between any pair of distinct codewords in this code is at least 2. The maximum number of codewords such a code can contain is ______.
GATE 2018 EC Q.16: solution and answer
Answer and solution
ANSWER
The maximum number of codewords is 16.
Official answer: 16Source: Official answer key, GATE 2018 EC (IIT Guwahati)
We need the largest binary code of length with minimum Hamming distance .
Upper bound: delete the last bit of every codeword. Two distinct codewords differ in at least 2 positions, so after deleting one position they still differ in at least position. The shortened 4-bit words are therefore all distinct.
There are only binary words of length 4, so the number of codewords satisfies .
Achievability: take all 5-bit words of even weight (the single parity-check code). Two different even-weight words differ in an even number of positions, and in at least one, so in at least 2. Hence .
The number of even-weight words of length 5 is .
The upper bound is met, so the maximum number of codewords is .
KEY IDEA
A minimum distance of 2 means the code detects single-bit errors. Deleting one coordinate keeps all codewords distinct, so the size is at most , and the even-parity code reaches that bound.
WATCH OUT FOR
Using the Hamming bound or the Singleton bound incorrectly, or picking 32 because 5 bits give 32 words. Distance 2 forbids two codewords from differing in only one bit, so only half the words can be used.
From the GATE 2018 EC paper. Every question of this paper · Download the full paper · All 5 Error control questions, with notes
More Error control questions
- GATE 2026 EC Q.63 · NAT · 2 marksThe average bit error rate at the input of a (7, 4, 1) Hamming decoder is 0.10.
- GATE 2025 EC Q.33 · NAT · 1 markThe generator matrix of a (6,3) binary linear block code is given by G =…
- GATE 2024 EC Q.47 · MCQ · 2 marksThe information bit sequence 1 1 1 0 1 0 1 0 1 is to be transmitted by encoding with Cyclic Redundancy Check…
