Can't figure out intersections between two binary numbers for a certain hamming distance

279 Views Asked by At

I am making a mistake somewhere in my calculation:

say I have two numbers: 00000 and 11110

Then I find out each of their HD=4 values:

For 00000 the list is:

5C4 possibilities

For 11110 the list is:

5C4 possibilities

My calculation for their intersecting elements comes to 2 based on:

(2C1)*(3C3)=2

But I manually found out all the possibilities and it is 0; Where am I wrong ?

1

There are 1 best solutions below

2
On

The number of strings with a fixed hamming distance from a given string will always be the same.

Strings of hamming distance $4$ from $00000$ will need at least four ones since you need to switch at least four of the digits. Similarly, strings of hamming distance $4$ from $11110$ will need at least three zeros (or at most two ones): since we only have $5$ digits to work with, we can't satisfy both conditions simultaneously. Hence the intersection is empty.