Department of Mathematics
University of British Columbia
MATH 342 Midterm 1
February 11, 2016 9:30 AM - 10:50 AM
Initials:
Signature:
Family Name:
I.D. Number:
Problem Mark
5
6
Total
3
4
1
2
Out of
15
15
90
15
15
15
15
CALCULATORS, NOTES OR BOOKS ARE NOT PERMITTED.
THERE ARE 6 PROBLEMS ON THIS EXAM.
JUSTIFY ALL OF YOUR ANSWERS.
MATH 342 Math 342 Midterm 1
1. Which of the following pairs of codes are equivalent?
(a) ( q = 2) K
1
= { 000000 , 111111 }
K
2
= { 101010 , 010101 } .
(b) ( q = 2) K
1
= { 000000 , 000111 , 111111 } ,
K
2
= { 000000 , 000111 , 111000 }
(c) ( q = 3) K
1
= { 000000 , 111111 , 222222 } ,
K
2
= { 000111 , 111222 , 222000 }
(d) ( q = 5)
K
1
= { 01234 , 12340 , 23401 , 34012 , 40123 } ,
K
2
= { 43210 , 04321 , 10432 , 21043 , 32104 } ,
Solution: a. Equivalent: flip the bit values in each odd position.
b. Equivalent: flip the bit values in positions 4,5,6.
c. Equivalent: permute the values in each of the positions 4,5,6 by the permutation f (0) = 1 , f (1) = 2 , f (2) = 0.
d. Equivalent: the codewords of K
2 are obtained by writing the codewords of K
1 backwards; so, permute the 5 positions according to: f (1) =
5 , f (2) = 4 , f (3) = 3 , f (4) = 2 , f (5) = 1.
2
MATH 342 Math 342 Midterm 1
3
MATH 342
2.
Math 342 Midterm 1
Find the minimum distance of each of the following codes.
(a) ( q = 3) { 121 , 101 , 211 }
(b) The set of all binary words with length 77 and with even weight.
(c) The set of all binary words with length 77 and with odd weight.
4
Solution: a.
d (121 , 101) = 1 , d (121 , 211) = 2 , d (101 , 211) = 2. So, the minimum distance is 1.
b. and c. If the distance between two words is 1, then one must have even weight and the other has odd weight. Thus, for both parts b and c, the minimum distance is at least 2. In fact, the minimum distance for part b is 2, because because the distance between the all zeros word and the word which has exactly two 1’s is 2. Similarly, the minimum distance for part c is 2, because the distance between a word with a single 1 and a word with exactly three 1’s is 2.
MATH 342 Math 342 Midterm 1
5
MATH 342
3.
Math 342 Midterm 1
Do there exist ternary codes (i.e., codes with alphabet { 0 , 1 , 2 } ) with the following parameters?
6
(a) (3 , 3 , 3)
(b) (6 , 60 , 3)
(c) (100 , 3
93
+ 1 , 8)
Solution: a. Yes, { 000 , 111 , 222 } .
b. By Singleton bound, A
3
(6 , 3) ≤ 3
6 − 3+1 out the possibility of a (6 , 60 , 3) code.
= 3
4
= 81 .
This does not rule
By Hamming bound,
A
3
(6 , 3) ≤ b
3
6
1 + 6 · 2 c = b
729 c = 56 .
13
Thus, there is no (6 , 60 , 3) code.
c. By Singleton bound, A
3
(100 , 8) ≤ 3
100 − 8+1
(100 , 3
93
+ 1 , 8) code.
= 3
93
.
Thus, there is no
MATH 342 Math 342 Midterm 1
7
MATH 342
4.
Math 342 Midterm 1
Let C be a code with minimum distance d . Given integers s > 0 and t > 0 such that 2 s + t < d , state an explicit hybrid decoder that is guaranteed to correct up to s errors and guaranteed to detect k errors for all k such that s < k ≤ s + t . Prove that your hybrid decoder works as guaranteed.
8
Solution:
Let x be the received word and c 0 be the nearest neighbour codeword.
If d ( x, c
0
) ≤ s , decode x to c
0
. If d ( x, c
0
) > s , declare an error.
Proof that this works:
Let c be the transmitted codeword.
Case 1: at most s channel errors.
Then d ( x, c ) ≤ s and so d ( x, c
0
) ≤ s . Thus, decoder decodes to c
0
. And d ( c, c
0
) ≤ d ( c, x ) + d ( x, c
0
) ≤ 2 s
Since d ( C ) > 2 s + t > 2 s , c = c
0
, and so decoder (correctly) decodes to c .
Case 2: at least s + 1 but no more than s + t errors.
Then s < d ( x, c ) ≤ s + t . So, the decoder will correctly detect an error unless d ( x, c
0
) ≤ s . But then d ( c, c
0
) ≤ d ( c, x ) + d ( x, c
0
) ≤ 2 s + t < d.
So, c = c
0
. But this is impossible ssince d ( x, c
0
) ≤ s < d ( x, c ).
Note that it is not necessary to assume s > 0 or t > 0; the case s = 0 corresponds to pure detection and the case t = 0 corresponds to pure correction.
MATH 342 Math 342 Midterm 1
9
MATH 342 Math 342 Midterm 1
10
5.
Let G be the group
Z 12 with addition modulo 12. For each of the following subsets H of G , say whether or not H is a subgroup of G and, if so, find all of its cosets.
(a) H = { 0 , 6 }
(b) H = { 1 , 3 , 5 , 7 , 9 , 11 }
(c) H = { 0 , 2 , 4 , 6 , 8 , 10 }
(d) H = { 0 }
Solution: a. 0 + 0 = 0 , 0 + 6 = 6 , 6 + 0 = 6 , 6 + 6 = 0. So, closure holds. And
− 0 = 0 , − 6 = 6 and so H has inverses. Thus, H is a subgroup. Its cosets are:
{{ 0 , 6 } , { 1 , 7 } , { 2 , 8 } , { 3 , 9 } , { 4 , 10 } , { 5 , 11 }} b.
H does not have an the identity element and thus is not a subgroup.
c. For an even integer m , the sum of any two even integers mod m is even. Thus closure holds. And
− 0 = 0 , − 2 = 10 , − 4 = 8 , − 6 = 6 , − 8 = 4 , − 10 = 2
So, H has inverses.
So H is a subgroup.
Its cosets are itself and
{ 1 , 3 , 5 , 7 , 9 , 11 } .
d.
H is a subgroup because it is clearly closed under addition and
− 0 = 0. Its cosets are the individual elements of
Z 12
.
MATH 342 Math 342 Midterm 1
11
MATH 342 Math 342 Midterm 1
12
6. Let G and H be groups, with + denoting the group operation for both groups G and H . Define
G × H := { ( g, h ) : g ∈ G, h ∈ H } and for all ( g, h ) ∈ G × H, ( g
0
, h
0
) ∈ G × H
( g, h ) ⊕ ( g
0
, h
0
) := ( g + g
0
, h + h
0
)
(a) Show that G × H with operation ⊕ is a group, by verifying the group axioms.
(b) Find explicit subgroups of
Z 6
×
Z 15 with size 3, 9 and 10.
Solution: a. We verify the 4 axioms.
Closure: for all ( g, h ) ∈ G × H, ( g
0
, h
0
) ∈ G × H
( g, h ) ⊕ ( g
0
, h
0
) := ( g + g
0
, h + h
0
) ∈ G × H.
Associativity:
(( g, h ) ⊕ ( g
0
, h
0
)) ⊕ ( g
00
, h
00
) = ( g + g
0
, h + h
0
)) ⊕ ( g
00
, h
00
)
= (( g + g
0
) + g
00
, ( h + h
0
) + h
00
) = ( g + ( g
0
+ g
00
) , h + ( h
0
+ h
00
))
= ( g, h ) ⊕ ( g
0
+ g
00
, h
0
+ h
00
) = ( g, h ) ⊕ (( g
0
, h
0
) ⊕ ( g
00
, h
00
))
Identity:
Let 0 denote the identity in both G and H . We claim that (0 , 0) is the identity in G × H . Proof:
( g, h ) ⊕ (0 , 0) = ( g + 0 , h + 0) = ( g, h )
(with a similar argument to show (0 , 0) ⊕ ( g, h ) = ( g, h )).
Inverses: Let g ∈ G, h ∈ H . Then,
( g, h ) ⊕ ( − g, − h ) = ( g − g, h − h ) = (0 , 0)
(with a similar argument to show ( − g, − h ) ⊕ ( g, h ) = (0 , 0)).
MATH 342 Math 342 Midterm 1
Thus ( − g, − h ) is the inverse of ( g, h ).
b. size 3: { 0 , 2 , 4 } × { 0 } or { 0 } × { 0 , 5 , 10 } or { (0 , 0) , (2 , 5) , (4 , 10) } .
size 9: { 0 , 2 , 4 } × { 0 , 5 , 10 } size 10: { 0 , 3 } × { 0 , 3 , 6 , 9 , 12 }
13