Theory of Computation

Size: px
Start display at page:

Download "Theory of Computation"

Transcription

1 Theory of Computation Lecture #10 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 43

2 Lecture 10: Overview Linear Bounded Automata Acceptance Problem for LBAs Emptiness Problem for LBAs Computation Histories Emptiness Problem for CFGs An undecidable Problem for CFGs Post Correspondence Problem Sarmad Abbasi (Virtual University) Theory of Computation 2 / 43

3 Linear Bounded Automata An LBA L is a restricted type of TM. Its tape head is not permitted to move off the portion of the tape containing the input. Here is a diagram of an LBA: Sarmad Abbasi (Virtual University) Theory of Computation 3 / 43

4 Linear Bounded Automata As you can see the input portion of the tape is the only tape that the LBA is allowed to move its head on. Sarmad Abbasi (Virtual University) Theory of Computation 4 / 43

5 Acceptance Problem for LBAs Let us define the acceptance problem for LBAs. A lba = { M, w : M is a LBA that accepts w}. Is A lba decidable? Sarmad Abbasi (Virtual University) Theory of Computation 5 / 43

6 Acceptance Problem for LBAs Theorem Let M be an LBA with q states and g tape symbols. There are at most qng n distinct configurations of M for a tape of length n. Recall that a configuration is completely given by 1 The state of the machine. 2 The position of its head. 3 The contents of the tape. Sarmad Abbasi (Virtual University) Theory of Computation 6 / 43

7 Acceptance Problem for LBA In this case we have 1 q possibilities for the state. 2 n possibilities for the position of the head. 3 g possibilities for each tape cell. Since, there are n of them hence there are g n total possibilities. Sarmad Abbasi (Virtual University) Theory of Computation 7 / 43

8 Acceptance Problem for LBA Example: Suppose M has 7 states and 5 tape symbols. How many distinct configuration can we have for a tape of length 3. 1 The machine can be in any 7 states. 2 Its head can be scanning any tape cell. 3 possibilities. 3 1 Cell 1 can have any symbol (5 possibilities). 2 Cell 2 can have any symbol (5 possibilities). 3 Cell 2 can have any symbol (5 possibilities). So there are a total of distinct configurations. Sarmad Abbasi (Virtual University) Theory of Computation 8 / 43

9 Acceptance Problem for LBA Theorem Let M be an LBA with q states and g tape symbols. If M takes more then qng n steps on an input,x, of length n then the M does not halt on x. Note that in that case one of the configuration of the LBA has repeated. Hence, M is stuck in an endless loop. Sarmad Abbasi (Virtual University) Theory of Computation 9 / 43

10 Acceptance Problem for LBA Theorem A lba is decidable. We can simulate an LBA on its given input only for a finite amount of time to decide if it accepts the input or not. Sarmad Abbasi (Virtual University) Theory of Computation 10 / 43

11 Acceptance Problem for LBA Let L be a decider given as follows: 1 Input M, w where M is an LBA and w is a string. 2 Let n = w 3 Simulate M on w for qng n steps. 4 If M accepts accept. Else reject. Note that L is a decider. This is because if M does not accept w in qng n steps then it is in an endless loop and it will never accept w. Sarmad Abbasi (Virtual University) Theory of Computation 11 / 43

12 Acceptance Problems Summary A DFA = { D, w : D is a DFA that accepts w}. A DFA is decidable. Reason: we have to simulate D on w only for n steps. A REX = { R, w : R is a regular expression that generates w}. A REX is decidable. We convert the regular expression into a dfa and then use the decider for A REX to decide A REX. A CFG = { G, w : G is a context free grammar that generates w}. A CFG is decidable. Since we can convert G into Chomsky normal form and list all derivations of length 2n 1. A PDA = { P, w : P is Pda that accepts w}. This is decidable. Since, we can convert a PDA into a equivalent grammar and then use the decider for A PDA. Sarmad Abbasi (Virtual University) Theory of Computation 12 / 43

