The hamming distance between 10101 and 11110 is
2025
The hamming distance between 10101 and 11110 is
- A.
2
- B.
3
- C.
4
- D.
5
Attempted by 616 students.
Show answer & explanation
Correct answer: B
Solution: Compare the two bit strings position by position to count differing bits.
Write the two bit strings aligned: 10101 and 11110.
Compare each position: 1 vs 1 (same), 0 vs 1 (different), 1 vs 1 (same), 0 vs 1 (different), 1 vs 0 (different).
Count the differing positions: there are 3 differences (positions 2, 4, and 5). Therefore the Hamming distance is 3.
Answer: 3
A video solution is available for this question — log in and enroll to watch it.