Decidable and undecidable languages

Size: px
Start display at page:

Download "Decidable and undecidable languages"

Transcription

1 The Chinese University of Hong Kong Fall 2011 CSCI 3130: Formal languages and automata theory Decidable and undecidable languages Andrej Bogdanov

2 Problems about automata Does a b a q 0 q 1 b accept input abb? We can formulate this question as a language: A DFA = { D, w : D is a DFA that accepts input w} Is A DFA decidable? ((q0,q1)(a,b)((q0,a,q0)(q0,b,q1)(q1,a,q0)(q1,b,q1)(q0)(q1))(abb) D = (Q, Σ, δ, q 0, F) w

3 Problems about automata A DFA = { D, w : D is a DFA that accepts input w} pseudocode: On input D, w, where D = (Q, Σ, δ, q 0, F): Set q := q 0 For i := 1 to length(w): q := δ(q, w i ) If q F accept, else reject TM description: On input D, w, where D is a DFA, w is a string Simulate D on input w If simulation ends in acc state, accept. Otherwise, reject.

4 Problems about automata A DFA = { D, w : D is a DFA that accepts input w} Turing Machine details: Check input is in correct format. (Transition function is complete, no duplicate transitions) Perform simulation: state input symbol ((q0,q1)(a,b)((q0,a,q0)(q0,b,q1)(q1,a,q0)(q1,b,q1)(q0)(q1))(abb) q acc

5 Problems about automata A DFA = { D, w : D is a DFA that accepts input w} Turing Machine details: Check input is in correct format. (Transition function is complete, no duplicate transitions) Perform simulation: Put markers on start state of D and first symbol of w Until marker for w reaches last symbol: Update both markers If state marker is on accepting state, accept. Else reject.

6 Acceptance problems about automata A DFA = { D, w : D is a DFA that accepts input w} A NFA = { N, w : N is an NFA that accepts w} A REX = { R, w : R is a regular expression that generates w} Which of these is decidable?

7 Acceptance problems about automata A DFA = { D, w : D is a DFA that accepts input w} The following TM decides A DFA : M := On input D, w, where D is a DFA and w is a string Simulate D on input w If the simulation ends in acc state of D, accept. If it doesn t, reject.

8 Acceptance problems about automata A NFA = { N, w : N is an NFA that accepts input w} The following TM decides A NFA : N := On input N, w, where N is an NFA and w is a string Convert N to a DFA D using the conversion procedure from Lecture 2 Run the TM M for A DFA on input D, w If M accepts, accept. Otherwise, reject.

9 Acceptance problems about automata A REX = { R, w : R is a regular expression that generates w} The following TM decides A REX : P := On input R, w, where R is a reg exp and w is a string Convert R to an NFA N using the conversion procedure from Lecture 4 Run the TM N for A NFA on input N, w If N accepts, accept. Otherwise, reject.

10 Other problems about automata MIN DFA = { D : D is a minimal DFA} The following TM decides MIN DFA : R := On input D, where D is a DFA Run the distinguishable states algorithm If every pair of states is distinguishable, accept. Otherwise, reject.

11 Other problems about automata EQ DFA = { D 1, D 2 : D 1, D 2 are DFAs and L(D 1 ) = L(D 2 )} The following TM decides EQ DFA : S := On input D 1, D 2, where D 1 and D 2 are DFAs Run the DFA minimization algorithm on D 1 to obtain a DFA D 1 Run the DFA minimization algorithm on D 2 to obtain a DFA D 2 If D 1 = D 2 accept, otherwise reject.

12 Other problems about automata E DFA = { D : D is a DFAs and L(D) is empty} The following TM decides E DFA : T := On input D, where D is a DFA Run the TM S for EQ DFA on input D, If S accepts accept, otherwise reject.

13 Problems about context-free grammars A CFG = { G, w : G is a CFG that generates w} V := On input G, w, where G is a CFG and w is a string Eliminate the nullable and unit productions from G Convert G to Chomsky Normal Form Run the Cocke-Younger-Kasami algorithm on G, w If the CYK algorithm produces a parse tree, accept. Otherwise, reject.

14 Decidability of context-free languages Every context-free language is decidable. Let L be a context-free language. There is a CFG G for L. The following TM decides L: M G := On input w, Run TM V on input G, w. If V accepts accept, otherwise reject.

15 Are all languages about CFGs decidable? EQ CFG = { G 1, G 2 : G 1 and G 2 are context-free grammars that generate the same strings} What s the difference between EQ DFA and EQ CFG? To decide EQ DFA, we minimized both DFAs But there is no method that, given a CFG or PDA, produces a unique equivalent minimal CFG or PDA

16 The universal Turing Machine and undecidability

17 Turing Machines versus computers program data computer output A computer is a machine that manipulates data according to a list of instructions. How does a Turing Machine take a program as part of its input?

18 The Universal Turing Machine program M input x for M U whatever M does on x The universal TM U takes as inputs a program M and a string x and simulates M on x The program M itself is specified as a TM!

19 Turing Machines as strings / R q q a q r M A Turing Machine is (Q, Σ, Γ, δ, q 0, q acc, q rej ) This Turing Machine can be described by the string M = (q,qa,qr)(0,1)(0,1, ) ((q,q, / R) (q,qa,0/0r) (q,qr,1/1r)) (q)(qa)(qr)

20 The universal Turing Machine U (q,qa,qr)(0,1)(0,1, 001 program M input w for M U := On input M, w, Simulate M on input w If M enters accept state, accept. If M enters reject state, reject.

21 Acceptance of Turing Machines A TM = { M, w : M is a TM that accepts w} U := On input M, w, Simulate M on input w M accepts w M rejects w M loops on w U accepts M, w U rejects M, w U loops on M, w TM U recognizes but does not decide A TM

22 Recognizing versus deciding q acc q rej accept reject loop halt A TM decides language L if it recognizes L and halts (does not loop) on every input

23 Undecidability Turing s Theorem: The language A TM is undecidable. Before we show this, let s observe one thing: A Turing Machine M can be given its own description M as an input!

24 Proof of Turing s Theorem Proof by contradiction: Suppose A TM is decidable. Then there is a TM H that decides A TM : M, M, M w accept if M accepts wm H What happens when w = M? reject if M rejects w M or M loops on w M

25 Proof of undecidability M, M accept if M accepts M H reject if M rejects M or M loops on M Let H be a TM that does the opposite of H H acc rej H acc To go from H to H, rej just switch its accept and reject states

26 Proof of undecidability M, M accept if M accepts M H reject if M rejects M or M loops on M M, M H accept if M rejects M or M loops on M reject if M accepts M

27 Proof of undecidability M, M H accept if M rejects M or M loops on M reject if M accepts M Let D be the following TM: M M, M copy H

28 Proof of undecidability M D D if DM rejects M D accept or DM loops on M D reject if MD accepts M D What happens when M = D? If D accepts D then D rejects D If D rejects D then D accepts D H never loops, so D never loops either so D does not exist!

29 Proof of undecidability: conclusion Proof by contradiction We assumed A TM was decidable Then we built Turing Machines H, H, D But D does not exist! Conclusion The language A TM is undecidable.

30 What happened? all possible inputs w ε all possible Turing Machines M 1 M 2 M 3 acc rej rej acc rej acc loop rej rej loop rej rej We can write an infinite table for every pair (M, w)

31 What happened? M 1 M 2 M 3 M 4 M 1 M 2 M 3 acc loop rej acc rej acc rej acc loop rej loop rej Now let s look only at those w that describe a TM M

32 What happened? M 1 M 2 M 3 M 4 M 1 M 2 acc loop rej acc rej acc rej acc D rej rej acc rej If A TM is decidable, then TM D is in the table

33 What happened? M 1 M 2 M 3 M 4 M 1 M 2 acc loop rej acc rej acc rej acc D rej rej acc rej D does the opposite of the diagonal entries M D accept if M rejects or loops on M reject if M accepts M

34 What happened? M 1 M 2 M 1 M 2 M 3 M 4 acc loop rej acc rej acc rej acc D loop acc D rej rej acc rej? We run into trouble when we look at (D, D )!

35 Unrecognizable languages The language A TM is recognizable but not decidable. How about languages that are not recognizable? A TM = { M, w : M is a TM that does not accept w} = { M, w : M rejects or loops on input w} The language A TM is not recognizable.

36 Unrecognizable languages Theorem If L and L are both recognizable, then L is decidable. We know A TM is recognizable, so if A TM were also, then A TM would be decidable But Turing s Theorem says A TM is not decidable

37 Unrecognizable languages If L and L are both recognizable, then L is decidable. Proof idea w M accept if w L rej/loop if w L accept w w accept if w L M rej/loop if w L reject

38 Unrecognizable languages If L and L are both recognizable, then L is decidable. Let M = TM for L, M = TM for L On input w, 1 2 Problem: If M loops on w, we will never get to step 2! Simulate M on input w. If it accepts, accept. Simulate M on input w. If it accepts, reject.

39 Bounded simulation If L and L are both recognizable, then L is decidable. Turing Machine that decides L: Let M = TM for L, M = TM for L On input w, For t := 0 to infinity Do t transitions of M on w. If it accepts, accept. Do t transitions of M on w. If it accepts, reject.

40 The Chinese University of Hong Kong Fall 2011 CSCI 3130: Formal languages and automata theory Reducibility Andrej Bogdanov

41 Summary of last lecture program M input w for M U accept, if M accepts w reject, if M rejects w loops, if M loops on w The universal TM U takes as inputs a program M and a string x and simulates M on x The program M itself is specified as a TM!

42 Summary of last lecture q acc q rej accept reject loop halt A TM = { M, w : M is a TM that accepts input w} recognizable: undecidable: By universal TM U Turing s Theorem

43 Another undecidable language HALT TM = { M, w : M is a TM that halts on input w} HALT TM is an undecidable language We will argue that If HALT TM is decidable, so is A TM. but by Turing s Theorem it is not.

44 Undecidability of halting If HALT TM can be decided, so can A TM. Suppose R decides HALT TM M, w R accept if M halts on w reject if M loops on w We want a TM S that decides A TM M, w accept if M accepts w? reject if M rejects or loops on w

45 Undecidability of halting M, w R accept if M halts on w reject if M loops on w M, w R acc simulate U M on w acc rej S accept if M accepts w rej reject if M rejects or loops on w

46 Undecidability of halting HALT TM = { M, w : M is a TM that halts on input w} A TM = { M, w : M is a TM that accepts input w} Suppose that HALT TM is decidable. Let H be a TM that decides HALT TM. Then this TM decides A TM : S := On input M, w, Run R on input M, w. If R rejects, reject. If R accepts, run U on input M, w If U accepts, accept. If U rejects, reject. Impossible, because A TM is undecidable.

47 Reducibility Suppose you think L is undecidable. How do you know for sure? Show: If some TM R decides L then using R, I can build another TM S so that S decides A TM...but this is impossible, because A TM is undecidable.

48 Example 1 AEPS TM = { M : M is a TM that accepts input ε} decidable undecidable Step 1: You gotta believe it To know if M accepts ε, it looks like we have to simulate it But then we might end up in a loop Step 2: Prove it!

49 Example 1: Figuring out the reduction M R accept if M accepts ε reject if not M, w M R S accept if M accepts w reject if not M should be a Turing Machine such that: If M accepts w, then M accepts ε M on input ε = M on input w If M does not accept w, then M does not accept ε

50 Example 1: Implementing the reduction M, w construct M M M should be a Turing Machine such that: M on input ε = M on input w M := On input z, Simulate M on input w If M accepts w, accept Otherwise, reject

51 Example 1: Impementing the reduction M, w construct M M R accept if M accepts w reject if not S := On input M, w : Construct the following TM M : M := On input z, Simulate M on input w and output answer Run R on input M and output its answer.

52 Example 1: Writing it up AEPS TM = { M : M is a TM that accepts input ε} A TM = { M, w : M is a TM that accepts input w} Suppose AEPS TM is decidable and R decides it. Let S := On input M, w where M is a TM and w is a string Construct the following TM M : M := On input z, Simulate M on input w and output answer Run R on input M and output its answer. Then S accepts M, w if and only if M accepts w So S decides A TM, which is impossible.

53 Example 2 SOME TM = { M : M is a TM that accepts some input} decidable undecidable Step 1: You gotta believe it To know if M is in SOME TM, looks like we have to simulate But then we might end up in a loop Step 2: Prove it!

54 Example 2: Setting up the reduction SOME TM = { M : M is a TM that accepts some input} Show: If SOME TM can be decided by some TM R, M R accept if M accepts some input reject if M accepts no inputs... then A TM can be decided by some other TM S M, w S accept if M accepts w reject if not

55 Example 2: Setting up the reduction M, w construct M M R accept if M accepts w reject if not Task Given M, w, construct M so that: If M accepts w, then M accepts some input If M does not accept w, then M accepts no inputs

56 Example 2: Implementing the reduction Task Given M, w, construct M so that: If M accepts w, then M accepts some input If M does not accept w, then M accepts no inputs M := On input z, Simulate M on input w If M accepts, accept Otherwise, reject

57 Example 2: Writing it up SOME TM = { M : M is a TM that accepts some input} A TM = { M, w : M is a TM that accepts input w} Suppose SOME TM is decidable and R decides it. Let S := On input M, w where M is a TM and w is a string Construct the following TM M : M := On input z, Simulate M on input w and output answer Run R on input M and output its answer. Then S accepts M, w if and only if M accepts w So S decides A TM, which is impossible.

58 Example 3 E TM = { M : M is a TM that accepts no input} decidable undecidable Show: If E TM can be decided by some TM R,... then SOME TM can be decided by another TM S SOME TM = { M : M is a TM that accepts some input}

59 Example 3 E TM = { M : M is a TM that accepts no input} SOME TM = { M : M is a TM that accepts some input} Suppose E TM can be decided by some TM R. Consider the following TM S: S := On input M where M is a TM Run R on input M. If R accepts, reject. If R rejects, accept. Then S decides SOME TM, a contradiction.

60 Example 4 EQ TM = { M 1, M 2 : M 1 and M 2 accept the same inputs} decidable undecidable Show: If EQ TM can be decided by some TM R,... then E TM can be decided by another TM S

61 Example 4: Setting up the reduction EQ TM = { M 1, M 2 : M 1 and M 2 accept the same inputs} E TM = { M : M is a TM that accepts no input} Task Idea Given M, construct M 1, M 2 so that: If M accepts no input, then M 1, M 2 accept same inputs If M accepts some input, then M 1, M 2 do not accept same inputs Make M 1 = M Make M 2 accept nothing

62 Example 2: Writing it up EQ TM = { M 1, M 2 : M 1 and M 2 accept the same inputs} E TM = { M : M is a TM that accepts no input} Suppose EQ TM is decidable and R decides it. Let S := On input M where M is a TM Construct the following TM M 2 : M 2 := On input z, reject. Run R on input M, M 2 and output its answer. Then S accepts M if and only if M accepts no input So S decides E TM, which is impossible.

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

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

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

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

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

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

Turing Machines. Fall The Chinese University of Hong Kong. CSCI 3130: Formal languages and automata theory

Turing Machines. Fall The Chinese University of Hong Kong. CSCI 3130: Formal languages and automata theory The Chinese University of Hong Kong Fall 2011 CSCI 3130: Formal languages and automata theory Turing Machines Andrej Bogdanov http://www.cse.cuhk.edu.hk/~andrejb/csc3130 Turing Machines control head a

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

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

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

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

Theory of Computation

Theory of Computation Theory of Computation Lecture #10 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 43 Lecture 10: Overview Linear Bounded Automata Acceptance Problem for LBAs

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

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

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

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

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

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

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

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

Decidability. Human-aware Robotics. 2017/10/31 Chapter 4.1 in Sipser Ø Announcement:

Decidability. Human-aware Robotics. 2017/10/31 Chapter 4.1 in Sipser Ø Announcement: Decidability 2017/10/31 Chapter 4.1 in Sipser Ø Announcement: q q q Slides for this lecture are here: http://www.public.asu.edu/~yzhan442/teaching/cse355/lectures/decidability.pdf Happy Hollaween! Delayed

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

1 Reducability. CSCC63 Worksheet Reducability. For your reference, A T M is defined to be the language { M, w M accepts w}. Theorem 5.

1 Reducability. CSCC63 Worksheet Reducability. For your reference, A T M is defined to be the language { M, w M accepts w}. Theorem 5. CSCC63 Worksheet Reducability For your reference, A T M is defined to be the language { M, w M accepts w}. 1 Reducability Theorem 5.1 HALT TM = { M, w M is a T M that halts on input w} is undecidable.

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

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

Undecidability. We are not so much concerned if you are slow as when you come to a halt. (Chinese Proverb)

Undecidability. We are not so much concerned if you are slow as when you come to a halt. (Chinese Proverb) We are not so much concerned if you are slow as when you come to a halt. (Chinese Proverb) CS /55 Theory of Computation The is A TM = { M,w M is a TM and w L(M)} A TM is Turing-recognizable. Proof Sketch:

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

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

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

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

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

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

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

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

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

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: The TM Acceptance problem, A TM The Halting Problem for TM s Other problems

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

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

Intro to Theory of Computation

Intro to Theory of Computation Intro to Theory of Computation LECTURE 14 Last time Turing Machine Variants Church-Turing Thesis Today Universal TM Decidable languages Designing deciders Sofya Raskhodnikova 3/1/2016 Sofya Raskhodnikova;

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

Decidable Languages - relationship with other classes.

Decidable Languages - relationship with other classes. CSE2001, Fall 2006 1 Last time we saw some examples of decidable languages (or, solvable problems). Today we will start by looking at the relationship between the decidable languages, and the regular and

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

Decidability and Undecidability

Decidability and Undecidability Decidability and Undecidability Major Ideas from Last Time Every TM can be converted into a string representation of itself. The encoding of M is denoted M. The universal Turing machine U TM accepts an

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

Computability Theory

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

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

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

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

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

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

Intro to Theory of Computation

Intro to Theory of Computation Intro to Theory of Computation LECTURE 15 Last time Decidable languages Designing deciders Today Designing deciders Undecidable languages Diagonalization Sofya Raskhodnikova 3/1/2016 Sofya Raskhodnikova;

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

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

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

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

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

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

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

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

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

Turing Machines, diagonalization, the halting problem, reducibility

Turing Machines, diagonalization, the halting problem, reducibility Notes on Computer Theory Last updated: September, 015 Turing Machines, diagonalization, the halting problem, reducibility 1 Turing Machines A Turing machine is a state machine, similar to the ones we have

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

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

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

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

A non-turing-recognizable language

A non-turing-recognizable language CS 360: Introduction to the Theory of Computing John Watrous, University of Waterloo A non-turing-recognizable language 1 OVERVIEW Thus far in the course we have seen many examples of decidable languages

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

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

Pumping Lemma for CFLs

Pumping Lemma for CFLs Pumping Lemma for CFLs v y s Here we go again! Intuition: If L is CF, then some CFG G produces strings in L If some string in L is very long, it will have a very tall parse tree If a parse tree is taller

More information

The Turing machine model of computation

The Turing machine model of computation The Turing machine model of computation For most of the remainder of the course we will study the Turing machine model of computation, named after Alan Turing (1912 1954) who proposed the model in 1936.

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

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

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

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

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

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

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

Announcements. Final exam review session tomorrow in Gates 104 from 2:15PM 4:15PM Final Friday Four Square of the quarter!

Announcements. Final exam review session tomorrow in Gates 104 from 2:15PM 4:15PM Final Friday Four Square of the quarter! The Big Picture Problem Problem Set Set 99 due due in in the the box box up up front. front. Congrats Congrats on on finishing finishing the the last last problem problem set set of of the the quarter!

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

Turing Machines Part II

Turing Machines Part II Turing Machines Part II Problem Set Set Five Five due due in in the the box box up up front front using using a late late day. day. Hello Hello Condensed Slide Slide Readers! Readers! This This lecture

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/ Today's learning goals Sipser Ch 3 Trace the computation of a Turing machine using its transition function and configurations.

More information

Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove

Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove Tuesday 28 of May 2013 Total: 60 points TMV027/DIT321 registration VT13 TMV026/DIT321 registration before VT13 Exam

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

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 14 Ana Bove May 14th 2018 Recap: Context-free Grammars Simplification of grammars: Elimination of ǫ-productions; Elimination of

More information

Turing Machines. Reading Assignment: Sipser Chapter 3.1, 4.2

Turing Machines. Reading Assignment: Sipser Chapter 3.1, 4.2 Reading Assignment: Sipser Chapter 31, 42 Turing Machines 41 covers algorithms for decidable problems about DFA, NFA, RegExp, CFG, and PDAs, eg slides 17 & 18 below I ve talked about most of this in class

More information

Reading Assignment: Sipser Chapter 3.1, 4.2

Reading Assignment: Sipser Chapter 3.1, 4.2 Turing Machines 1 Reading Assignment: Sipser Chapter 3.1, 4.2 4.1 covers algorithms for decidable problems about DFA, NFA, RegExp, CFG, and PDAs, e.g. slides 17 & 18 below. I ve talked about most of this

More information

Announcements. Using a 72-hour extension, due Monday at 11:30AM.

Announcements. Using a 72-hour extension, due Monday at 11:30AM. The Big Picture Announcements Problem Set 9 due right now. Using a 72-hour extension, due Monday at 11:30AM. On-time Problem Set 8's graded, should be returned at the end of lecture. Final exam review

More information

MTH401A Theory of Computation. Lecture 17

MTH401A Theory of Computation. Lecture 17 MTH401A Theory of Computation Lecture 17 Chomsky Normal Form for CFG s Chomsky Normal Form for CFG s For every context free language, L, the language L {ε} has a grammar in which every production looks

More information

Foundations of Informatics: a Bridging Course

Foundations of Informatics: a Bridging Course Foundations of Informatics: a Bridging Course Week 3: Formal Languages and Semantics Thomas Noll Lehrstuhl für Informatik 2 RWTH Aachen University noll@cs.rwth-aachen.de http://www.b-it-center.de/wob/en/view/class211_id948.html

More information

Turing Machines Part Two

Turing Machines Part Two Turing Machines Part Two Recap from Last Time Our First Turing Machine q acc a start q 0 q 1 a This This is is the the Turing Turing machine s machine s finiteisttiteiconntont. finiteisttiteiconntont.

More information

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS 1. [6 POINTS] For language L 1 = {0 n 1 m n, m 1, m n}, which string is in L 1? ANSWER: 0001111 is in L 1 (with n =

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

CSCE 551 Final Exam, April 28, 2016 Answer Key

CSCE 551 Final Exam, April 28, 2016 Answer Key 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

More information

Final exam study sheet for CS3719 Turing machines and decidability.

Final exam study sheet for CS3719 Turing machines and decidability. Final exam study sheet for CS3719 Turing machines and decidability. A Turing machine is a finite automaton with an infinite memory (tape). Formally, a Turing machine is a 6-tuple M = (Q, Σ, Γ, δ, q 0,

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

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

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 10 Nancy Lynch 6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010 Class 10 Nancy Lynch Today Final topic in computability theory: Self-Reference and the Recursion

More information

Automata Theory - Quiz II (Solutions)

Automata Theory - Quiz II (Solutions) Automata Theory - Quiz II (Solutions) K. Subramani LCSEE, West Virginia University, Morgantown, WV {ksmani@csee.wvu.edu} 1 Problems 1. Induction: Let L denote the language of balanced strings over Σ =

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

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

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