CSE 555 HW 5 SAMPLE SOLUTION Question 1. Show That If L Is

CSE 555 HW 5 SAMPLE SOLUTION Question 1. Show That If L Is

CSE 555 HW 5 SAMPLE SOLUTION Question 1. Show that if L is PSPACE-complete, then L is NP-hard. Show that the converse is not true. If L is PSPACE-complete, then for all A 2 PSPACE, A ≤P L. We know SAT 2 PSPACE from Sipser Example 8.3, so SAT ≤P L. A language is NP-hard if every language in NP is polynomial time reducible to it. SAT is NP-complete and SAT ≤P L, so for all B 2 NP, B ≤P SAT ≤P L, so L is NP-hard. To see that the converse is not true, first show that ANTM is NP-hard, as follows. (Our def- inition of ATM is for deterministic TMs. ANTM is the version of ATM for non-deterministic TMs.) Take an arbitrary A 2 NP and let M be the NTM that decides A in non- deterministic polynomial time. There is a polynomial time computable function f :Σ∗ 7! ∗ Σ so that w 2 A () f(w) 2 ANTM ; specifically, f(w) = hM; wi. Construct F , the TM that computes function f, from M as follows: F = \On input w: (1) Write hM; wi to the tape and halt." Writing hMi to the tape takes constant time regardless of the length of w, so the function is computed in O(jwj) time. Then, for all A 2 NP, A ≤P ANTM so ANTM is NP-hard. But ANTM is undecidable. Because every deterministic TM is also an NTM, if ANTM were decidable, a decider for ANTM could be to decide ATM . Therefore, ANTM cannot be in PSPACE, so ANTM is not PSPACE-complete. Question 2. ∗ Show that ALLNFA = fhMi : L(M)Σ for the NFA M whose input alphabet is Σg is in PSPACE. Sipser provides an algorithm for ALLNFA that runs in nondeterministic space O(n), so ALLNFA 2 NPSPACE, and NPSPACE = PSPACE by Savitch's theorem. Because ALLNFA is in coPSPACE, and the deterministic space complexity classes are closed under complement, ALLNFA is in PSPACE. Question 3. A string w = w1:::wn with wi 2 Σ for 1 ≤ i ≤ n yields 1 2 CSE 555 HW 5 SAMPLE SOLUTION (a) the string w = w1:::; wi−1; a; wi+1:::wn with a 2 Σ by a substitution, and (b) the string w = w1:::; wi−1; wi+1:::wn by a deletion. ∗ (You can substitute or delete any single symbol wi.) Let L ⊆ Σ be an arbitrary language and suppose that w; w0 2 Σ∗. We say that there is a deletion-substitution chain in L from 0 w to w if there is a finite integer ` so that there exist strings (z0; :::; z`) with each zi 2 L for which z0 = w; z` = w0, and zi is obtained from zi−1 by a deletion or substitution for each 1 ≤ i ≤ `. 0 Show that, when L is regular, DSCL = fhw; w i : 9 a deletion-substitution chain from w to w0 2 Lg is in PSPACE. Since PSPACE = NPSPACE, showing that DSCL 2 NPSPACE is equivalent to showing that DSCL 2 PSPACE. We devise an NTM, NL, that decides DSCL. Because L is regular, there is a DFA D such that L(D) = L; NL can have D hardcoded into it in order to decide when w 2 L. Simulating D on w can be performed using a constant amount of space, because we only need to keep track of the state D is currently in. We need to compute and store ` so we know when our algorithm can terminate (when no chain can exist). Notice that, in a deletion-substitution chain, no jzij can ever be longer than jwj, but it may be required to perform several substitutions before a deletion can be performed. The maximum length of a possible chain is the number of all possible zi such that jzij ≤ jwj. Then, jwj X ` = jΣji = jΣjjwj+1 − 1 i=0 The magnitude of ` is exponential in the size of w, but if we store ` in base Σ, then the storage required is jwj + 1. We also store i in base Σ, so the space complexity for this is also O(jwj). Then NL follows: 0 NL = \On input hw; w i: (1) If jwj < jw0j, reject (there cannot be a substitution-deletion chain) (2) Simulate D on w and reject if D does. (3) Simulate D on w0 and reject if D does. (4) Compute and store ` on the tape (as explained above). (5) For 1 ≤ i ≤ `: (a) Nondeterministically select one symbol in w and nondeterministically delete it or substitute another symbol from Σ. (b) If w = w0, accept. (c) Simulate D on w and reject if D does. CSE 555 HW 5 SAMPLE SOLUTION 3 (6) No chain with length 1 ≤ i ≤ ` has been found so reject. " If a chain exists with the specified properties, NL will find it because there is a sequence of nondeterministic choices leading to acceptance. (The space for w is reused for each substitution or deletion, so this requires no additional space.) We only need O(1) space to store the current state of D during simulations, and O(jwj) space to store i and `, so the algorithm has space complexity O(jwj) 2 NPSPACE = PSPACE. Question 4. We say that language L is in coNP if and only if language L is in NP. By direct analogy with the definition of NP-completeness, precisely define coNP-completeness. (Use polynomial- time reducibility.) A tautology is a logical formula that is always true. Show that fh i : is an unquantified boolean formula that is a tautologyg is coNP-complete. A language L is coNP-complete if it satisfies two conditions: (1) L is in coNP. (L is in NP) (2) every language in coNP is polynomial time reducible to L. (The complement of every language in NP is poly reduce to not L) Let T = fh i : is an unquantified boolean formula that is a tautologyg. T 2 coNP () T 2 NP. T is the language of strings that are either not unquantified Boolean formulas or there is some truth assignment to the variables of such that the formula is false. To see that T 2 NP , we provide a polynomial time verifier, V . The certificate, c, is the truth assignment that makes the formula false. Let n be the length of h ; ci and ` be the number of variables in . We use the standard convention of 0 = false, 1 = true. V = \On input h ; ci: (1) If has any quantifiers or is not a Boolean formula, accept. (2) Scan the tape and replace the variables of with the assignment c. If the literal x appears in the formula, replace it with its truth value. If x appears, replace it with the opposite truth value. If c is not a truth assignment to the variables of (if jcj 6= ` or it is improperly formatted), accept. (3) Repeat until there is either a single 0 or 1 on the tape: (a) Evaluate the formula by collapsing binary logical operators ^; _ based on their rules and the truth value to the left and right, respecting precedence dictated by parentheses, and shifting the rest of the formula left after collapsing. (4) If 1 is on the tape, reject. If 0 is on the tape, accept. Step 1 is completed in O(n) steps. Step 2 can be completed by zigzagging across the tape. For each pass, we replace at least 1 variable, or accept, so step 2 takes O(`n) steps. During 4 CSE 555 HW 5 SAMPLE SOLUTION step 3, we are guaranteed to collapse at least one truth value for each iteration, but may have to shift almost n tape symbols left, so this step takes O(`n) steps. Step 4 is completed in constant time, so the verifier runs in time O(`n). To show that T is coNP-complete, we either need to show that every language in coNP is polynomial time reducible to T , or we need to show that another coNP-complete problem is polynomial time reducible to T . For the second approach, we need a first coNP-complete problem. Consider SAT and consider the reduction from A to SAT presented in the proof of the Cook-Levin theorem. Let A be an arbitrary language in NP and let φ be the formula that simulates the NTM for A. We know that w 2 A () φ 2 SAT . We also have that w 62 A () φ 62 SAT , or w 2 A () φ 2 SAT . As A 2 NP () A 2 coNP, we have that every coNP language is polynomial time reducible to SAT . Now we show SAT ≤P T . Notice that if is a tautology, then its negation is always false (it is unsatisfiable). Then, 2 SAT () 2 T . This is already a boolean formula. However, we can carry this further to rewrite the formula to avoid the global negation, if desired. We define a recursive routine, NEGATE, that performs negation of an unquantified Boolean formula to show that the reduction can be performed in polynomial time. NEGATE = \On input : (1) If = a _ b, replace _ with ^ and call NEGATE( a), NEGATE ( b). (2) If = a ^ b, replace ^ with _ and call NEGATE( a), NEGATE ( b). (3) If is a literal, x, replace x with x and return. (4) If is a negated literal, x, replace x with x and return. To see that NEGATE runs in polynomial time, let k be the number of Boolean log ical operators in and n the length of .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    5 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us