13 Emptiness Problem for LBA Let us define the emptiness problem for LBAs. A REX = { M : M is a LBA and L(M) = }. Is A REX undecidable? Sarmad Abbasi (Virtual University) Theory of Computation 13 / 43

14 Acceptance Problem for LBA We will show once again that: If A REX is decidable then A REX is decidable. Sarmad Abbasi (Virtual University) Theory of Computation 14 / 43

15 Acceptance Problem for LBA What would we like to do? Given an input M, w where M is a TM and w is a string. We want to construct a LBA B such that B is going to accept only accepting computation history of M on w. Now, if M accepts w then there is one computation history that B will accept. On the other hand if M does not accept w then L(B) =. Sarmad Abbasi (Virtual University) Theory of Computation 15 / 43

16 Computation Histories Let M be a TM. We have the following concepts. 1 A state. This just tells us what the current state of the machine is. 2 A configuration. This tells us what the state is and all the tape contents. So, given a configuration we can figure out what will be the next configuration. A computation history is a sequence of configurations. A computation history on an input w will consist of configurations C 1, C 2,..., C l such that 1 C 1 is the initial configuration of M on w. 2 C i yields C i+1. Sarmad Abbasi (Virtual University) Theory of Computation 16 / 43

17 Computation Histories A computation history of M on w is accepting if the last configuration in the history is an accepting configuration. Note that a accepting computation history of M on w is a proof that M accepts w. We will encode a computation history as follows: C 1 #C 2 # #C l. Sarmad Abbasi (Virtual University) Theory of Computation 17 / 43

18 Computation Histories Given a TM M and w we can construct an LBA B such that B accepts the accepting computation history of M on w. We give an informal description of B. Sarmad Abbasi (Virtual University) Theory of Computation 18 / 43

19 Computation Histories 1 On input C 1 #... #C l. 2 Check if C 1 = q 0 w. 3 Check if C l has an accept state. 4 Check C i yields C i+1. 1 The transition function of M is hard coded in B. 2 B zigzags between C i and C i+1 to make sure if C i yields C i+1 Note that B never uses any extra memory. It only uses the portion of the input that is given to B. Sarmad Abbasi (Virtual University) Theory of Computation 19 / 43

20 Computation Histories B is an LBA. 1 Note that the input to B is not w but a computation history H of M. 2 In order to check if H is an computation history history of M on w it does not need more tape then the portion on which H is written. Sarmad Abbasi (Virtual University) Theory of Computation 20 / 43

