Problem Set 5
Problem Set 5
Problem Set 5
This problem set is due at 9:00pm on Wednesday, March 21, 2012.
Both exercises and problems should be solved, but only the problems should be turned in.
Exercises are intended to help you master the course material. Even though you should not turn in
the exercise solutions, you are responsible for material covered by the exercises.
Mark the top of the first page of your solution with your name, the course number, the problem
number, your recitation section, the date, and the names of any students with whom you collabo-
rated. The homework template (LATEX) is available on the course website.
You will often be called upon to “give an algorithm” to solve a certain problem. Your write-up
should take the form of a short essay. A topic paragraph should summarize the problem you are
solving and what your results are. The body of the essay should provide the following:
2. At least one worked example or diagram to show more precisely how your algorithm works.
Remember, your goal is to communicate. Full credit will be given only to correct solutions that
are described clearly. Convoluted and opaque descriptions will receive lower marks.
(a) You are given a non-zero vector ~u ∈ Znp , and some number c ∈ Zp . Prove that
if another vector ~v ∈ Znp has each element chosen independently and uniformly at
random from Zp , then the probability that ~v · ~u = c is 1/p.
(Hint: Observe that any non-zero vector ~u of size n has n − 1 elements which can be
arranged into a non-zero vector of size n − 1. Then use induction to prove the claim.)
In class, we have seen a couple examples of universal hash families. We will now devise another
universal hash family based on random matrices.
(b) You are given two vectors ~x, ~y ∈ Znp such that ~x =
6 ~y . Using the result from part (a),
show that if ~v is a random vector as before, then Pr(~v · ~x = ~v · ~y ) = 1/p.
Handout 12: Problem Set 5 3
(c) Using the result from part (b), show that if A is an m × n matrix with each element
chosen independently and at random from Zp , then Pr(A~x = A~y ) = 1/pm .
(d) Conclude that the family H of all such functions hA (~x) = A~x where A is an m × n
matrix with elements in Zp , is universal.
In the implementation of the encryption algorithm BitWhipperTM, the key step is to perform the
composition of two hashes to compute the vector ~y ∈ Zk2 such that ~y = hB (hA (~x)), where ~x ∈ Zn2 ,
A is an m × n matrix, B is a k × m matrix, and hA and hB are defined as in part (d) with p = 2.
Note that all operations here are performed in Z2 , which means all additions are bit-wise XOR.
Ben Bitdiddle gives you a k × n matrix C over Z2 , which he says is equal to B · A. If he’s right,
you could just use hC (~x) in the implementation of BitWhipperTM , in lieu of hB (hA (~x)). You want
to make sure that C = B · A, but you don’t want to multiply the matrices because it will take you
O(kmn) time.
In part (e), you will come up with a randomized algorithm that runs much faster than O(kmn)
time, and also runs faster than any known algorithm for rectangular matrix multiplication.
(e) Using the result from part (a), devise a randomized algorithm to determine if C =
B · A. Show that your algorithm is correct with probability at least 90%.
MIT OpenCourseWare
http://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.