University of Illinois
Spring 2011
ECE 361:
Second MidSemester Exam: Solutions
1. Let
x
,
y
, and
z
denote three binary vectors of length
n
. The
Hamming distance
d
H
(
x
,
y
)
between
x
and
y
is the number of coordinates in which
x
and
y
diﬀer. The
Hamming weight
w
H
(
x
) of
x
is the number of nonzero entries in
x
, that is, w
H
(
x
) =
d
H
(
x
,
0
) where
0
is the
allzeroes vector. Equivalently, w
H
(
x
) =
∑
i
x
i
where the sum is the ordinary arithmetic sum
of 0’s and 1’s, not an XOR summation.
(a) Suppose that
each
of
x
,
y
, and
z
is at the
same
Hamming distance
d >
0 from the
others
.
Mark the box for each true statement among the following.
2
It is possible to ﬁnd
x
,
y
, and
z
such that w
H
(
x
), w
H
(
y
), and w
H
(
z
) all are
odd
numbers.
2
It is possible to ﬁnd
x
,
y
, and
z
such that w
H
(
x
), w
H
(
y
), and w
H
(
z
) all are
even
numbers.
2
It is possible to ﬁnd
x
,
y
, and
z
such that
exactly two
of w
H
(
x
), w
H
(
y
), and w
H
(
z
)
are
even
numbers and the third one is an odd number.
2
It is possible to ﬁnd
x
,
y
, and
z
such that
exactly two
of w
H
(
x
), w
H
(
y
), and w
H
(
z
)
are
odd
numbers and the third one is an even number.
2
It is possible to ﬁnd
x
,
y
, and
z
such that the common distance
d
is an odd number.
2
It is possible to ﬁnd
x
,
y
, and
z
such that the common distance
d
is an even number.
Solution:
d
H
(
x
,
y
) = w
H
(
x
⊕
y
) = w
H
(
x
)+w
H
(
y
)

2
·
w
H
(
x
∧
y
) is even if both w
H
(
x
)
and w
H
(
y
) are even numbers, or both are odd numbers. If one of w
H
(
x
) and w
H
(
y
) is
odd and the other is even, then
d
H
(
x
,
y
) is odd. Thus, if
d
is odd, then the Hamming
weights of
x
,
y
, and
z
must have diﬀerent parities from each other, which is impossible.
In other words, either all three vectors have odd weight or all three have even weight,
and in both cases,
d
must be even. Alternatively,
d
= w
H
(
x
⊕
y
) = w
H
(
x
) + w
H
(
y
)

2
·
w
H
(
x
∧
y