ITPEC FE Morning October 2022 Question 5
Topic: Basic TheoryAlso asked in October 2019
What is the Hamming distance of bit strings 10101 and 11110?
Explanation
3 — the Hamming distance is the number of bit positions in which the two strings differ.
Equivalently, 10101 XOR 11110 = 01011, which has three 1s.
Answer (c)
Why not others:
- •(a) 0 — the distance of two identical strings; these differ in three places
- •(b) 2 — misses one of the three differing positions
- •(d) 5 — would need every bit to differ, but positions 1 and 3 match
Key rule: XOR the two bit strings and count the 1s: each 1 marks a position where they differ.
Basic Theory · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.