CSCE 551 Final Exam, April 28, 2016 Answer Key

Size: px
Start display at page:

Download "CSCE 551 Final Exam, April 28, 2016 Answer Key"

Transcription

1 CSCE 551 Final Exam, April 28, 2016 Answer Key 1. (15 points) Fix any alphabet Σ containing the symbol a. For any language L Σ, define the language a\l := {w Σ wa L}. Show that if L is regular, then a\l is also regular. Answer: Assume L is regular. Given a DFA D = (Q, Σ, δ, q 0, F ) recognizing L, we define a DFA D as follows: D := (Q, Σ, δ, q 0, F ), where F := {q Q δ(q, a) F }. (Thus D differs from D only in the set of accepting states.) For any w Σ, we have w a\l wa L ˆδ(q 0, wa) F δ(ˆδ(q 0, w), a) F ˆδ(q 0, w) F D accepts w. Thus L(D ) = a\l, and so a\l is regular. 2. (10 points) Fix any language Σ containing 0. Let E be an enumerator (with output alphabet Σ) satisfying two properties when run: For infinitely many integers n 0, E prints 0 n at some point. E never prints a string with fewer 0 s than a previously printed string. (That is, for any strings x, y Σ, if E prints x first and y after, then y has at least as many 0 s as x (it could be the same number or more, but no fewer).) Show that the language enumerated by E is decidable. Answer: Here is a decision procedure M for L(E): M := On input w Σ : (a) Let n be the number of 0 s occurring in w. (b) Run E until either i. E prints w or ii. E prints 0 m for some m > n, whichever comes first. (c) If E prints w first, then accept; else reject. To see that M decides L(E), first suppose that w L(E). Then E eventually prints w. E cannot print any string with more 0 s than w before it prints w, so it cannot print 0 m for any m > n beforehand. Thus M will accept w. If w / L(E), then E never prints w, but it will eventually print 0 m for some m > n, so in this case M (halts and) rejects w. 1

2 3. (10 points) Let A be any Turing recognizable language such that, for all x Σ there exists y Σ such that x, y A (but there could be more than one such y). Show that there is a computable function f : Σ Σ such that x, f(x) A for all x Σ. [Hint: Use time slicing, a.k.a. dovetailing.] Answer: Here is a proof using an enumerator. Since A is Turing recognizable, there is some enumerator E enumerating A. Consider the following algorithm: M := On input x Σ : (a) Run E. (b) The first time E prints a string of the form x, y for some y Σ, then halt and output y. For each input x, we know that E must eventually print some string of the form x, y. Thus M always halts, and so it computes a function f : Σ Σ. By construction, x, f(x) A, because M only outputs a y such that x, y is printed by E (and thus is in A). (M just outputs the first such y it finds by running E). 4. (15 points) Let L := { M M is a TM that accepts exactly 2016 many strings}. Show that L is undecidable. Argue directly, without appealing to Rice s theorem. Answer: Suppose that L is decidable. Then here is a decision procedure for A TM : D := On input M, w, where M is a TM and w a string: (a) Construct the following TM R, fixing some symbol a in its input alphabet: R := On input x: i. Run M on input w. ii. If M ever accepts, then A. If x = a i for some integer i such that 0 i < 2016, then accept; B. Else, reject. iii. (If M does not accept w, then loop.) (b) If R L then accept; else reject. D is clearly a decider (it uses implicitly an assumed decision procedure for L). For any M and w: If M, w A TM, then M accepts w, and thus R accepts exactly 2016 many strings (namely, ɛ, a, aa, aaa,..., a 2015 ). It follows that R L, and so D accepts M, w. If M, w / A TM, then R loops on all its inputs, not accepting any string. That puts R / L, and hence D rejects M, w. 2