21 Computation Histories Theorem Let M and w be given and B be constructed as earlier. The { =, M does not accept w; L(B), M accepts w. Sarmad Abbasi (Virtual University) Theory of Computation 21 / 43

22 Computation Histories Theorem E LBA is undecidable. Suppose R decides E LBA then consider S 1 On input M, w. 2 Construct and LBA B as described earlier. 3 Run R on B. If R accepts reject. If R rejects accepts. Note that S is a decider for A TM. A contradiction. Sarmad Abbasi (Virtual University) Theory of Computation 22 / 43

23 Context Free Grammars Let us define the emptiness problem for CFGs. E cfg = { G : G is a CFGL(G) = }. Is E CFG decidable? Sarmad Abbasi (Virtual University) Theory of Computation 23 / 43

24 Emptiness Problem for CFGs 1 On input G. 2 Mark all terminals of G. 3 While no new symbols are marked. 4 If A X 1... X r is a production with all symbols marked on the right hand side. Mark A. 5 If the start symbol is marked then reject else accept. Sarmad Abbasi (Virtual University) Theory of Computation 24 / 43

25 Context Free Grammars Let us define the another problem for CFGs. ALL CFG = { G : G is a CFGL(G) = Σ }. Is ALL CFG decidable? Sarmad Abbasi (Virtual University) Theory of Computation 25 / 43

26 ALL CFG On the surface the problem looks difficult. We have to find at least one string that is not generated by the grammar G. However there are infinitely many potential strings. But our goal is to PROVE that it is undecidable. Theorem ALL CFG is undecidable. Sarmad Abbasi (Virtual University) Theory of Computation 26 / 43

27 Computation Histories Once again we will show that If ALL CFG is decidable then A TM is decidable. Sarmad Abbasi (Virtual University) Theory of Computation 27 / 43

28 Computation Histories Given a TM M and w we can construct an PDA D such that D rejects the accepting configuration history of M on w (appropriately encoded) and accepts all other strings. We give an informal description of D. Sarmad Abbasi (Virtual University) Theory of Computation 28 / 43

29 Computation Histories We will use a trick here. Let C 1,..., C l be a computation history. We will encode it as follows: C 1 #C r 2 #C 3#C r 4 #C l We will see in a minute why we are doing this. Sarmad Abbasi (Virtual University) Theory of Computation 29 / 43

30 Computation Histories Now consider the following PDA D. The PDA will take a computation history H = C 1,..., C n and do the following. 1 If C 1 is not the initial configuration of M on w accept. 2 If C l is not a final configuration then accept. 3 If there is an i such that C i does not yield C i+1 then accepts. Note that D is a non-deterministic PDA and therefore it can guess which one of these conditions is violated. Sarmad Abbasi (Virtual University) Theory of Computation 30 / 43

31 Computation Histories Since w is hard coded in D it can check if the first configuration is not the initial configuration. Similarly, it is easy to check if the last configuration is not an accepting configuration. How does D check if C i does not yield C i+1? Sarmad Abbasi (Virtual University) Theory of Computation 31 / 43

32 Computation Histories This is why we said we will use an special encoding. We had C i #C r i+1 Thus D can push C i on its stack and pop it and check if C i yields C i+1 or not. Sarmad Abbasi (Virtual University) Theory of Computation 32 / 43

33 Computation Histories Theorem Given M and w we can construct a PDA D such that D rejects the accepting computation of M on w (properly encoded). It accepts all other strings. Sarmad Abbasi (Virtual University) Theory of Computation 33 / 43

34 Computation Histories Theorem Let M and w be given and D be constructed as earlier. Let G be a grammar which generates all the strings accepted by G. Then { = Σ L(G), M does not accept w; Σ, M accepts w. Sarmad Abbasi (Virtual University) Theory of Computation 34 / 43

35 Computation Histories Theorem ALL CFG is undecidable. If ALL CFG is decidable then there is a decider R such that L(R) = ALL CFG. Suppose R decides ALL CFG then consider S 1 On input M, w. 2 Construct and LBA D as described earlier. 3 Convert D into an equivalent CFG G. 4 Run R on G. If R accepts reject. If R rejects accepts. Note that S is a decider for A TM. A contradiction. Sarmad Abbasi (Virtual University) Theory of Computation 35 / 43

36 Post Correspondence Problem Post Correspondence Problem (PCP) is a puzzle. We are given a collection of dominos each containing two strings, on on each side. A domino looks like this: Sarmad Abbasi (Virtual University) Theory of Computation 36 / 43

37 Post Correspondence Problem This domino has a on top and ab on the bottom. A collection of dominos looks like this. 1 The first domino has b on top and ca on the bottom. 2 The second domino has a on top and ab on the bottom. 3 The third domino has ca on top and a on the bottom. 4 The fourth domino has abc on top and c on the bottom. Sarmad Abbasi (Virtual University) Theory of Computation 37 / 43

38 Post Correspondence Problem We make a list of dominos by placing the next to each other. We are allowed repetitions. This list is called a match if reading of the top symbols gives us the same string as reading of the bottom symbols. Sarmad Abbasi (Virtual University) Theory of Computation 38 / 43

39 Post Correspondence Problem For example. Here we have a match. Reading of the top symbols gives us abcaaabc and same is the case if we read the bottom. Sarmad Abbasi (Virtual University) Theory of Computation 39 / 43

40 Post Correspondence Problem Lets look at another collection. This collection has three dominos. Sarmad Abbasi (Virtual University) Theory of Computation 40 / 43

41 Post Correspondence Problem 1 The first domino has abc on top and ab on the bottom. 2 The first domino has ca on top and a on the bottom. 3 The first domino has acc on top and ba on the bottom. For this collection it is not possible to find a match. Why? The top of each domino has more letter than the bottom. So in any list the top string will be longer than the bottom string. Sarmad Abbasi (Virtual University) Theory of Computation 41 / 43

42 Post Correspondence Problem Given a collection P of Dominos. Does P have a match? PCP = { P : P has a match }. Sarmad Abbasi (Virtual University) Theory of Computation 42 / 43

43 Post Correspondence Problem Theorem PCP is undecidable. Sarmad Abbasi (Virtual University) Theory of Computation 43 / 43

CS5371 Theory of Computation. Lecture 14: Computability V (Prove by Reduction)

CS5371 Theory of Computation. Lecture 14: Computability V (Prove by Reduction) CS5371 Theory of Computation Lecture 14: Computability V (Prove by Reduction) Objectives This lecture shows more undecidable languages Our proof is not based on diagonalization Instead, we reduce the problem

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

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

Theory of Computation

Theory of Computation Theory of Computation Lecture #10 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 35 Lecture 10: Overview Undecidability of the Halting Problem Russell s Paradox

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

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

UNIT-VIII COMPUTABILITY THEORY

UNIT-VIII COMPUTABILITY THEORY CONTEXT SENSITIVE LANGUAGE UNIT-VIII COMPUTABILITY THEORY A Context Sensitive Grammar is a 4-tuple, G = (N, Σ P, S) where: N Set of non terminal symbols Σ Set of terminal symbols S Start symbol of the

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

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

Chap. 4,5 Review. Algorithms created in proofs from prior chapters Chap. 4,5 Review Algorithms created in proofs from prior chapters (p. 55) Theorem 1.39: NFA to DFA (p. 67) Lemma 1.55: Regex to NFA (p. 69) Lemma 1.60: DFA to regex (through GNFA) (p. 112) Lemma 2.21:

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

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 Computation History A computation history of a TM M is a sequence of its configurations C 1, C 2,, C l such

More information

Theory of Computation (IX) Yijia Chen Fudan University

Theory of Computation (IX) Yijia Chen Fudan University Theory of Computation (IX) Yijia Chen Fudan University Review The Definition of Algorithm Polynomials and their roots A polynomial is a sum of terms, where each term is a product of certain variables and

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

ACS2: Decidability Decidability

ACS2: Decidability Decidability Decidability Bernhard Nebel and Christian Becker-Asano 1 Overview An investigation into the solvable/decidable Decidable languages The halting problem (undecidable) 2 Decidable problems? Acceptance problem

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

Theory of Computation Turing Machine and Pushdown Automata

Theory of Computation Turing Machine and Pushdown Automata Theory of Computation Turing Machine and Pushdown Automata 1. What is a Turing Machine? A Turing Machine is an accepting device which accepts the languages (recursively enumerable set) generated by type

More information

ECS 120 Lesson 20 The Post Correspondence Problem

ECS 120 Lesson 20 The Post Correspondence Problem ECS 120 Lesson 20 The Post Correspondence Problem Oliver Kreylos Wednesday, May 16th, 2001 Today we will continue yesterday s discussion of reduction techniques by looking at another common strategy, reduction

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

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

Introduction to Languages and Computation

Introduction to Languages and Computation Introduction to Languages and Computation George Voutsadakis 1 1 Mathematics and Computer Science Lake Superior State University LSSU Math 400 George Voutsadakis (LSSU) Languages and Computation July 2014

More information

Outline 1 PCP. 2 Decision problems about CFGs. M.Mitra (ISI) Post s Correspondence Problem 1 / 10

Outline 1 PCP. 2 Decision problems about CFGs. M.Mitra (ISI) Post s Correspondence Problem 1 / 10 Outline 1 PCP 2 Decision problems about CFGs M.Mitra (ISI) Post s Correspondence Problem 1 / 10 PCP reduction Given: M, w in encoded form To construct: an instance (A, B) of MPCP such that M accepts w

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

Decidability (intro.)

Decidability (intro.) CHAPTER 4 Decidability Contents Decidable Languages decidable problems concerning regular languages decidable problems concerning context-free languages The Halting Problem The diagonalization method The

More information

AC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013

AC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013 Q.2 a. Prove by mathematical induction n 4 4n 2 is divisible by 3 for n 0. Basic step: For n = 0, n 3 n = 0 which is divisible by 3. Induction hypothesis: Let p(n) = n 3 n is divisible by 3. Induction

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

Decidability. Overview. Preliminaries to Halting Problem. Decidable Problems of Regular Languages. Decidable Problems of Context-Free Languages

Decidability. Overview. Preliminaries to Halting Problem. Decidable Problems of Regular Languages. Decidable Problems of Context-Free Languages CS533 Class 04a: 1 c P. Heeman, 2017 Introduction: Decidability Overview Decidable Problems of Regular Languages Decidable Problems of Context-Free Languages Preliminaries to Halting Problem CS533 Class

More information

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever.   ETH Zürich (D-ITET) October, Automata & languages A primer on the Theory of Computation Laurent Vanbever www.vanbever.eu ETH Zürich (D-ITET) October, 19 2017 Part 5 out of 5 Last week was all about Context-Free Languages Context-Free

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

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK COMS11700 Undecidability Department of Computer Science, University of Bristol Bristol, UK 4 April 2014 COMS11700: Undecidability Slide 1/29 Decidability We are particularly interested in Turing machines

More information

Advanced Undecidability Proofs

Advanced Undecidability Proofs 17 Advanced Undecidability Proofs In this chapter, we will discuss Rice s Theorem in Section 17.1, and the computational history method in Section 17.3. As discussed in Chapter 16, these are two additional

More information

Automata and Computability. Solutions to Exercises

Automata and Computability. Solutions to Exercises Automata and Computability Solutions to Exercises Spring 27 Alexis Maciel Department of Computer Science Clarkson University Copyright c 27 Alexis Maciel ii Contents Preface vii Introduction 2 Finite Automata

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

Automata and Computability. Solutions to Exercises

Automata and Computability. Solutions to Exercises Automata and Computability Solutions to Exercises Fall 28 Alexis Maciel Department of Computer Science Clarkson University Copyright c 28 Alexis Maciel ii Contents Preface vii Introduction 2 Finite Automata

More information

Computability Theory

Computability Theory CS:4330 Theory of Computation Spring 2018 Computability Theory Decidable Problems of CFLs and beyond Haniel Barbosa Readings for this lecture Chapter 4 of [Sipser 1996], 3rd edition. Section 4.1. Decidable

More information

CP405 Theory of Computation

CP405 Theory of Computation CP405 Theory of Computation BB(3) q 0 q 1 q 2 0 q 1 1R q 2 0R q 2 1L 1 H1R q 1 1R q 0 1L Growing Fast BB(3) = 6 BB(4) = 13 BB(5) = 4098 BB(6) = 3.515 x 10 18267 (known) (known) (possible) (possible) Language:

More information

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 8 Nancy Lynch

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 8 Nancy Lynch 6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010 Class 8 Nancy Lynch Today More undecidable problems: About Turing machines: Emptiness, etc. About

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 15 Ana Bove May 17th 2018 Recap: Context-free Languages Chomsky hierarchy: Regular languages are also context-free; Pumping lemma

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY REVIEW for MIDTERM 1 THURSDAY Feb 6 Midterm 1 will cover everything we have seen so far The PROBLEMS will be from Sipser, Chapters 1, 2, 3 It will be

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

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 Section 4.1 Explain what it means for a problem to be decidable. Justify the use

More information

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

Lecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009 CS 373: Theory of Computation Sariel Har-Peled and Madhusudan Parthasarathy Lecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009 This lecture covers Rice s theorem, as well as

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

Homework 8. a b b a b a b. two-way, read/write

Homework 8. a b b a b a b. two-way, read/write Homework 8 309 Homework 8 1. Describe a TM that accepts the set {a n n is a power of 2}. Your description should be at the level of the descriptions in Lecture 29 of the TM that accepts {ww w Σ } and the

More information

MA/CSSE 474 Theory of Computation

MA/CSSE 474 Theory of Computation MA/CSSE 474 Theory of Computation CFL Hierarchy CFL Decision Problems Your Questions? Previous class days' material Reading Assignments HW 12 or 13 problems Anything else I have included some slides online

More information

CS20a: Turing Machines (Oct 29, 2002)

CS20a: Turing Machines (Oct 29, 2002) CS20a: Turing Machines (Oct 29, 2002) So far: DFA = regular languages PDA = context-free languages Today: Computability 1 Church s thesis The computable functions are the same as the partial recursive

More information

The Turing Machine. Computability. The Church-Turing Thesis (1936) Theory Hall of Fame. Theory Hall of Fame. Undecidability

The Turing Machine. Computability. The Church-Turing Thesis (1936) Theory Hall of Fame. Theory Hall of Fame. Undecidability The Turing Machine Computability Motivating idea Build a theoretical a human computer Likened to a human with a paper and pencil that can solve problems in an algorithmic way The theoretical provides a

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form:

More information

Pushdown automata. Twan van Laarhoven. Institute for Computing and Information Sciences Intelligent Systems Radboud University Nijmegen

Pushdown automata. Twan van Laarhoven. Institute for Computing and Information Sciences Intelligent Systems Radboud University Nijmegen Pushdown automata Twan van Laarhoven Institute for Computing and Information Sciences Intelligent Systems Version: fall 2014 T. van Laarhoven Version: fall 2014 Formal Languages, Grammars and Automata

More information

SCHEME FOR INTERNAL ASSESSMENT TEST 3

SCHEME FOR INTERNAL ASSESSMENT TEST 3 SCHEME FOR INTERNAL ASSESSMENT TEST 3 Max Marks: 40 Subject& Code: Automata Theory & Computability (15CS54) Sem: V ISE (A & B) Note: Answer any FIVE full questions, choosing one full question from each

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

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

Turing Machines Part III

Turing Machines Part III Turing Machines Part III Announcements Problem Set 6 due now. Problem Set 7 out, due Monday, March 4. Play around with Turing machines, their powers, and their limits. Some problems require Wednesday's

More information

Section 14.1 Computability then else

Section 14.1 Computability then else Section 14.1 Computability Some problems cannot be solved by any machine/algorithm. To prove such statements we need to effectively describe all possible algorithms. Example (Turing machines). Associate

More information

Part I: Definitions and Properties

Part I: Definitions and Properties Turing Machines Part I: Definitions and Properties Finite State Automata Deterministic Automata (DFSA) M = {Q, Σ, δ, q 0, F} -- Σ = Symbols -- Q = States -- q 0 = Initial State -- F = Accepting States

More information

Theory of Computation

Theory of Computation Theory of Computation Lecture #2 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 1 Lecture 2: Overview Recall some basic definitions from Automata Theory.

More information

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

An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM Turing Machines Review An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM Varieties of TMs Multi-Tape TMs Nondeterministic TMs String Enumerators

More information

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine) CS537 Theory of Computation Lecture : Computability Theory I (Turing Machine) Objectives Introduce the Turing Machine (TM)? Proposed by Alan Turing in 936 finite-state control + infinitely long tape A

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

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

CS481F01 Solutions 8

CS481F01 Solutions 8 CS481F01 Solutions 8 A. Demers 7 Dec 2001 1. Prob. 111 from p. 344 of the text. One of the following sets is r.e. and the other is not. Which is which? (a) { i L(M i ) contains at least 481 elements }

More information

CS 361 Meeting 28 11/14/18

CS 361 Meeting 28 11/14/18 CS 361 Meeting 28 11/14/18 Announcements 1. Homework 9 due Friday Computation Histories 1. Some very interesting proos o undecidability rely on the technique o constructing a language that describes the

More information

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4 Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form: A BC A a S ε B and C aren t start variables a is

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

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

Theory of Computation (IV) Yijia Chen Fudan University

Theory of Computation (IV) Yijia Chen Fudan University Theory of Computation (IV) Yijia Chen Fudan University Review language regular context-free machine DFA/ NFA PDA syntax regular expression context-free grammar Pushdown automata Definition A pushdown automaton

More information

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine) CS537 Theory of Computation Lecture : Computability Theory I (Turing Machine) Objectives Introduce the Turing Machine (TM) Proposed by Alan Turing in 936 finite-state control + infinitely long tape A stronger

