Docsity

CMSC 651 Homework 5: Grey Codes, Matrix Multiplication, Network Flows - Prof. William Gasa, Assignments of Computer Science

Toggle sidebar
bg1
Fall 2006 CMSC 651: Homework 5 Due: Due Nov 13
(This is a WRITTEN HW)
1. (25 points) Let k, n โˆˆN. An (n, k )-Grey Code is a list of all elements of {1,2, . . . , k}nsuch
that every two adjacent elements differ in only one place, and in that one place they differ by
one. (EXAMPLE: For k= 3, n= 2
GREY CODE: 00,01,02,12,11,10,20,21,22.
NOT a GREY CODE: 00,01,02,12,10,11,21,20,22)
Prove that, for all k, n, there exists a Grey Code.
2. (25 points) Fill in the following sentence:
If you want to do Matrix Multiplication of nร—nmatrices in O(n3/log n) steps over Zkthen
you need to have a listing of {0,1,2, . . . , k โˆ’1}nthat has property YYY. (Property YYY
should NOT be a grey code, but something that includes grey codes.)
3. (25 points) Prove the following rigorously: if (G, s, t, c) is an instance of the network flow
problem, cmaps edges to naturals, fis a flow, and Gfis the residual graph, and if Gfhas a
path from sto twith the least edge having Lon it, then there exists a flow with value |f|+L.
4. (25 points) Give an example of an instance of the flow problem (G, s, t, c), and a flow f, such
that all the paths from sto tin Gfuse an edge e= (u, v) such that (u, v) is not in G(but
(v, u) is).
1

Partial preview of the text

Download CMSC 651 Homework 5: Grey Codes, Matrix Multiplication, Network Flows - Prof. William Gasa and more Assignments Computer Science in PDF only on Docsity!

Fall 2006 CMSC 651: Homework 5 Due: Due Nov 13

(This is a WRITTEN HW)

  1. (25 points) Let k, n โˆˆ N. An (n, k)-Grey Code is a list of all elements of { 1 , 2 ,... , k}n^ such that every two adjacent elements differ in only one place, and in that one place they differ by one. (EXAMPLE: For k = 3, n = 2 GREY CODE: 00,01,02,12,11,10,20,21,22. NOT a GREY CODE: 00,01,02,12,10,11,21,20,22) Prove that, for all k, n, there exists a Grey Code.
  2. (25 points) Fill in the following sentence: If you want to do Matrix Multiplication of n ร— n matrices in O(n^3 / log n) steps over Zk then you need to have a listing of { 0 , 1 , 2 ,... , k โˆ’ 1 }n^ that has property YYY. (Property YYY should NOT be a grey code, but something that includes grey codes.)
  3. (25 points) Prove the following rigorously: if (G, s, t, c) is an instance of the network flow problem, c maps edges to naturals, f is a flow, and Gf is the residual graph, and if Gf has a path from s to t with the least edge having L on it, then there exists a flow with value |f | + L.
  4. (25 points) Give an example of an instance of the flow problem (G, s, t, c), and a flow f , such that all the paths from s to t in Gf use an edge e = (u, v) such that (u, v) is not in G (but (v, u) is).