3 This shows that D is a decision procedure for A TM. Contradiction. Therefore L is undecidable. 5. (15 points) Let FIN NFA := { N N is an NFA and L(N) is finite}. Show that FIN NFA P by giving a polynomial-time decision procedure for FIN NFA. Give a high-level algorithm. Answer: The key idea is that an n-state NFA accepts infinitely many strings if and only if it accepts some string of length n (which is then pumpable to longer accepted strings). So here is a polynomial-time decision procedure for FIN NFA, and it uses something similar to the subset construction: D := On input N, where N is an NFA: (a) Let N = (Q, Σ, δ, q 0, F ), and set n := Q, the number of states of N. (b) Set S 0 := ɛ-closure({q 0 }). (c) For i := 1 to n compute S i := ɛ-closure q S i 1 a Σ {ɛ} δ(q, a) // S i is the set of states reachable by reading any input string of length i. (d) If S n contains an accepting state, or there is some accepting state reachable from a state in S n, then reject; else accept. D runs in polynomial time (particularly, Step (d) can be done via running breadth-first search from each state in S n ). And D accepts N if and only if N does not accept any strings of length n, or equivalently, L(N) is finite. 6. (10 points) Recall that for any positive integer k, we define k-colorability to be the language of all strings G such that G is an undirected graph and there exists a way to color the vertices of G with no more than k colors so that no two adjacent vertices are colored the same. It is clear (and you may assume) that k-colorability is in NP for every k, and we also know that 3-COLORABILITY is NP-hard. For any fixed k 4, show that k-colorability is NP-hard by finding a polynomial reduction from 3-COLORA- BILITY to k-colorability. Answer: Fix some k 4. Here is how we can p-reduce 3-COLORABILITY to k-colorability: Given a graph G, we output in p-time a graph G such that G is k-colorable if and only if G is 3-colorable: 3

4 (a) Let y 1, y 2,..., y k 3 be k 3 nodes not in G. (b) Add y 1, y 2,..., y k 3 to the vertex set of G. (c) Draw edges connecting each y i to all the vertices of G and to all the other y j for j i. (d) Let G be the resulting graph. Output G. The following proof of correctness is purely optional. Getting the reduction right counts for full credit. This construction can clearly be done in polynomial time. If G has a 3-coloring, then it can be extended to a k-coloring of G by assigning to each y i a unique color not used in G. Conversely, any k-coloring of G must assign distinct colors to y 1,..., y k 3, since they are all pairwise adjacent. Since all the y i are adjacent to all the vertices in G, none of the k 3 colors used for y 1,..., y k 3 can be used inside G. There are only 3 colors left, and so G is 3-colorable. 7. (15 points total) Let ϕ be the quantified Boolean formula ( x 1 )( x 2 )( x 3 )[ (x 1 x 2 x 3 ) (x 2 x 3 ) (x 1 x 3 ) (x 1 x 2 x 3 ) ]. (a) (10 points) Give the instance G, s of GG that ϕ maps to via the polynomial reduction of TQBF to GG described either in the book or in class. Draw the digraph G and label the start vertex s. Note that ϕ having an odd number of quantifiers may only require a slight modification of the construction. (b) (5 points) Is ϕ true? Explain. Answer: (a) Numbering the clauses C 1, C 2, C 3, C 4 from left to right, here is the instance of GG: 4

5 s C 1 x 1 x 1 C 2 x 2 x 2 C 3 C 4 x 3 x 3 The bottom two nodes represent consecutive dummy moves and may be bypassed completely. (b) ϕ is false. If x 1 = 1, then the formula reduces to (x 2 x 3 ) (x 2 x 3 ) (x 2 x 3 ), whence setting setting x 2 := 0 yields a contradiction. If x 1 = 0, then the formula reduces to (x 2 x 3 ) x 3, which again yields a contradiction when x 2 := (10 points) Prove that if TQBF P, then P = PSPACE. (We already know that P PSPACE unconditionally, so it suffices to show that PSPACE P.) [Note: There is nothing special about TQBF here, except that it is PSPACE-complete; any other PSPACE-complete language would work just as well.] Answer: Suppose TQBF P, and let A be any language in PSPACE. It suffices to show that A P. Since TQBF is PSPACE-hard, we have A p TQBF. It was proved in class and in the book that P is closed under p, which means that, since TQBF P by assumption, we have A P as well. 5

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

Answers to the CSCE 551 Final Exam, April 30, 2008 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.

More information

CSCE 551 Final Exam, Spring 2004 Answer Key

