Computer Science Theory

Homework Assignment #4

November 14, 2012

Due in class 1:10pm, November 28, 2012

- You may consult with others but your answers must be written in your own words.
- Problems (1)-(5) are each worth 20 points.
- This assignment may be handed in December 3, 2012 for 50% credit.

- Classify each of the following languages as being (i) recursive, (ii) recursively enumerable but not recursive, or (iii) not recursively enumerable. In each case briefly justify your answer.
- {
*D*|*D*is a deterministic finite automaton that accepts at least one string with an equal number of*a*'s and*b*'s } - { (
*M*,*w*) |*M*is a Turing machine that halts on input*w*} - { (
*D*_{1},*D*_{2}) |*D*_{1}and*D*_{2}are deterministic finite automata and L(*D*_{1}) = L(*D*_{2}) } - { (
*M*_{1},*M*_{2}) |*M*_{1}and*M*_{2}are Turing machines and L(*M*_{1}) = L(*M*_{2}) } - Boolean expressions
- Describe an algorithm in high-level pseudocode to evaluate a
boolean expression given a truth assignment
to its variables.
Describe how your algorithm evaluates
the boolean expression
*x*∨ ¬(*y*∧*z*) for the truth assignment T(*x*) = 0, T(*y*) = 0, T(*z*) = 1. (1 is true, 0 is false.) - What is the time complexity of your algorithm?
- Describe an algorithm in high-level pseudocode to determine whether a boolean
expression always evaluates to true on all truth assignments
to its variables (is a tautology).
Illustrate how your algorithm performs on
the boolean expression
*x*∨ ¬(*y*∧*x*). - What is the time complexity of your algorithm?
- The game PEBBLES is played on an
*k × n*chessboard. Initially each square of the chessboard has a black pebble, or a white pebble, or no pebble. You play the game by removing pebbles one at a time. You win the game if you can end up with a board in which each column contains only pebbles of a single color and each row contains at least one pebble. - Show that the set of winnable PEBBLES games is in NP. Hint: Describe a nondeterministic polynomial-time algorithm to determine whether a given PEBBLES board is winnable.
- Given a boolean expression
*E*in 3-CNF with*k*clauses and*n*variables, construct the following*k × n*board: If literal*x*is in clause_{i}*c*, put a black pebble in column_{j}*x*, row_{i}*c*. If literal ¬_{j}*x*is in clause_{i}*c*, put a white pebble in column_{j}*x*, row_{i}*c*. Show that_{j}*E*is satisfiable if and only if this PEBBLES game is winnable. - What can you conclude from showing (a) and (b)?
- Show that NP is equivalent to the class of languages that have polynomial-time verifiers.
- The classes P and NP
- Show that if A is NP-complete and A is in P, then P = NP.
- Show that if A is NP-complete and A is polynomially reducible to a problem B in NP, then B is NP-complete.

aho@cs.columbia.edu