More information

CISC4090: Theory of Computation

CISC4090: Theory of Computation CISC4090: Theory of Computation Chapter 2 Context-Free Languages Courtesy of Prof. Arthur G. Werschulz Fordham University Department of Computer and Information Sciences Spring, 2014 Overview In Chapter

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/ Review of CFG, CFL, ambiguity What is the language generated by the CFG below: G 1 = ({S,T 1,T 2 }, {0,1,2}, { S

More information

acs-07: Decidability Decidability Andreas Karwath und Malte Helmert Informatik Theorie II (A) WS2009/10

acs-07: Decidability Decidability Andreas Karwath und Malte Helmert Informatik Theorie II (A) WS2009/10 Decidability Andreas Karwath und Malte Helmert 1 Overview An investigation into the solvable/decidable Decidable languages The halting problem (undecidable) 2 Decidable problems? Acceptance problem : decide

More information

The Post Correspondence Problem

The Post Correspondence Problem The Post Correspondence Problem - Given a set, P of pairs of strings: where t i, b i Σ P = {[ t 1 b 1 ], t 2 b 2 ],, t k b k ]} - Question: Does there exist a sequence i 1, i 2, i n such that: t i1 t i2

More information

CS481F01 Prelim 2 Solutions

CS481F01 Prelim 2 Solutions CS481F01 Prelim 2 Solutions A. Demers 7 Nov 2001 1 (30 pts = 4 pts each part + 2 free points). For this question we use the following notation: x y means x is a prefix of y m k n means m n k For each of

