Homework 2

[Note: this webpage last modified Friday, 04-Feb-2011 19:44:51 EST]

This homework assignment will be handed out on Wednesday September 1 and is due by the beginning of class on the following Wednesday, so by 3pm Wednesday September 8.

  1. Prove that the following decision problems are in NP.

    1. (10 Points) Composite numbers: x, an integer given in binary, is in COMP if x is a composite number.

    2. (10 Points) Graph isomorphism: a pair of graphs (G1, G2) is in GI if G1 is isomorphic to G2 (there exists a function f mapping the vertices between G1 and G2 such that (u,v) is an edge in G1 if and only if (f(u), f(v)) is an edge in G2 - in other words, G2 is just a relabling of G1).

    3. (10 Points) 3-Colorability: an undirected graph G is in 3COL if the graph can be colored with three colors such that for every edge (u,v) in G, u and v have different colors.

  2. You should know that any exponential function is larger than any polynomial function, and that any polynomial function is larger than any logarithmic function. This problem shows that there are functions in between each of these as well.

    1. (10 Points) Give a function who's big-O complexity is between logarithmic and polynomial. That is, give f(x) such that: 1) f(x) is not O(log(xd)) for any constant d>0, and 2) xd is not O(f(x)) for any constant d>0. Use the definition of big-O to prove that your function has these two properties. There are two different definitions - one that was used in the model solutions to the first homework assignment, and another that uses limits that you can lookup. You may use either definition.

    2. (10 Points) Use the result of part (a) to give a function h(x) between polynomial and exponential. That is, give h(x) such that: 1) h(x) is not O(xd) for any constant d>0, and 2) 2xd is not O(h(x)) for any constant d>0. Prove that your function has these two properties.

  3. (20 Points) Exercise 2.22 from the Goldreich text - showing that 2SAT is in P.

    Hint: an alternative approach to that outlined in the Goldreich text is to look at the "implication graph" associated with a 2CNF formula. For each variable xi in the formula, the implication graph has a vertex for xi and a vertex for (not xi). For every clause (xi ∨ xj) in the 2CNF formula, the implication graph has directed edges representing (not xi → xj) and (not xj → xi)

The following problem was originally assigned as part of this homework, but I have "removed" it. You no longer have to do this problem. I will leave it stated here in case you wanted to work on it anyway.