CSCE 551 Final Exam, Spring 2004 Answer Key CSCE 551 Final Exam, Spring 2004 Answer Key 1. (10 points) Using any method you like (including intuition), give the unique minimal DFA equivalent to the following NFA: 0 1 2 0 5 1 3 4 If your answer is

More information

Midterm II : Formal Languages, Automata, and Computability

Midterm II : Formal Languages, Automata, and Computability Midterm II 15-453: Formal Languages, Automata, and Computability Lenore Blum, Asa Frank, Aashish Jindia, and Andrew Smith April 8, 2014 Instructions: 1. Once the exam begins, write your name on each sheet.

More information

6.045 Final Exam Solutions

6.045 Final Exam Solutions 6.045J/18.400J: Automata, Computability and Complexity Prof. Nancy Lynch, Nati Srebro 6.045 Final Exam Solutions May 18, 2004 Susan Hohenberger Name: Please write your name on each page. This exam is open

More information

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

COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II , Max 80, Time 2 hr. Name Entry No. Group COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II 2015-16, Max 80, Time 2 hr Name Entry No. Group Note (i) Write your answers neatly and precisely in the space provided with

More information

SOLUTION: SOLUTION: SOLUTION:

SOLUTION: SOLUTION: SOLUTION: Convert R and S into nondeterministic finite automata N1 and N2. Given a string s, if we know the states N1 and N2 may reach when s[1...i] has been read, we are able to derive the states N1 and N2 may

More information

Lecture 1: Finite State Automaton

Lecture 1: Finite State Automaton Lecture 1: Finite State Automaton Instructor: Ketan Mulmuley Scriber: Yuan Li January 6, 2015 1 Deterministic Finite Automaton Informally, a deterministic finite automaton (DFA) has finite number of s-

More information

Notes for Lecture Notes 2

Notes for Lecture Notes 2 Stanford University CS254: Computational Complexity Notes 2 Luca Trevisan January 11, 2012 Notes for Lecture Notes 2 In this lecture we define NP, we state the P versus NP problem, we prove that its formulation

More information

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

Chapter 1 - Time and Space Complexity. deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE Chapter 1 - Time and Space Complexity deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE 1 / 41 Deterministic Turing machines Definition 1.1 A (deterministic

More information

V Honors Theory of Computation

V Honors Theory of Computation V22.0453-001 Honors Theory of Computation Problem Set 3 Solutions Problem 1 Solution: The class of languages recognized by these machines is the exactly the class of regular languages, thus this TM variant

More information

1 Computational Problems

1 Computational Problems Stanford University CS254: Computational Complexity Handout 2 Luca Trevisan March 31, 2010 Last revised 4/29/2010 In this lecture we define NP, we state the P versus NP problem, we prove that its formulation

More information

1 Showing Recognizability

1 Showing Recognizability CSCC63 Worksheet Recognizability and Decidability 1 1 Showing Recognizability 1.1 An Example - take 1 Let Σ be an alphabet. L = { M M is a T M and L(M) }, i.e., that M accepts some string from Σ. Prove

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION FORMAL LANGUAGES, AUTOMATA AND COMPUTATION DECIDABILITY ( LECTURE 15) SLIDES FOR 15-453 SPRING 2011 1 / 34 TURING MACHINES-SYNOPSIS The most general model of computation Computations of a TM are described

More information

CpSc 421 Final Exam December 6, 2008

CpSc 421 Final Exam December 6, 2008 CpSc 421 Final Exam December 6, 2008 Do any five of problems 1-10. If you attempt more than five of problems 1-10, please indicate which ones you want graded otherwise, I ll make an arbitrary choice. Graded

More information

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class CSE 105 THEORY OF COMPUTATION Spring 2018 review class Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with confidence. Identify areas to focus

More information

Exam Computability and Complexity

Exam Computability and Complexity Total number of points:... Number of extra sheets of paper:... Exam Computability and Complexity by Jiri Srba, January 2009 Student s full name CPR number Study number Before you start, fill in the three

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2018 http://cseweb.ucsd.edu/classes/sp18/cse105-ab/ Today's learning goals Sipser Ch 5.1, 5.3 Define and explain core examples of computational problems, including

More information

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

What languages are Turing-decidable? What languages are not Turing-decidable? Is there a language that isn t even Turingrecognizable? } We ll now take a look at Turing Machines at a high level and consider what types of problems can be solved algorithmically and what types can t: What languages are Turing-decidable? What languages are