More information

Pushdown Automata (Pre Lecture)

Pushdown Automata (Pre Lecture) Pushdown Automata (Pre Lecture) Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2017 Dantam (Mines CSCI-561) Pushdown Automata (Pre Lecture) Fall 2017 1 / 41 Outline Pushdown Automata Pushdown

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 2 Define push down automata Trace the computation of a push down automaton Design

More information

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

An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM Turing Machines Review An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM Varieties of TMs Multi-Tape TMs Nondeterministic TMs String Enumerators

More information

Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs

Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs Harry Lewis October 8, 2013 Reading: Sipser, pp. 119-128. Pushdown Automata (review) Pushdown Automata = Finite automaton

More information

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

Decidability. Linz 6 th, Chapter 12: Limits of Algorithmic Computation, page 309ff Decidability Linz 6 th, Chapter 12: Limits of Algorithmic Computation, page 309ff 1 A property P of strings is said to be decidable if the set of all strings having property P is a recursive set; that

More information

Pushdown Automata (2015/11/23)

Pushdown Automata (2015/11/23) Chapter 6 Pushdown Automata (2015/11/23) Sagrada Familia, Barcelona, Spain Outline 6.0 Introduction 6.1 Definition of PDA 6.2 The Language of a PDA 6.3 Euivalence of PDA s and CFG s 6.4 Deterministic PDA

