Problem 7 in section 3 of Chapter 1 of Error Correcting Codes Theory by MacWilliams.

50 Views Asked by At

The problem goes as follows:

Define the intersection of binary vectors $x,y$ to be the vector: $x*y = (x_1y_1,\ldots , x_n y_n ) $ which has 1's only where both $x$ and $y$ do. Show that $$wt(x+y) = wt(x) + wt(y)-2wt(x* y).$$ Where $wt$ is Hamming weight, defined as the number of non zero entries in the vector.

I want to show this identity then I thought of the following proof, let me know if it's ok or need some tweaking.

$$wt(x+y) = \# \text{of non 0's in (x+y)}=\#\text{of non zero in x and zero in y}+\#\text{of zero in x and non-zero in y}=wt(x)-wt(x*y)+wt(y)-wt(x*y)$$

Now obviously they are symmetric so I thought to myself it's enough to prove for the first term above.

If we subtract from $\# \text{of non zeros in x}$, $wt(x*y)$, we get $\# \text{of non zero in x and zero in y}$. If there's a $0$ in $y$ and a nonzero in $x$ then subtract from $wt(x)$ the $\# \text{ of nonzeros in x the # of nonzeros in $x*y$}$. And this justifies the claim.

Is this right, or there's another subtler justification?

Thanks.

1

There are 1 best solutions below

0
On BEST ANSWER

Perhaps I'm just not following your argument, but it doesn't look to me that you've actually justified why $$\#\text{entries that are 1 in x and 0 in y}=wt(x)-wt(x*y).$$ Perhaps it's easier to show $$wt(x)=\#\text{entries that are 1 in x and 0 in y}+wt(x*y).$$ The left hand side is the size of the set $A=\{i:x_i=1, y_i =0\text{ or }1\}$. The first term on the right hand side is the size of the set $B=\{i:x_i=1,y_i=0\}$, and the last term on the right hand side is the size of the set $C=\{i:x_iy_i=1\}=\{i:x_i=1,y_i=1\}$. Now it should be clear that $B$ and $C$ are disjoint and $A=B\cup C$, so it follows that $|A|=|B|+|C|$, and this proves the claim.