This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CS 154 Intro. to Automata and Complexity Theory Handout 26 Autumn 2009 David Dill November 10, 2009 Solution Set 5 Problem 1 (a). One way to see that 4TA-SAT is in NP consists of guessing four different satisfying assign- ments for the variables in the input F , and then checking whether they are indeed satisfying and different, which can be done in polynomial time. Another solution consists of building the following nondeterministic TM. First, compute a satisfying assignment for F (if no one exists, answer NO). Then, compute the boolean formula F 2 : F S , where S is the con- junction of the values in the satisfying assignment for F . Repeat the same procedure three more times. If we succeed, say YES. Otherwise say NO. Since a satisfying assignment for a boolean formula can be computed in polynomial time by a nondeterministic TM, so can the solution of 4TA-SAT. (b). Let X 1 ,...,X n be the variables in F and Y 1 ,Y 2 be two new variables. One possible reduction generates the formula G : F ( Y 1 Y 1 ) ( Y 2 Y 2 ). This can be computed in polynomial time. (c). Let k be the number of different satisfying assignments of F . Each of them can be extended to a different satisfying assignment for G by picking all possible truth values for Y 1 and Y 2 . Therefore G has 4 k different satisfying assignments. In particular, if F is satisfiable (i.e. k 1) then G has at least four satisfying assignments (i.e. 4 k 4). For the other direction, if G has at least four satisfying assignments, then in particular it has one, from which we can extract a satisfying assignment for F (simply by ignoring the values for Y 1 and Y 2 ) and conclude that F is satisfiable. Problem 2 First we show that DS is in NP. We nondeterministically guess a set of nodes S of size k , a candidate to be a dominating set. Now, for each node in the graph we check whether it belongs to S , or else whether some edge connects it to some other node in S . This checking operation takes polynomial time. Now, to show that DS is NP-hard we use the following reduction from 3SAT: Given a formula F ( X 1 ,... ,X n ) in 3CNF, with clauses C 1 ...C m , we build the following graph G . For each variable X j we introduce three nodes, denoted x j , x j and y j , connected to each other. This is called the triangle gadget . For each clause C i we introduce an additional node c i . If the clause C i contains the literal X j then we add an edge from c i to the node x j . If the literal is of the form X j then we connect c i to x j . The total number of nodes in G is 3 n + m , while the total number of edges is 3 n +3 m . The reduction is completed by generating....
View Full Document