More information

Foundations of

Foundations of 91.304 Foundations of (Theoretical) Computer Science Chapter 3 Lecture Notes (Section 3.2: Variants of Turing Machines) David Martin dm@cs.uml.edu With some modifications by Prof. Karen Daniels, Fall 2012

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

DM17. Beregnelighed. Jacob Aae Mikkelsen

DM17. Beregnelighed. Jacob Aae Mikkelsen DM17 Beregnelighed Jacob Aae Mikkelsen January 12, 2007 CONTENTS Contents 1 Introduction 2 1.1 Operations with languages...................... 2 2 Finite Automata 3 2.1 Regular expressions/languages....................

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

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

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

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

1 Unrestricted Computation

1 Unrestricted Computation 1 Unrestricted Computation General Computing Machines Machines so far: DFAs, NFAs, PDAs Limitations on how much memory they can use: fixed amount of memory plus (for PDAs) a stack Limitations on what they

More information

Theory of Computation

Theory of Computation Thomas Zeugmann Hokkaido University Laboratory for Algorithmics http://www-alg.ist.hokudai.ac.jp/ thomas/toc/ Lecture 14: Applications of PCP Goal of this Lecture Our goal is to present some typical undecidability

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 Today s Agenda Quick Review of CFG s and PDA s Introduction to Turing Machines and their Languages Reminders and

