CS 3133, A Term 1998
Foundations of Computer Science
Homework 5 (due Oct. 13)

This page is located at http://www.cs.wpi.edu/~alvarez/CS3133/HW5.html


  1. Big O notation for two parameters: Given functions f(m,n) and g(m,n), the notation f(m,n) = O(g(m,n)) means that there are three numbers C, m0, n0 such that |f(m,n)| <= C |g(m,n)| whenever one simultaneously has both m>=m0 and n>=n0.
    Show that if a function f(m,n) satisfies f(m,n) <= n + m2, then also f(m,n) = O(n m2). Your solution should include values for C, m0, n0 and an explanation of why those values work.

  2. a) Construct a polynomial time verifier for the satisfiability problem 3-SAT discussed in class. Here, by a polynomial time verifier we mean a (deterministic) algorithm that decides, given both a formula H of the special form described below and a candidate truth assignment A, if A makes H true or not, and does so in time O(np mq), where n is the total number of variables and m is the number of clauses in H.

    Recall that the input for the 3-SAT problem is a formula H in conjunctive normal form, i.e. a conjunction of m disjunctive clauses C1, ...,Cm. Each clause Ci is the disjunction of exactly 3 literals Li,1, Li,2, Li,3. Each literal is a Boolean variable xj or its negation ~xj. There are assumed to be n variables x1,..., xn. Different clauses may share some or all of their variables. The output for the 3-SAT problem is a yes/no answer, where yes means that there is a truth assignment for all of the variables xj that makes H true according to the usual truth tables for negation (not), conjunction (and), and disjunction (or). A no answer means that every truth assignment for the variables makes H false.

    b) Carefully calculate the time complexity of your verifier as a function of the parameters m and n described in part a) above.

  3. Extra credit:

    Show that 3-SAT can be reduced to the following vertex cover problem VC in polynomial time. This shows that VC is also NP-complete.

    The input to VC is a graph G and a number k. The output should be yes if there is a set C containing k or fewer vertices of G such that every edge of G has one of its endpoints in C. The output should be no otherwise.

    Hint: VC is related to the independent vertex set problem IVS discussed in class, in which a graph G and a number k are given, and it must be determined if there is a set I containing k vertices of G, no two of which are connected by an edge of G.