Hamming distance between 1011010 and 1001110 — Hamming code
corecount the differing positions
Answer
2
Why this example is worth doing
The distance is the number of positions where two words differ, computed by XORing them and counting the 1s — the same operation as the XOR difference mask on the XOR gate page. The page connects distance to capability with the two rules that matter: a code with minimum distance d detects d − 1 errors and corrects the integer part of (d − 1)/2, which is why the (7,4) code with distance 3 corrects one.
Try your own input in the Hamming code. Encode, inject an error, and watch the syndrome point straight at the flipped bit.
How the answer is reached
Differing positions
a1011010
b1001110
2 of 7 positions differ, so the Hamming distance is 2.