Hamming Distance MCQs: 12 Solved Error Detection and Correction Questions

Practise 12 Hamming distance and error-control MCQs with faithful options, direct answers and step-by-step explanations for every calculation.

KnowledgeGate Team

Exam prep & CS education

Updated 3 Nov 20267 min read
Hamming Distance MCQs: 12 Solved Error Detection and Correction Questions

Hamming distance questions look formula-driven, but the formulas are rarely the real problem. Candidates often lose marks by counting unequal positions incorrectly, using a detection rule for a correction question, or choosing the nearest codeword without checking whether another codeword is equally near.

Error-control basics, binary and hexadecimal distance counts, correction radius, nearest-neighbour decoding, check-bit sizing and the Hamming bound all depend on choosing the right rule before calculating. Work each question before checking its explanation so that the method, not just the answer, becomes automatic.

Hamming distance MCQs: Keep four rules beside the question set

Flowchart of four Hamming-distance rules, a four-step routine, and the SEC parity-bit sizing example.

Task

Rule

Fast check

Find the distance between two words

Count unequal bit positions

XOR the words and count the 1s

Detect up to s errors

d_min >= s + 1

Subtract 1 from d_min

Correct up to t errors

d_min >= 2t + 1

The correction spheres must not overlap

Find the correction radius

floor((d_min - 1)/2)

Round down after subtracting 1 and dividing by 2

Keep parity-bit sizing separate from minimum-distance formulas. For ordinary Hamming single-error correction (SEC), choose the smallest r satisfying 2^r >= m + r + 1. With m = 16, r = 5 works because 32 >= 16 + 5 + 1 = 22; SECDED then adds one overall parity bit, making six check bits.

Use the same four-step routine every time:

  1. Align equal-length words.

  2. XOR them, or compare corresponding positions.

  3. When a codebook is given, find the smallest of all pairwise distances.

  4. Apply the detection or correction rule actually asked for.

If you need the concepts in sequence before attempting more numericals, GATE Guidance by Sanchit Sir provides the broader Computer Networks learning route.

Error-control basics MCQs

Question 1, BPSC 2025

What is the purpose of error control in the Data Link Layer?

  • A. To prevent unauthorized access

  • B. To correct errors in the physical layer

  • C. To ensure reliable data transmission

  • D. To manage network congestion

Answer: C. Error control detects damaged or missing frames and uses an appropriate recovery mechanism so that the link can deliver data reliably. Access control, congestion management and correction in the Physical layer are different responsibilities.

Question 2, NIACL AO IT Specialist 2017

If two or more bits in the data unit have changed, what is that error referred to?

  • A. burst

  • B. double bit

  • C. single bit

  • D. erroneous bit

Answer: A. A burst error is corruption spanning two or more bit positions in a data unit. Its span runs from the first corrupted bit to the last, but every bit inside that span need not be wrong.

Hamming distance calculations from binary and hexadecimal words

Aligned 0xAA and 0x55 bit rows, XOR 11111111, and eight differing positions showing Hamming distance 8.

Question 3, ISRO 2011

The hamming distance between the octets of 0xAA and 0x55 is

  • A. 7

  • B. 5

  • C. 8

  • D. 6

Answer: C. Expand 0xAA = 10101010 and 0x55 = 01010101; all eight aligned positions differ. The XOR is 11111111, and its eight 1s confirm that the Hamming distance is 8.

Question 4, UGC NET 2025

The hamming distance between 10101 and 11110 is

  • A. 2

  • B. 3

  • C. 4

  • D. 5

Answer: B. Align 10101 and 11110: positions 2, 4 and 5 differ, while positions 1 and 3 match. Their XOR is 01011, which contains three 1s, so the distance is 3.

Minimum Hamming distance and correction-capability MCQs

Question 5, GATE 2017

Consider the binary code whose only valid codewords are 00000, 01011, 10101 and 11110. Let p be the minimum Hamming distance and q be the maximum number of erroneous bits the code can correct. What are p and q?

  • A. p = 3 and q = 1

  • B. p = 3 and q = 2

  • C. p = 4 and q = 1

  • D. p = 4 and q = 2

Answer: A. Check all six pairs rather than stopping after one comparison.

Codeword pair

Distance

00000, 01011

3

00000, 10101

3

00000, 11110

4

01011, 10101

4

01011, 11110

3

10101, 11110

3

Thus p = d_min = 3, and q = floor((3 - 1)/2) = 1. The maximum pairwise distance is irrelevant because a code's guaranteed capability comes from its closest pair.

Question 6, GATE 2007

An error correcting code has the following code words: 00000000, 00001111, 01010101, 10101010, 11110000. What is the maximum number of bit errors that can be corrected ?

  • A. 0

  • B. 1

  • C. 2

  • D. 3