More information

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

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama Print family (or last) name: Print given (or first) name: I have read and understand

More information

CpSc 421 Homework 9 Solution

CpSc 421 Homework 9 Solution CpSc 421 Homework 9 Solution Attempt any three of the six problems below. The homework is graded on a scale of 100 points, even though you can attempt fewer or more points than that. Your recorded grade

More information

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018 CS 301 Lecture 18 Decidable languages Stephen Checkoway April 2, 2018 1 / 26 Decidable language Recall, a language A is decidable if there is some TM M that 1 recognizes A (i.e., L(M) = A), and 2 halts

More information

CSCC63 Worksheet Turing Machines

CSCC63 Worksheet Turing Machines 1 An Example CSCC63 Worksheet Turing Machines Goal. Design a turing machine, M that accepts only strings of the form {w#w w {0, 1} }. Idea. Describe in words how the machine would work. Read first symbol

More information

Decidability (What, stuff is unsolvable?)

Decidability (What, stuff is unsolvable?) University of Georgia Fall 2014 Outline Decidability Decidable Problems for Regular Languages Decidable Problems for Context Free Languages The Halting Problem Countable and Uncountable Sets Diagonalization

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Ch 4.2 Trace high-level descriptions of algorithms for computational problems. Use

More information

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

CSCE 551: Chin-Tser Huang. University of South Carolina CSCE 551: Theory of Computation Chin-Tser Huang huangct@cse.sc.edu University of South Carolina Church-Turing Thesis The definition of the algorithm came in the 1936 papers of Alonzo Church h and Alan

More information

TURING MAHINES

TURING MAHINES 15-453 TURING MAHINES TURING MACHINE FINITE STATE q 10 CONTROL AI N P U T INFINITE TAPE read write move 0 0, R, R q accept, R q reject 0 0, R 0 0, R, L read write move 0 0, R, R q accept, R 0 0, R 0 0,

More information

Final Exam Version A December 16, 2014 Name: NetID: Section: # Total Score

Final Exam Version A December 16, 2014 Name: NetID: Section: # Total Score CS 374 : Algorithms and Models of Computation, Fall 2014 Final Exam Version A December 16, 2014 Name: NetID: Section: 1 2 3 # 1 2 3 4 5 6 Total Score Max 20 10 10 10 10 10 70 Grader Don t panic! Please

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2017 http://cseweb.ucsd.edu/classes/sp17/cse105-ab/ Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with

More information

CPSC 421: Tutorial #1

CPSC 421: Tutorial #1 CPSC 421: Tutorial #1 October 14, 2016 Set Theory. 1. Let A be an arbitrary set, and let B = {x A : x / x}. That is, B contains all sets in A that do not contain themselves: For all y, ( ) y B if and only

More information

Final Exam (Version B) December 16, 2014 Name: NetID: Section: 1 2 3

Final Exam (Version B) December 16, 2014 Name: NetID: Section: 1 2 3 CS 374 : Algorithms and Models of Computation, Fall 2014 Final Exam (Version B) December 16, 2014 Name: NetID: Section: 1 2 3 # 1 2 3 4 5 6 Total Score Max 20 10 10 10 10 10 70 Grader Don t panic! Please

More information

Show that the following problems are NP-complete

Show that the following problems are NP-complete Show that the following problems are NP-complete April 7, 2018 Below is a list of 30 exercises in which you are asked to prove that some problem is NP-complete. The goal is to better understand the theory

More information

Lecture 12: Mapping Reductions

Lecture 12: Mapping Reductions Lecture 12: Mapping Reductions October 18, 2016 CS 1010 Theory of Computation Topics Covered 1. The Language EQ T M 2. Mapping Reducibility 3. The Post Correspondence Problem 1 The Language EQ T M The

More information

CS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)

