
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