Department of Mathematics University of British Columbia MATH 342 Practice Midterm 1 Family Name: Initials: I.D. Number: Problem Signature: Mark Out of 1 20 2 20 3 20 4 20 5 20 Total 100 CALCULATORS, NOTES OR BOOKS ARE NOT PERMITTED. THERE ARE 5 PROBLEMS ON THIS EXAM. JUSTIFY YOUR ANSWERS. MATH 342 Math 342 Practice Midterm 1 2 1. Let C be a code with minimum distance d(C) = 7. (a) Find the maximum number of errors that can be corrected, using an incomplete nearest neighbour decoder. (b) Find the maximum number of errors that can be detected. (c) Explicitly describe a hybrid decoder which is guaranteed to correct up to 2 errors and to detect 3 errors and to detect 4 errors. Prove that your decoder works. Solution: a. As shown in class, the maximum number of errors that can be corrected is b d(C)−1 c = 3. 2 b. As shown in class, the maximum number of errors that can be detected is d(C) − 1 = 6. c. Let x be the received word and c0 be the nearest neighbour codeword. If d(x, c0) ≤ 2, decode x to c0. If d(x, c0) ≥ 3, declare an error. Proof that this works: Let c be the transmitted codeword. Case 1: 1 or 2 channel errors. Then d(x, c) ≤ 2 and so d(x, c0) ≤ 2. Thus, decoder decodes to c0. And d(c, c0) ≤ d(c, x) + d(x, c0) ≤ 4. Since d(C) = 7, c = c0, and so decoder (correctly) decodes to c. MATH 342 Case 2: Math 342 Practice Midterm 1 3 3 or 4 channel errors. Then 3 ≤ d(x, c) ≤ 4. So, the decoder will correctly detect an error unless d(x, c0) ≤ 2. But then d(c, c0) ≤ d(c, x) + d(x, c0) ≤ 6. Since d(C) = 7, c = c0. But this is impossible since d(x, c0) 6= d(x, c). MATH 342 Math 342 Practice Midterm 1 4 2. True or False (if True, give a brief proof; if False, give a counter-example) a) Every binary code C of length 8 is equivalent to a binary code which contains the codeword 01010101. b) Every binary code C of length 8 with d(C) = 8 is equivalent to a binary code which contains the codewords 00000000 and 11111111. c) If two binary codes have the same n, M, and d parameters, then they are equivalent. Solution: a. True: Let c ∈ C. For each of i = 1, 3, 5, 7, if ci = 0, do nothing; if xi = 1, flip the bit in position i in each codeword. For each of i = 2, 4, 6, 8, if ci = 1, do nothing; if xi = 0, flip the bit in position i in each codeword. This yields an equivalent code where x is transformed to 01010101. b. True: Let c, c0 ∈ C such that d(c, c0) = 8. Then c and c0 differ in each position. Apply bit flips in each position i in all codewords such that ci = 1. This yields an equivalent code where c is transformed to 00000000. Since c and c0 differ in each position, c0 is transformed to 11111111. c. False: from HW2, K1 = {000, 100, 010}, K2 = {000, 100, 111}; even though the two codes have the same (n, M, d) parameters, K2 has a pair of codewords with distance = 3, and K1 does not. MATH 342 Math 342 Practice Midterm 1 5 MATH 342 Math 342 Practice Midterm 1 6 3. Find A2(10, 7). Solution: Let C be a (10, M, 7) code. Up to equivalence, we may assume that C contains the all 0’s word 0. Then all other codewords must have weight at least 7. If there were two distinct such codewords c, c0, then d(c, c0) ≤ d(c, 1) + d(1, c0) ≤ 3 + 3 = 6, a contradiction (here, 1 denotes the all 1’s word). Thus, A2(10, 7) ≤ 2. Letting x denote any word of length 10 with exactly 7 ones, we see that the code {x, 0} has minimum distance 7. Thus, A2(10, 7) ≥ 2, and so A2(10, 7) = 2. MATH 342 Math 342 Practice Midterm 1 7 MATH 342 Math 342 Practice Midterm 1 8 4. Let G = {I, R1, R2, F1, F2, F3} be the group of rigid motions that preserve an equilateral triangle centered at the origin, with composition of mappings as addition. Here, I is the identity map, R1 is rotation by 2π/3 counter-clockwise, R2 is rotation by 4π/3 counter-clockwise, and Fi, i = 1, 2, 3 is the reflection that fixes vertex i (with the vertices in counter-clockwise order). Recall that G is non-abelian. (a) Show that H = {I, F1} is a subgroup of G. (b) Find all the cosets, a + H, of H in G. (c) Show that K = {I, R1, R2} is a subgroup of G. (d) Find all the cosets, a + K, of K in G. (e) Find the smallest subgroup of G that contains both F1 and F2. Solution: a. Addition table for H: + I F1 I I F1 F1 F1 I Thus, H is closed under addition. Since, I −1 = I and F1−1 = F1, H is closed under inverses. So H is a subgroup. b. There are 3 cosets: H = {I, F1}, R1 + H = {R1, R1 ◦ F1} = {R1, F3}, R2 + H = {R2, R2 ◦ F1} = {R2, F2} MATH 342 Math 342 Practice Midterm 1 9 c. Addition table for K: + I R1 R2 I I R1 R2 R1 R1 R2 I R2 R2 I R1 Thus, K is closed under addition. Since, I −1 = I, R1−1 = R2, and R2−1 = R1, K is closed under inverses. Thus, K is a subgroup. d. There are 2 cosets: K = {I, R1, R2}, F1 + K = {F1, F1 ◦ R1, F1 ◦ R2} = {F1, F2, F3} e. The smallest such subgroup L must contain F1 ◦ F2 = R1 and so also contains R1 ◦ R1 = R2. And then it must contain F1 ◦ R2 = F3. Since any subgroup contains the identity, L = G. MATH 342 Math 342 Practice Midterm 1 10 5. Let q and m be positive integers. Show that Zm, as a group with addition modulo m, has a subgroup of size q iff q divides m. Solution: Only if: Let H be a subgroup of size q. By Lagrange’s theorem, H has |G| |G| cosets and thus |H| |H| must be an integer. Thus, q = |H| must divide m = |G|. If: Let H = {im/q : 0 ≤ i ≤ q − 1}, a subset of Zm of size q. We can view H as {im/q mod m : i ∈ Z}. To see that H is a subgroup of Zm, we must show that it is closed under addition and inverses. Addition: im/q + jm/q = (i + j)m/q mod m ∈ H Inverses: −im/q = (−i)m/q mod m ∈ H MATH 342 Math 342 Practice Midterm 1 11