CS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG) CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG) Objectives Recall that decidable languages are languages that can be decided by TM (that means,

More information

1 More finite deterministic automata

1 More finite deterministic automata CS 125 Section #6 Finite automata October 18, 2016 1 More finite deterministic automata Exercise. Consider the following game with two players: Repeatedly flip a coin. On heads, player 1 gets a point.

More information

CSCI3390-Second Test with Solutions

CSCI3390-Second Test with Solutions CSCI3390-Second Test with Solutions April 26, 2016 Each of the 15 parts of the problems below is worth 10 points, except for the more involved 4(d), which is worth 20. A perfect score is 100: if your score

More information

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

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement: Mapping Reducibility 2017/11/16 Chapter 5.3 in Sipser Ø Announcement: q Slides for this lecture are here: http://www.public.asu.edu/~yzhan442/teaching/cse355/lectures/mapping.pdf 1 Last time Reducibility

More information

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET Regular Languages and FA A language is a set of strings over a finite alphabet Σ. All languages are finite or countably infinite. The set of all languages

More information

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

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages COMP/MATH 300 Topics for Spring 2017 June 5, 2017 Review and Regular Languages Exam I I. Introductory and review information from Chapter 0 II. Problems and Languages A. Computable problems can be expressed

More information

Finite Automata. Dr. Neil T. Dantam. Fall CSCI-561, Colorado School of Mines. Dantam (Mines CSCI-561) Finite Automata Fall / 35

Finite Automata. Dr. Neil T. Dantam. Fall CSCI-561, Colorado School of Mines. Dantam (Mines CSCI-561) Finite Automata Fall / 35 Finite Automata Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2017 Dantam (Mines CSCI-561) Finite Automata Fall 2017 1 / 35 Outline Dantam (Mines CSCI-561) Finite Automata Fall 2017 2 / 35

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 3.3, 4.1 State and use the Church-Turing thesis. Give examples of decidable problems.

More information

Non-emptiness Testing for TMs

Non-emptiness Testing for TMs 180 5. Reducibility The proof of unsolvability of the halting problem is an example of a reduction: a way of converting problem A to problem B in such a way that a solution to problem B can be used to

More information

CSE 555 Homework Three Sample Solutions

CSE 555 Homework Three Sample Solutions CSE 555 Homework Three Sample Solutions Question 1 Let Σ be a fixed alphabet. A PDA M with n states and stack alphabet of size σ may recognize the empty language; if its language is non-empty then denote

More information

CSE 105 Theory of Computation

CSE 105 Theory of Computation CSE 105 Theory of Computation http://www.jflap.org/jflaptmp/ Professor Jeanne Ferrante 1 Undecidability Today s Agenda Review and More Problems A Non-TR Language Reminders and announcements: HW 7 (Last!!)

More information

CSE 555 HW 5 SAMPLE SOLUTION. Question 1.

CSE 555 HW 5 SAMPLE SOLUTION. Question 1. 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 PSPACE, A P L. We know SAT PSPACE

More information

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

University of Toronto Scarborough. Aids allowed: None... Duration: 3 hours. University of Toronto Scarborough CSC C63 Final Examination 20 August 2015 NAME: STUDENT NUMBER: Do not begin until you are told to do so. In the meantime, put your name and student number on this cover

More information

Chapter 6: NFA Applications

Chapter 6: NFA Applications Chapter 6: NFA Applications Implementing NFAs The problem with implementing NFAs is that, being nondeterministic, they define a more complex computational procedure for testing language membership. To

More information

Theory Bridge Exam Example Questions

Theory Bridge Exam Example Questions Theory Bridge Exam Example Questions Annotated version with some (sometimes rather sketchy) answers and notes. This is a collection of sample theory bridge exam questions. This is just to get some idea

More information

Theory of Computation

Theory of Computation Theory of Computation Lecture #6 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 39 Lecture 6: Overview Prove the equivalence of enumerators and TMs. Dovetailing

More information

Computational Models Lecture 8 1

Computational Models Lecture 8 1 Computational Models Lecture 8 1 Handout Mode Nachum Dershowitz & Yishay Mansour. Tel Aviv University. May 17 22, 2017 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

Computational Models Lecture 8 1

Computational Models Lecture 8 1 Computational Models Lecture 8 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. May 11/13, 2015 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

CpSc 421 Final Exam December 15, 2006

CpSc 421 Final Exam December 15, 2006 CpSc 421 Final Exam December 15, 2006 Do problem zero and six of problems 1 through 9. If you write down solutions for more that six problems, clearly indicate those that you want graded. Note that problems

More information

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

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama Print family (or last) name: Print given (or first) name: I have read and understand

More information

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

6.045J/18.400J: Automata, Computability and Complexity Final Exam. There are two sheets of scratch paper at the end of this exam. 6.045J/18.400J: Automata, Computability and Complexity May 20, 2005 6.045 Final Exam Prof. Nancy Lynch Name: Please write your name on each page. This exam is open book, open notes. There are two sheets

More information

CS/ECE 374 Final Exam Study Problems Fall 2016

CS/ECE 374 Final Exam Study Problems Fall 2016 True or False? (from previous final exams) 1. For each of the following questions, indicate every correct answer by marking the box, and indicate every incorrect answer by marking the box. Assume P NP.

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY THURSDAY APRIL 3 REVIEW for Midterm TUESDAY April 8 Definition: A Turing Machine is a 7-tuple T = (Q, Σ, Γ, δ, q, q accept, q reject ), where: Q is a

More information

Computational Models Lecture 8 1

Computational Models Lecture 8 1 Computational Models Lecture 8 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. April 18/ May 2, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

CS 154 Introduction to Automata and Complexity Theory

CS 154 Introduction to Automata and Complexity Theory CS 154 Introduction to Automata and Complexity Theory cs154.stanford.edu 1 INSTRUCTORS & TAs Ryan Williams Cody Murray Lera Nikolaenko Sunny Rajan 2 Textbook 3 Homework / Problem Sets Homework will be

More information

Further discussion of Turing machines

Further discussion of Turing machines Further discussion of Turing machines In this lecture we will discuss various aspects of decidable and Turing-recognizable languages that were not mentioned in previous lectures. In particular, we will

More information

Extended transition function of a DFA

Extended transition function of a DFA Extended transition function of a DFA The next two pages describe the extended transition function of a DFA in a more detailed way than Handout 3.. p./43 Formal approach to accepted strings We define the

More information

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2. March 30, Please write your name in the upper corner of each page.

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2. March 30, Please write your name in the upper corner of each page. 6.045J/18.400J: Automata, Computability and Complexity March 30, 2005 Quiz 2 Prof. Nancy Lynch Please write your name in the upper corner of each page. Problem Score 1 2 3 4 5 6 Total Q2-1 Problem 1: True

More information

Solutions to Old Final Exams (For Fall 2007)

Solutions to Old Final Exams (For Fall 2007) Solutions to Old Final Exams (For Fall 2007) CS 381 (Fall 2002, Fall 2004, Fall 2005, Fall 2006) Yogi Sharma Disclaimer: I, Yogi Sharma, do not claim these solution to be complete, or even to be absolutely

More information

Reductions in Computability Theory

Reductions in Computability Theory Reductions in Computability Theory Prakash Panangaden 9 th November 2015 The concept of reduction is central to computability and complexity theory. The phrase P reduces to Q is often used in a confusing

More information

Lecture Notes: The Halting Problem; Reductions

Lecture Notes: The Halting Problem; Reductions Lecture Notes: The Halting Problem; Reductions COMS W3261 Columbia University 20 Mar 2012 1 Review Key point. Turing machines can be encoded as strings, and other Turing machines can read those strings

More information

CS154, Lecture 13: P vs NP

CS154, Lecture 13: P vs NP CS154, Lecture 13: P vs NP The EXTENDED Church-Turing Thesis Everyone s Intuitive Notion of Efficient Algorithms Polynomial-Time Turing Machines More generally: TM can simulate every reasonable model of

More information

Decidable and undecidable languages

Decidable and undecidable languages The Chinese University of Hong Kong Fall 2011 CSCI 3130: Formal languages and automata theory Decidable and undecidable languages Andrej Bogdanov http://www.cse.cuhk.edu.hk/~andrejb/csc3130 Problems about

More information

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops.

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops. and their languages } Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops. } Some languages are Turing-recognizable, but not

