1. Find the big-oh relationships for the following functions.
Give your calculations. [20]
n1/2, (2/3)n, en,
,
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
= c(n/2 - i) for
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:
,
,
,
.
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]