CS 1501 Summer 2009 Quiz 2
Thursday, July 16, 2009

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(70, 40) = __GCD(40,30) = GCD(30,10) = GCD(10,0) = 10_____________________________

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

d)       A graph is stated to be _____ biconnected _________ if it has no articulation points.

e)       A heap as used for a priority queue is defined to be ___a complete binary tree such that each node in the tree has a higher priority than either of its children___.

 

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

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

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

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

i)        The only difference between the PFS algorithm for minimum spanning trees and the PFS algorithm for weighted shortest path is in how the priority for each vertex is calculated.  True

j)        To do a deleteMin operation in a min-heap, we remove the root node and replace it with the minimum of its two children.  False – we donŐt delete the root node at all – rather we copy the last leaf value to the root and delete the last leaf.

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

a)       Show (using pictures and explanation in detail) how an RSA (digital) envelope works, and why it is used.  NOTE: This is NOT a digital signature!

 

See Slides 184-185 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 181-182 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.

3)    (5 points) Consider an undirected graph with V vertices.  State and justify the minimum and maximum number of edges, E, in the graph.

Min E = 0. No edges are required in a graph

Max E = V(V-1)/2.  Each vertex will have an edge to each other vertex, which will yield V(V-1) edges. However, this counts each edge twice, so the total is V(V-1)/2.

 

4)    (5 points) One rule that must be satisfied for a network flow is the following:

For all u in V – {S, T} the sum of [flow on edges from u] = 0

Explain in words (a sentence or two) what this rule means.

See slide 235 from notes.  All vertices except the source and sink have an overall "net" flow of 0 – meaning that the total flow entering a vertex must equal the flow exiting it.

 

5)    (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 Breadth-First Search Spanning Tree (starting from vertex A) were created for the graph.  val[] is the BFS visit order for the vertex, and dad[] is the parent vertex in the BFS 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

4

8

10

3

5

6

7

9

dad

0

A 1

B 2

C 3

D 4

A 1

B 2

F 6

F 6

G 7

 

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

A,  B,  D,  F