# CMPSCI 311: Theory of Algorithms

### David Mix Barrington

### Fall, 2003

### Homework Assignment #9

### Due Friday 12 December 2003 in class

#### (or earlier to hand-in box in CMPSCI main office)

There are eight questions from [L] and two that I wrote,
B9.1 and B9.2. The entire text of my questions is given below.
Point values are as
indicated. There are 100 total points plus ten extra credit.

Be sure you are familiar with the academic honesty and
collaboration policy on the homework
assignment page.

**Question 10.3.1, page 353 (10):** Remember that in chess
there are certain situations where a player can claim a draw -- if the
exact same board position has occurred three times in the game, or if
fifty moves by each player have occurred since the last capture or pawn
move. Since the question is "whether White can win", assume that Black
will claim a draw under these rules if she can.
**Question 10.3.3, page 354 (10):** Check the text for the
definition of an Eulerian circuit.
**Question 10.3.6, page 354 (10):**
**Question 10.3.8, page 354 (5):** (Point value
corrected 8 December 2003.)
**Question 10.3.9, page 355 (15):**
**Question 10.3.11(a), page 355 (10):** Do part (a) only.
**Question 11.1.4, page 375 (10):**
**Question 11.1.5, page 375 (10):**
**Question B9.1 (10XC):** The problem ACYCLIC-REACH takes a
directed acyclic graph H and two of its vertices s and t as input and returns
whether there is a path from s to t in H. Give a poly-time reduction from
REACH to ACYCLIC-REACH. That is, given a directed graph G and vertices u and
v in G, say how to construct a directed *acyclic* graph H and vertices
s and t in H so that there is a path from u to v in G if and only if there
is a path from s to t in H. You should *not* solve the problem trivially
by having the reduction decide (by DFS, say) whether the path in G exists.
(This problem came up in the honors section this term.)
**Question B9.2 (15): Let OPT be an optimization problem, where the
input is a string x, there is a poly-time cost function c that assigns a cost
c(x,y) to every pair of strings, and the output for x should be the minimum
cost c(x,y) for any string y (satisfying some polynomial length bound).
**Let DEC be the decision problem that inputs a pair (x,k) and outputs
whether there exists a string y (satisfying the length bound) such that c(x,y)
≤ k. Prove that OPT is computable in polynomial time if and only if DEC
is in P.

**
**Last modified 8 December 2003