Answers to the CSCE 551 Final Exam, April 30, 2008

Similar documents
CSCE 551 Final Exam, April 28, 2016 Answer Key

CSCE 551 Final Exam, Spring 2004 Answer Key

Lecture 20: PSPACE. November 15, 2016 CS 1010 Theory of Computation

Midterm II : Formal Languages, Automata, and Computability

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II , Max 80, Time 2 hr. Name Entry No. Group

CSE 555 HW 5 SAMPLE SOLUTION. Question 1.

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

CS154 Final Examination

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

6.045J/18.400J: Automata, Computability and Complexity Final Exam. There are two sheets of scratch paper at the end of this exam.

Computability and Complexity CISC462, Fall 2018, Space complexity 1

CSE 105 Theory of Computation

6.045 Final Exam Solutions

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

Exam Computability and Complexity

What languages are Turing-decidable? What languages are not Turing-decidable? Is there a language that isn t even Turingrecognizable?

SOLUTION: SOLUTION: SOLUTION:

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Lecture 23: More PSPACE-Complete, Randomized Complexity

Week 3: Reductions and Completeness

V Honors Theory of Computation

Homework Assignment 6 Answers

CS154 Final Examination

CSE 105 THEORY OF COMPUTATION

University of Toronto Scarborough. Aids allowed: None... Duration: 3 hours.

CSE 105 THEORY OF COMPUTATION

CSCC63 Worksheet Turing Machines

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama

CS 154 Introduction to Automata and Complexity Theory

CS 311 Sample Final Examination

Chapter 1 - Time and Space Complexity. deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE

CpSc 421 Final Exam December 6, 2008

CPSC 421: Tutorial #1

DRAFT. Diagonalization. Chapter 4

1 PSPACE-Completeness

Intro to Theory of Computation

1 Showing Recognizability

Name: Student ID: Instructions:

CSE 105 THEORY OF COMPUTATION

More on Regular Languages and Non-Regular Languages

CSE 105 THEORY OF COMPUTATION

Decidability. Linz 6 th, Chapter 12: Limits of Algorithmic Computation, page 309ff

CpSc 421 Final Exam December 15, 2006

CS154, Lecture 10: Rice s Theorem, Oracle Machines

POLYNOMIAL SPACE QSAT. Games. Polynomial space cont d

Lecture 24: Randomized Complexity, Course Summary

Computability and Complexity

Chapter 9. PSPACE: A Class of Problems Beyond NP. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

CS 151 Complexity Theory Spring Solution Set 5

Space Complexity. Huan Long. Shanghai Jiao Tong University

Lecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009

CSE 105 THEORY OF COMPUTATION

Decidability: Church-Turing Thesis

Theory of Computation. Ch.8 Space Complexity. wherein all branches of its computation halt on all

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

9. PSPACE 9. PSPACE. PSPACE complexity class quantified satisfiability planning problem PSPACE-complete

PSPACE COMPLETENESS TBQF. THURSDAY April 17

9. PSPACE. PSPACE complexity class quantified satisfiability planning problem PSPACE-complete

CSCE 551: Chin-Tser Huang. University of South Carolina

1 More finite deterministic automata

NP Complete Problems. COMP 215 Lecture 20

Notes for Lecture Notes 2

Chap. 4,5 Review. Algorithms created in proofs from prior chapters

Review of Complexity Theory

An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

More Properties of Regular Languages

Before we show how languages can be proven not regular, first, how would we show a language is regular?

Theory Bridge Exam Example Questions

CSE 105 Theory of Computation

3130CIT Theory of Computation

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012

Lecture 4 : Quest for Structure in Counting Problems

SAT, NP, NP-Completeness

The Unsolvability of the Halting Problem. Chapter 19

Final exam study sheet for CS3719 Turing machines and decidability.

Lecture 22: PSPACE

NP-Completeness Part II

DM17. Beregnelighed. Jacob Aae Mikkelsen

Functions on languages:

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam

Solutions to Old Final Exams (For Fall 2007)

6.840 Language Membership

MTAT Complexity Theory October 20th-21st, Lecture 7

Umans Complexity Theory Lectures

Announcements. Friday Four Square! Problem Set 8 due right now. Problem Set 9 out, due next Friday at 2:15PM. Did you lose a phone in my office?

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013

NP-Completeness. Sections 28.5, 28.6

Circuits. Lecture 11 Uniform Circuit Complexity

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement:

2 Evidence that Graph Isomorphism is not NP-complete

Computer Sciences Department

Computational Complexity IV: PSPACE

CpSc 421 Homework 9 Solution

Time and space classes

Transcription:

