CS 1501 Summer 2008 Quiz 2
Thursday, July 17, 2008
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 with V vertices
and E edges is considered to be dense if _____E ~= V2
______
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 dont delete the root node at all rather we copy the last leaf value to
the root and delete the last leaf.
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 132-138
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 an RSA (digital)
envelope works, and why it is used.
NOTE: This is NOT a digital signature!
See
Slides 183-184 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 180-181 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 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