

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The solutions to problem 2 of the cs 172, spring 1999 midterm 1 exam. The problem deals with the poly-time equivalence of decision and optimization problems in nondeterministic finite automata with inputs (ndtms). The concept of poly-time equivalence, provides the solutions for the given problems, and discusses the challenges encountered when dealing with binary representations of input lengths.
Typology: Exams
1 / 2
This page cannot be seen from the preview
Don't miss anything!


a) Define the number of steps taken by a NDTM on input x. b) Define the number of steps taken by a NDTM on inputs of length of n.
a) # NDTMi [x] = case1: min(y belongs to (summation *)) { # DTMi[y,x]} ( this is the deterministic half of the NDTMi)
if there exists y such that DTMi[y,x] accepts (i.e. enters an accepting state)
case2: 1 otherwise
b) # NDTMi(n) = Max{# NDTMi[x]}, |x| = n
Define two (computational) problems p1, p2 to be poly-time equivalent iff it is possible to solve p1 in polynomial time given an algorithm to solve p2 in polynomial time (p1 <= p2), and vice-versa (p2 <= p1).
Are the following two problems poly-time equivalent? If so, prove it. If not, explain why not.
Decision: Instance: NDTMi, x in {0,1}, m in unary ........m (ie 1.....1 = 1 ). Question: Does NDTMi accept x in m steps? ie does there exist a y in {0,1} s.t. DTMi accepts (y,x) in m steps, if any (ie if such y exists); "NONE" if there is no such y.
The running time of the Decision algorithm = running time of the Optimizaton algorithm + O(1).
course, exam #, semester/year (e.g., CS 150, Midterm #2, Fall 1994) CS 172, Solution of Midterm #1, Spring 1999
course, semester/year CS 172 , Spring, 1999exam # Professor M. Blumprofessor (e.g., Professor J. Wawrzynek) 1
If the Dec. algor rejects [NDTMi|(Yo = 0), x,m], then we know that Yo = 1. Else we know that it's ok to let Yo = 0. In general, having determined Y(i-1) = A(i-1),..., Yo = Ao, one can determine Yi by augmenting the NDTMi to NDTMi|oA(i-1)...Ao, which overwrites the guessed Yi Y(i-1) ... Yo with oA(i-1)...Ao. If the NDTMi|oA(i-1)...Ao rejects, then we know that Ai = 1. Else ok to let Ao = 0. The size of the augmented DTMi|Ai...Ao is just |DTMi| + O(m), which is poly in (|NDTMi| + |x|
Explain what problems if any you encounter in doing the above reductions In the case that m is given in binary instead of unary.
course, exam #, semester/year (e.g., CS 150, Midterm #2, Fall 1994) CS 172, Solution of Midterm #1, Spring 1999
Problem #2 2