ITPEC FE Morning October 2019 Question 2
ITPEC FE Morning October 2019 — Question 2 of 80
Hamming Distance — count positions where two bit strings differ.
Compare 10101 and 11110 bit by bit:
- •Position 1:
1vs1→ same - •Position 2:
0vs1→ different - •Position 3:
1vs1→ same - •Position 4:
0vs1→ different - •Position 5:
1vs0→ different
Hamming distance = 3
Quick method: XOR the strings → count 1s:10101 ⊕ 11110 = 01011 → three 1s → distance = 3
Why not others:
- (a) 0 — would mean identical strings
- (b) 2 — undercounts; misses one differing position
- (d) 5 — would require all bits to differ
Key rule: Hamming distance = number of 1s in the XOR of two bit strings.
AI-generated — may contain errors
The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.
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.