Information Theory and Coding Basics

Which of the following is the Hamming distance between the two 7-bit codewords 1011010 and 0110011?

  1. A0
  2. B3
  3. C4
Show answer and explanation

Answer: C. 4

The Hamming distance is the number of positions at which the bits differ. The exclusive OR of the two words is 1101001, which has four 1s, so the Hamming distance is 4. Comparing bit by bit, bits 1, 2, 4 and 7 differ.

  • A. 0 is the difference between the numbers of 1s in the two codewords (4 in each). The Hamming distance is counted by comparing bits position by position.
  • B. 3 is the number of positions at which the bits agree.
  • C. Correct. The four positions at bits 1, 2, 4 and 7 differ.
Practice this topic Back to topic

Books on Information Theory and Coding Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Information Theory and Coding Basics questions

  1. The minimum Hamming distance of a code (the smallest Hamming distance between any two codewords) is 5. Consider using it only for error detection, or only for error correction. Which of the following correctly pairs the number of bit errors that can always be detected with the number that can always be corrected?
  2. Which of the following correctly pairs the minimum Hamming distance of the code consisting of the four codewords 00000, 01011, 10101 and 11110 with the number of bit errors it can always correct?
  3. Which of the following is closest to the code rate of the Hamming (7, 4) code, which adds 3 check bits to 4 bits of data to form a 7-bit codeword?
  4. In a Hamming (7, 4) code, the seven bits are numbered 1 to 7 from the left, and bits 1, 2 and 4 are check bits. They are set so that the number of 1s is even in bits 1, 3, 5 and 7 (check 1), in bits 2, 3, 6 and 7 (check 2) and in bits 4, 5, 6 and 7 (check 4). If the received word 0110001 has a single-bit error, which of the following is the wrong bit?
  5. A SECDED code, which corrects 1-bit errors and detects 2-bit errors, is added to 32 bits of data. The number of check bits r of a Hamming code is the smallest value satisfying 2^r ≥ number of data bits + r + 1, and SECDED adds 1 bit of overall parity to this. Which of the following is the number of check bits needed?