More information

CSE200: Computability and complexity Space Complexity

CSE200: Computability and complexity Space Complexity CSE200: Computability and complexity Space Complexity Shachar Lovett January 29, 2018 1 Space complexity We would like to discuss languages that may be determined in sub-linear space. Lets first recall

More information

Theory of Computation Space Complexity. (NTU EE) Space Complexity Fall / 1

Theory of Computation Space Complexity. (NTU EE) Space Complexity Fall / 1 Theory of Computation Space Complexity (NTU EE) Space Complexity Fall 2016 1 / 1 Space Complexity Definition 1 Let M be a TM that halts on all inputs. The space complexity of M is f : N N where f (n) is

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Lecture 5 Reductions Undecidable problems from language theory Linear bounded automata given by Jiri Srba Lecture 5 Computability and Complexity 1/14 Reduction Informal Definition

More information

CSCI3390-Lecture 6: An Undecidable Problem

CSCI3390-Lecture 6: An Undecidable Problem CSCI3390-Lecture 6: An Undecidable Problem September 21, 2018 1 Summary The language L T M recognized by the universal Turing machine is not decidable. Thus there is no algorithm that determines, yes or

More information

Turing Machine Recap

Turing Machine Recap Turing Machine Recap DFA with (infinite) tape. One move: read, write, move, change state. High-level Points Church-Turing thesis: TMs are the most general computing devices. So far no counter example Every

