CS 600 Test I



October 13, 1999



1. Find the big-oh relationships for the following functions. Give your calculations. [20]

n1/2, (2/3)n, en, $(\ln n )^{2}$, n!.

2. Let L be an array of size n, let L[i] denote the i-th key of L, let x be the key being searched for in L, and let p(i) be the probability for x = L[i].
Suppose that x is always found in L with the following probability:
p(i) = ci for $1 \leq i \leq n/2$
= c(n/2 - i) for $n/2 + 1 \leq i \leq n$
where c is a constant.

(a) Formulate the equation for computing the average time of the Sequential Search with the probability distribution given above. [10]
(b) Compute the average time from (a). You do not have to compute the value of c. [15]
(c) Determine the value of constant c in terms of n and express the average time in terms of n only. What is the asymptotic average time ? [20]

You may use the following formulas if you need them:
$\Sigma_{i=1}^{n} i2^{i} = (n - 1) 2^{n + 1} + 2$, $\Sigma_{i=1}^{n} i^{2} = n( n + 1 )(2n + 1)/6$,
$\Sigma_{i=1}^{n} i^{3} = ( n( n + 1 )/2 )^{2}$, $\lg (n!) = \Theta(n\lg n)$.

3. Find a certificate for the following problems: [15]

(a) The satisfiability problem of conjunctive normal form of Boolean expressions (CNF SAT)
(b) Bin Packing
(c) Graph Coloring

4. The subgraph isomorphism problem asks whether or not a given graph is a subgraph of another graph.

(a) Give a certificate for the subgraph isomorphism problem. [5]
(b) Prove that the subgraph isomorphism problem is in NP. [15]