Answers to the CSCE 55 Final Exam, April 3, 28. (5 points) Use the Pumping Lemma to show that the language L = {x {, } the number of s and s in x differ (in either direction) by at most 28} is not regular. Answer: Given p >, let s = p p+28. Clearly, s = 2p + 28 p and s L. If x, y, z are such that xyz = s, xy p, and y >, then we must have y = m for some m >. Letting i =, we remove m zeros to get xy i z = xy z = xz = p m p+28 / L. Thus by the Pumping Lemma, L is not regular. choices of s and i.) (There are many other workable 2. ( points) The following DFA is not minimum: D A B C Using any method you like, find the minimum equivalent DFA. (Draw its transition diagram.) Answer: States A and C are the only pair of indistinguishable states. Combining them, we get the minimum DFA:

D AC B 3. (5 points) Give an m-reduction from A TM to the language B = { R R is a TM that accepts a string w iff w = 28}. Answer: Let f = On input M, w where M is a TM and w is a string: (a) Let R = On input x: i. If x 28 then reject ii. Simulate M on w (and do what M does) (b) Output R Then f m-reduces A TM to B. 4. (25 points total) Fix some enumerator E. Let A be the language of all strings w such that E prints w at least once, and w is at least as long as any string that E prints before it first prints w. Show: (a) (5 points) A is decidable. (b) ( points) If E enumerates an infinite language, then A is infinite. [This proves that every infinite Turing recognizable set has an infinite decidable subset.] 2

Answer: A L. Let L be the language enumerated by E. It follows from the definition that (a) There are two cases: L is finite: Then A is also finite. Since every finite language is decidable (regular even), then A is decidable. L is infinite: Let D implement the following algorithm: On input w: i. Run E until it either prints w or it prints some string longer than w, whichever comes first ii. If E prints w, then accept iii. If E prints a string longer than w, then reject Since E enumerates an infinite language (by assumption), it must print strings that are arbitrarily long. Thus on any input w, Step (i) will eventually complete, and so D is a decider. It is also straightforward to see that w A iff D accepts w. Thus D decides A, and so A is decidable. [Note that in general we cannot compute, given E, which case holds finite or infinite. This question is undecidable, but it does not affect the decidability of A.] (b) Assume that L is infinite. For any length n, there are only finitely many strings of length n, and so E must eventually print a string longer than n. The first such string printed by E is in A (clearly). So A contains a string longer than n. Since n is arbitrary, A must contain arbitrarily long strings, so A must be infinite. 5. ( points) Prove that if TQBF NP, then NP = PSPACE. Answer: We already know that NP PSPACE (this was proven in class), so it suffices to show that PSPACE NP. Let A be any language in PSPACE. We know that TQBF is PSPACE-complete, so in particular, TQBF is PSPACE-hard, which means A p m TQBF because A PSPACE. Now suppose that TQBF NP. We proved in class that for any languages C and D, if C p m D and D NP, then C NP. In this case, we have A p m TQBF and TQBF NP (by assumption), and thus A NP. Since A was any PSPACE language, this shows that PSPACE NP. 6. (5 points) Let L = { M, w M is a DFA that accepts w n for all n }. Show that L P by giving a polynomial-time decision procedure for L. (A high-level algorithm will suffice.) 3

Answer: Let N = On input M, w where M is a DFA and w is a string: (a) Let n be the number of states of M (b) For i := to n do i. Run M on input w i ii. If M rejects w i, then reject (c) Accept Why this works: Clearly, N runs in polynomial time (quartic time, actually, although this is not optimal). It is also clear that if M, w L then N accepts M, w. But the converse is also true: Suppose M = (Q, Σ, δ, q, F ), where Q = n. Let q, q, q 2,... be the sequence of states that M enters after reading inputs w, w, w 2,..., respectively. That is, let q i = δ(q, w i ) for all i, and note that q i+ = δ(q i, w). By its construction, N accepts M, w if and only if {q, q,..., q n } F. Since M has only n states, by the Pigeon Hole Principle, there must be some i < j n such that q i = q j (this is similar to the proof of the Pumping Lemma). But then, q i+ = q j+, q i+2 = q j+2, etc. That is, we have a loop, which implies that all states in the sequence are in the set {q, q,..., q n }. Thus N only needs to test whether these states are all in F. 7. (2 points total) Let ϕ be the quantified Boolean formula ( x )( x 2 )( x 3 )[ (x x 3 ) (x 2 x 3 ) (x x 2 ) ]. (a) (5 points) Give the instance G, s of GG that ϕ maps to via the p-m-reduction of TQBF to GG described either in the book or in class. (Draw the digraph G and label the start vertex s.) Answer: 4

s x x x 2 x 2 x 3 x 3 (b) (5 points) Is ϕ true? Answer: No, ϕ is false. For any truth value Alice picks for x, Bob picks the same truth value for x 2, which guarantees that at least one clause is violated, regardless of Alice s choice of x 3. This shows that Bob has a winning strategy, not Alice. 5