CS 1501 Summer 2006 Quiz 2
Monday, July 17, 2006

SOLUTIONS

1)      Fill in the Blanks and True/False (20 points -- 2 points each).
Complete the statements below with the MOST APPROPRIATE words/phrases.

a)         An algorithm that is linear in the value of an integer, X, is _____exponential___________ in the number of bits, N, in X.

b)         Using Euclid's GCD algorithm, show the chain of recursive calls and the solution to the following: GCD(45, 27) = __GCD(27,18) = GCD(18,9) = GCD(9,0) = 9_____________________________

c)         Given a substitution cipher on an alphabet with S characters, there are _______S!______________ possible keys for the cipher.

d)         A graph with V vertices and E edges is considered to be sparse if _____E <= VlgV ______

e)         A graph G is said to be biconnected if ____there are two distinct paths between all vertex pairs (or, it has no articulation points)_____.

Indicate whether each of the following is TRUE or FALSE, explaining why in an informative way for false answers.

f)          If a file contains completely random data it cannot be effectively compressed by any general compression algorithm.        True

g)         A Vernam cipher is provably secure for one-time use.  True

h)         If someone comes up with an efficient, polynomial-time factoring algorithm, the RSA encryption scheme will no longer be useful.  True

i)           The Miller-Rabin Witness algorithm is used to verify the authenticity of sent messages.  False – it is used to test primality.

j)           An advantage of an adjacency matrix representation of a graph is that all neighbors of a vertex can be found in time Theta(V) (where V is the number of vertices in the graph).  False – the time is correct but it is a DISadvantage.

2)      (10 points)  Consider the simple divide and conquer algorithm (NOT Karatsuba's) for N-bit integer multiplication.  Show precisely how each number is divided and how the multiplication is done on the numbers (i.e. show the formula for XY based on how X and Y are divided).  Also state and justify the recurrence relation for this process.

Answer: From lecture slides 140-145

X = 2N/2(XH) + XL                                Y = 2N/2(YH) + YL

XY = (2N/2(XH) + XL)*(2N/2(YH) + YL)

XY = 2NXHYH + 2N/2(XHYL + XLYH) + XLYL

Examining the last equation we see 4 multiplications of size N/2, some ~N bit additions and some shifting (multiplication by a power of 2).  This leads to the recurrence: T(N) = 4T(N/2) + Theta(N)

3)       (10 points – 5 + 5) Consider RSA encryption

a)         Show (using pictures and explanation in detail) how a digital signature works, and why it is used.

See Slides 189-191 of online notes

b)         Explain the direct method for breaking RSA that we discussed in lecture.  Be specific (i.e. mathematical) about the details.  Also explain why this is a difficult task for cryptanalysts.

See Slides 185-186 of online notes.  Breaking RSA directly involves factoring the value N, which is part of both the private and public keys.  Once N is factored into its primes (N = XY) we can then determine PHI (= (X-1)(Y-1)).  The public key E is already known.  Thus the cryptanalyst will have E and PHI and can determine D (the decryption key) by solving the formula  ED mod PHI = 1.

Factoring is believed to be an exponential problem, which, for large bit sizes is infeasible to do in a reasonable period of time.  Thus, if the keys are large and are not kept for two long, they are quite secure from this attack.

4)      (10 points – 8 + 2)  Consider the graph below.  Assume the vertices are stored in alphabetical order, and that the edges are stored in alphabetical order for each vertex.

a)         Complete the table below, as it would look after a Depth-First Search Spanning Tree (starting from vertex A) were created for the graph.  val[] is the DFS visit order for the vertex, and dad[] is the parent vertex in the DFS tree.  Show your work above or in the space below the table for partial credit.

 A B C D E F G H I J val 1 2 3 4 5 8 7 9 10 6 dad 0 A 1 B 2 C 3 D 4 A 1 J 10 F 6 F 6 D 4

b)         Identify all of the articulation points in the graph.

A,  B,  D,  F