More information

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad-500 014 Subject: FORMAL LANGUAGES AND AUTOMATA THEORY Class : CSE II PART A (SHORT ANSWER QUESTIONS) UNIT- I 1 Explain transition diagram, transition

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

Theory of Computation

Theory of Computation Theory of Computation Dr. Sarmad Abbasi Dr. Sarmad Abbasi () Theory of Computation / Lecture 3: Overview Decidability of Logical Theories Presburger arithmetic Decidability of Presburger Arithmetic Dr.

More information

Turing Machine Variants

Turing Machine Variants CS311 Computational Structures Turing Machine Variants Lecture 12 Andrew Black Andrew Tolmach 1 The Church-Turing Thesis The problems that can be decided by an algorithm are exactly those that can be decided

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 2 Design a PDA and a CFG for a given language Give informal description for a PDA,

More information

Space Complexity. The space complexity of a program is how much memory it uses.

Space Complexity. The space complexity of a program is how much memory it uses. Space Complexity The space complexity of a program is how much memory it uses. Measuring Space When we compute the space used by a TM, we do not count the input (think of input as readonly). We say that

More information

6.8 The Post Correspondence Problem

6.8 The Post Correspondence Problem 6.8. THE POST CORRESPONDENCE PROBLEM 423 6.8 The Post Correspondence Problem The Post correspondence problem (due to Emil Post) is another undecidable problem that turns out to be a very helpful tool for

