Homework 3

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

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

  1. In this problem you get some practice designing polynomial time algorithms. Part (b) was originally assigned on Homework 2, but I thought many of you needed extra time to work on the problem.

    1. (10 Points) Prove that the problem 2-Colorability is computable in polynomial time, i.e., it is in P. A graph is 2-colorable if the vertices can be colored with two colors (red and blue, say) such that for all edges (u, v) in the graph, u and v have different colors. For this problem, you should give an algorithm to solve the problem (pseudocode or a description) and prove that it is correct and runs in polynomial time.

      Hint: try a greedy algorithm.

    2. This problem has been removed from this homework since most people did have something somewhat reasonable turned in for it already from homework 2.

      Exercise 2.22 from the Goldreich text - showing that 2SAT is in P. You should give an algorithm (pseudocode or a description) and prove that it is correct and runs in polynomial time.

    1. (10 Points) Prove that bounded-halting is NP-complete. This is described at the end of section 2.3.2 in the textbook.

    2. (10 Points) Prove the "unbounded" halting problem (as defined when we discussed undecidable problems) is NP-hard.

    3. (5 Points) Is the "unbounded" halting problem NP-complete? Why?

  2. (10 Points) Is the following proof correct? If not, what is the error in the proof?

    Claim: All people have the same IQ.

    Proof: The proof is by induction. Let P(n) be the assertion that all sets of n people have the same IQ. We want to show that P(n) is true for all n ≥ 1.

    Base Case: For n=1, we have a set of 1 person, so clearly everyone in the set has the same IQ.

    Inductive Step: Suppose that for all sets of k people, all people in the set have the same IQ. Consider a set S of size k+1. Consider two different subsets S1 and S2 of S, with S1 and S2 of size k, so that S=S1 ∪ S2. By inductive assumption, all people within set S1 have the same IQ; and all people within set S2 have the same IQ. Notice that S1 and S2 must have non-empty intersection, call this person in the intersection x. x has some IQ, and this must be the same as all people in both sets S1 and S2. We conclude that all people in set S have the same IQ. By induction, we have shown that all people have the same IQ.