More information

CS 311 Sample Final Examination

CS 311 Sample Final Examination Name: CS 311 Sample Final Examination Time: One hour and fifty minutes This is the (corrected) exam from Fall 2009. The real exam will not use the same questions! 8 December 2009 Instructions Attempt all

More information

CS154, Lecture 13: P vs NP

CS154, Lecture 13: P vs NP CS154, Lecture 13: P vs NP The EXTENDED Church-Turing Thesis Everyone s Intuitive Notion of Efficient Algorithms Polynomial-Time Turing Machines More generally: TM can simulate every reasonable model of

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Decidability, Undecidability and Reducibility; Codes, Algorithms and Languages CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario,

More information

4.2 The Halting Problem

4.2 The Halting Problem 172 4.2 The Halting Problem The technique of diagonalization was discovered in 1873 by Georg Cantor who was concerned with the problem of measuring the sizes of infinite sets For finite sets we can simply

More information

Computation Histories

Computation Histories 208 Computation Histories The computation history for a Turing machine on an input is simply the sequence of configurations that the machine goes through as it processes the input. An accepting computation

More information

CS 154 Formal Languages and Computability Assignment #2 Solutions

CS 154 Formal Languages and Computability Assignment #2 Solutions CS 154 Formal Languages and Computability Assignment #2 Solutions Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak www.cs.sjsu.edu/~mak Assignment #2: Question 1

More information

CS 301. Lecture 17 Church Turing thesis. Stephen Checkoway. March 19, 2018

CS 301. Lecture 17 Church Turing thesis. Stephen Checkoway. March 19, 2018 CS 301 Lecture 17 Church Turing thesis Stephen Checkoway March 19, 2018 1 / 17 An abridged modern history of formalizing algorithms An algorithm is a finite, unambiguous sequence of steps for solving a

More information

Undecidable Problems and Reducibility

Undecidable Problems and Reducibility University of Georgia Fall 2014 Reducibility We show a problem decidable/undecidable by reducing it to another problem. One type of reduction: mapping reduction. Definition Let A, B be languages over Σ.

More information

Decidability: Reduction Proofs

Decidability: Reduction Proofs Decidability: Reduction Proofs Basic technique for proving a language is (semi)decidable is reduction Based on the following principle: Have problem A that needs to be solved If there exists a problem

More information

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65 Undecidable Problems Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, 2018 1/ 65 Algorithmically Solvable Problems Let us assume we have a problem P. If there is an algorithm solving

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 4.1, 5.1 Define reductions from one problem to another. Use reductions to prove

More information

Finite Automata. Mahesh Viswanathan

Finite Automata. Mahesh Viswanathan Finite Automata Mahesh Viswanathan In this lecture, we will consider different models of finite state machines and study their relative power. These notes assume that the reader is familiar with DFAs,

More information

CS 361 Meeting 26 11/10/17

