[Math] Expected Hamming distance

coding-theorycombinatorics

I choose two code words independently at random from $\mathbb F_2^n$ where each string has $n$ binary digits equally likely. $\mathbb F_2$ represens the binary digits.

The Hamming distance is between two vectors $x,y\in\mathbb F_2^n$ is the number of places where they differ: $d(x,y)=|\{j:x_j\not = y_j\}|$

How can I evaluate the expected distance then?

Best Answer

In effect you’re choosing one word at random and asking for its expected distance from the zero word. That’s clearly $n/2$: every word at distance $k$ has a word at distance $n-k$ as its complement.

Related Question