COMS W3261
Computer Science Theory
Homework Assignment #4
November 14, 2012
Due in class 1:10pm, November 28, 2012
Instructions
- 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.
Problems
- 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 }
- { (D1, D2) |
D1 and D2 are deterministic finite automata
and L(D1) = L(D2) }
- { (M1, M2) |
M1 and M2 are Turing machines
and L(M1) = L(M2) }
- 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 xi is in clause cj,
put a black pebble in column xi, row cj.
If literal ¬xi is in clause cj,
put a white pebble in column xi, row cj.
Show that 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