Answer: B. The minimum pairwise distance is 4: for example, 00000000 differs from both 00001111 and 11110000 in four positions, and no pair is closer. Therefore floor((4 - 1)/2) = 1, so the code corrects one bit even though it can detect up to three errors.

Question 7, UGC NET 2018

To guarantee correction of upto t errors, the minimum Hamming distance dmin in a block code must be ________.

  • A. t+1

  • B. t - 2

  • C. 2t - 1

  • D. 2t+1

Answer: D. For t = 2, radius-2 neighbourhoods around valid codewords must not overlap, so d_min must be at least 2(2) + 1 = 5. In general, d_min >= 2t + 1; t + 1 belongs to error detection, not correction.

Nearest-codeword decoding and ambiguity MCQs

Question 8, UGC NET 2020

Consider a code with only four valid code words: 0000000000, 0000011111, 1111100000, and 1111111111. This code has distance 5. If the code word arrived is 0000000111 then the original code word must be _______

  • A. 0000011111

  • B. 0000000000

  • C. 1111100000

  • D. 1111111111

Answer: A. The received word's distances to options A, B, C and D are 2, 3, 8, 7. Since d_min = 5 gives radius floor((5 - 1)/2) = 2, the unique codeword at distance 2, 0000011111, is the decodable original.

Question 9, ISRO 2025

A communication system uses three 5-bit valid codewords and corrects errors by Hamming distance: codeword A = 00000; codeword B = 01110; codeword C = 11000. The receiver gets 01000. What would the system conclude?

  • A. It will correct to codeword A

  • B. It will correct to codeword B

  • C. It will correct to codeword C

  • D. It will be unable to correct the error

Answer: D. The received word has distances d(01000,A) = 1, d(01000,B) = 2 and d(01000,C) = 1. A and C tie at the smallest distance, so nearest-neighbour decoding has no unique winner; choosing the first distance-1 codeword encountered would be unjustified.

Hamming check bits, sphere-packing bound and code-family MCQs

Question 10, ISRO 2013

How many check bits are required for 16 bit data word to detect 2 bit errors and single bit correction using hamming code?

  • A. 5

  • B. 6

  • C. 7

  • D. 8

Answer: B. For m = 16, five ordinary Hamming parity bits satisfy 2^5 = 32 >= 16 + 5 + 1 = 22. Adding one overall parity bit for double-error detection gives 5 + 1 = 6 check bits; putting six into the SEC sizing step would double-count that overall bit.

Question 11, UGC NET 2017

For any binary (n, h) linear code with minimum distance 2t + 1 or greater, the Hamming bound is n - h >= log2(sum from i = 0 to alpha of C(n, i)). What is alpha?

  • A. 2t + 1

  • B. t + 1

  • C. t - 1

  • D. t

Answer: D. Minimum distance 2t + 1 corrects every error pattern of weight 0 through t, so each Hamming sphere contains sum from i = 0 to t of C(n,i). The summation therefore stops at alpha = t; the minimum-distance expression is not the sphere's radius.

Question 12, ISRO 2023

Which of the following is true?

  • A. Both Parity and Cyclic Redundancy Check are error correcting codes

  • B. Both Parity and Low Density Parity Check Code are error correcting codes

  • C. Both Reed-Solomon code and Low Density Parity Check Code are error correcting codes

  • D. Both Cyclic Redundancy Check and Low Density Parity Check Code are error correcting codes

Answer: C. In their standard networking use, parity and CRC are error-detection mechanisms, while Reed-Solomon and LDPC are forward error-correcting code families. The word both eliminates A, B and D because each of those options includes parity or CRC.

Hamming distance MCQ patterns and the next practice step

The five recurring moves are classifying the purpose of error control, counting unequal bit positions, minimising distance over every codeword pair, converting d_min into detection or correction capability, and checking whether nearest-neighbour decoding has a unique result.

Before submitting an answer, run this trap checklist:

  • Compare equal-length words only.

  • Count the 1s in the XOR.

  • Use the minimum pairwise distance, not the maximum.

  • Keep s + 1 detection separate from 2t + 1 correction.

  • Size ordinary Hamming SEC first, then add the SECDED overall parity bit.

  • Reject a tied nearest codeword.

For lateral practice, Computer Networks MCQs widens the question mix beyond error control. Follow that with Subnetting MCQs: 12 Solved IP Addressing Questions when bitwise address calculations need work, or TCP and UDP MCQs: 12 Solved Transport Layer Questions when you want another protocol-focused set.

Use the GATE CS Exam Preparation Courses & Test Series category to map a broader preparation route. Choose GATE Guidance by Sanchit Sir when you want the Computer Networks sequence rather than another isolated question set.