CS 361 Meeting 26 11/10/17 CS 361 Meeting 26 11/10/17 1. Homework 8 due Announcements A Recognizable, but Undecidable Language 1. Last class, I presented a brief, somewhat inscrutable proof that the language A BT M = { M w M is

More information

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism, CS 54, Lecture 2: Finite Automata, Closure Properties Nondeterminism, Why so Many Models? Streaming Algorithms 0 42 Deterministic Finite Automata Anatomy of Deterministic Finite Automata transition: for

More information

CS154, Lecture 10: Rice s Theorem, Oracle Machines

CS154, Lecture 10: Rice s Theorem, Oracle Machines CS154, Lecture 10: Rice s Theorem, Oracle Machines Moral: Analyzing Programs is Really, Really Hard But can we more easily tell when some program analysis problem is undecidable? Problem 1 Undecidable

More information

Reducability. Sipser, pages

Reducability. Sipser, pages Reducability Sipser, pages 187-214 Reduction Reduction encodes (transforms) one problem as a second problem. A solution to the second, can be transformed into a solution to the first. We expect both transformations

More information

NP Complete Problems. COMP 215 Lecture 20

NP Complete Problems. COMP 215 Lecture 20 NP Complete Problems COMP 215 Lecture 20 Complexity Theory Complexity theory is a research area unto itself. The central project is classifying problems as either tractable or intractable. Tractable Worst

More information

Finish K-Complexity, Start Time Complexity

Finish K-Complexity, Start Time Complexity 6.045 Finish K-Complexity, Start Time Complexity 1 Kolmogorov Complexity Definition: The shortest description of x, denoted as d(x), is the lexicographically shortest string such that M(w) halts

More information

The Unsolvability of the Halting Problem. Chapter 19

The Unsolvability of the Halting Problem. Chapter 19 The Unsolvability of the Halting Problem Chapter 19 Languages and Machines SD D Context-Free Languages Regular Languages reg exps FSMs cfgs PDAs unrestricted grammars Turing Machines D and SD A TM M with

More information

Homework Assignment 6 Answers

Homework Assignment 6 Answers Homework Assignment 6 Answers CSCI 2670 Introduction to Theory of Computing, Fall 2016 December 2, 2016 This homework assignment is about Turing machines, decidable languages, Turing recognizable languages,

More information

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

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS Automata Theory Lecture on Discussion Course of CS2 This Lecture is about Mathematical Models of Computation. Why Should I Care? - Ways of thinking. - Theory can drive practice. - Don t be an Instrumentalist.

More information

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties of Regular Languages Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties Recall a closure property is a statement

More information

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler Complexity Theory Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 15 May, 2018 Reinhard

More information

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181. Complexity Theory Complexity Theory Outline Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität

More information

Theory of Computation

Theory of Computation Theory of Computation Unit 4-6: Turing Machines and Computability Decidability and Encoding Turing Machines Complexity and NP Completeness Syedur Rahman syedurrahman@gmail.com Turing Machines Q The set

More information

CS5371 Theory of Computation. Lecture 15: Computability VI (Post s Problem, Reducibility)

CS5371 Theory of Computation. Lecture 15: Computability VI (Post s Problem, Reducibility) CS5371 Theory of Computation Lecture 15: Computability VI (Post s Problem, Reducibility) Objectives In this lecture, we introduce Post s correspondence problem (playing with a special type of domino) We

More information

Week 3: Reductions and Completeness

Week 3: Reductions and Completeness Computational Complexity Theory Summer HSSP 2018 Week 3: Reductions and Completeness Dylan Hendrickson MIT Educational Studies Program 3.1 Reductions Suppose I know how to solve some problem quickly. How

More information

CS151 Complexity Theory. Lecture 1 April 3, 2017

CS151 Complexity Theory. Lecture 1 April 3, 2017 CS151 Complexity Theory Lecture 1 April 3, 2017 Complexity Theory Classify problems according to the computational resources required running time storage space parallelism randomness rounds of interaction,

More information

False. They are the same language.

False. They are the same language. CS 3100 Models of Computation Fall 2010 Notes 8, Posted online: September 16, 2010 These problems will be helpful for Midterm-1. More solutions will be worked out. The midterm exam itself won t be this

More information