More information

Theory of Computation p.1/?? Theory of Computation p.2/?? We develop examples of languages that are decidable

Theory of Computation p.1/?? Theory of Computation p.2/?? We develop examples of languages that are decidable Decidable Languages We use languages to represent various computational problems because we have a terminology for dealing with languages Definition: A language is decidable if there is an algorithm (i.e.

More information

Introduction to Turing Machines

Introduction to Turing Machines Introduction to Turing Machines Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. 12 November 2015 Outline 1 Turing Machines 2 Formal definitions 3 Computability

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

1. Draw a parse tree for the following derivation: S C A C C A b b b b A b b b b B b b b b a A a a b b b b a b a a b b 2. Show on your parse tree u,

1. Draw a parse tree for the following derivation: S C A C C A b b b b A b b b b B b b b b a A a a b b b b a b a a b b 2. Show on your parse tree u, 1. Draw a parse tree for the following derivation: S C A C C A b b b b A b b b b B b b b b a A a a b b b b a b a a b b 2. Show on your parse tree u, v, x, y, z as per the pumping theorem. 3. Prove that

More information

MTAT Introduction to Theoretical Computer Science

MTAT Introduction to Theoretical Computer Science MTAT.5.25 Introduction to Theoretical Computer Science Autumn 25 Vitaly Skachek Estonian version by Reimo Palm English version by Yauhen Yakimenka Lecture 2. Decidable languages. Decidable languages We

More information

Variants of Turing Machine (intro)

Variants of Turing Machine (intro) CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples, Turing-recognizable and Turing-decidable languages Variants of Turing Machine Multi-tape Turing machines, non-deterministic

More information