From Fundamentele Informatica 1: inleverdatum 1 april 2014, 13:45 uur. A Set A of the Same Size as B or Larger Than B. A itself is not.

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

CSE 460: Computabilty and Formal Languages Turing Machine (TM) S. Pramanik

ACS2: Decidability Decidability

4.2 The Halting Problem

16.1 Countability. CS125 Lecture 16 Fall 2014

A Universal Turing Machine

Lecture Notes: The Halting Problem; Reductions

Computational Models Lecture 8 1

Decidability (What, stuff is unsolvable?)

Intro to Theory of Computation

Computability and Complexity

Chapter 7 Turing Machines

TURING MAHINES

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

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

Computational Models Lecture 8 1

Computational Models Lecture 8 1

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

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

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

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

ECS 120 Lesson 18 Decidable Problems, the Halting Problem

Computability and Complexity

1 Showing Recognizability

1 Computational Problems

Introduction to Turing Machines. Reading: Chapters 8 & 9

CSCI3390-Lecture 6: An Undecidable Problem

Undecidability. Andreas Klappenecker. [based on slides by Prof. Welch]

Notes for Lecture Notes 2

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

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

Decidability: Church-Turing Thesis

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

CS 125 Section #10 (Un)decidability and Probability November 1, 2016

CSE 105 THEORY OF COMPUTATION

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

Turing Machine Recap

A non-turing-recognizable language

Lecture 12: Mapping Reductions

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

Computable Functions

Theory of Computation

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

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

6.8 The Post Correspondence Problem

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

Midterm II : Formal Languages, Automata, and Computability

Non-emptiness Testing for TMs

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

Turing Machines Part III

Opleiding Informatica

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

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine

Theory of Computation

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

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

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

CS6901: review of Theory of Computation and Algorithms

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

Computability Theory

Theory of Computation

1 Acceptance, Rejection, and I/O for Turing Machines

Part I: Definitions and Properties

Undecidable Problems and Reducibility

CS3719 Theory of Computation and Algorithms

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

Limits of Computability

BBM402-Lecture 11: The Class NP

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

CS Lecture 28 P, NP, and NP-Completeness. Fall 2008

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY

Countable and uncountable sets. Matrices.

The Unsolvability of the Halting Problem. Chapter 19

Lecture 16: Time Complexity and P vs NP

The Post Correspondence Problem

Equivalent Variations of Turing Machines

Turing machine recap. Universal Turing Machines and Undecidability. Alphabet size doesn t matter. Robustness of TM

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

THEORY OF COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Automata Theory CS S-FR2 Final Review

DM17. Beregnelighed. Jacob Aae Mikkelsen

Warm-Up Problem. Please fill out your Teaching Evaluation Survey! Please comment on the warm-up problems if you haven t filled in your survey yet.

CPSC 421: Tutorial #1

Definition: Let S and T be sets. A binary relation on SxT is any subset of SxT. A binary relation on S is any subset of SxS.

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

Solution to CS375 Homework Assignment 11 (40 points) Due date: 4/26/2017

Solutions to Old Final Exams (For Fall 2007)

CS 311 Sample Final Examination

Countable and uncountable sets. Matrices.

Functions on languages:

The Pumping Lemma. for all n 0, u 1 v n u 2 L (i.e. u 1 u 2 L, u 1 vu 2 L [but we knew that anyway], u 1 vvu 2 L, u 1 vvvu 2 L, etc.

Introduction to Turing Machines

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

MA/CSSE 474 Theory of Computation

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES

CP405 Theory of Computation

1 The decision problem for First order logic

Turing machines and linear bounded automata

SCHEME FOR INTERNAL ASSESSMENT TEST 3

Transcription:

Fundamentele Informatica 3 voorjaar 2014 http://www.liacs.nl/home/rvvliet/fi3/ Rudy van Vliet kamer 124 Snellius, tel. 071-527 5777 rvvliet(at)liacs(dot)nl college 8, 31 maart 2014 8. Recursively Enumerable Languages 8.5. Not Every Language is Recursively Enumerable 9. Undecidable Problems 9.1. A Language That Can t Be Accepted, and a Problem That Can t Be Decided 1 Huiswerkopgave 2, inleverdatum 1 april 2014, 13:45 uur 2 A slide from lecture 7 Chomsky hierarchy 3 reg. languages reg. grammar FA reg. expression 2 cf. languages cf. grammar PDA 1 cs. languages cs. grammar LBA 0 re. languages unrestr. grammar TM 8.5. Not Every Language is Recursively Enumerable S 3 S 2 S 1 R S 0 (modulo Λ) 3 4 From Fundamentele Informatica 1: From Fundamentele Informatica 1: Definition 8.23. A Set A of the Same Size as B or Larger Than B Definition 8.24. Countably Infinite and Countable Sets Two sets A and B, either finite or infinite, are the same size if there is a bijection f : A B. A is larger than B if some subset of A is the same size as B but A itself is not. A set A is countably infinite (the same size as N) if there is a bijection f : N A, or a list a 0,a 1,... of elements of A such that every element of A appears exactly once in the list. A is countable if A is either finite or countably infinite. 5 6 Example 8.26. The Set N N is Countable Theorem 8.25. Every infinite set has a countably infinite subset, and every subset of a countable set is countable. (proof of second claim is Exercise 8.35...) N N = {(i,j) i,j N} although N N looks much bigger than N (0,0) (0,1) (0,2) (0,3)... (1,0) (1,1) (1,2) (1,3)... (2,0) (2,1) (2,2) (2,3)... (3,0) (3,1) (3,2) (3,3)...... 7 8

Example 8.28. A Countable Union of Countable Sets Is Countable S = S i i=0 Same construction as in Example 8.26, but... 9 Example 8.29. Languages Are Countable Sets Two ways to list Σ L Σ = Σ i i=0 10 Assumptions: 1. Names of the states are irrelevant. 2. Tape alphabet Γ of every Turing machine T is subset of infinite set S = {a 1,a 2,a 3,...}, where a 1 =. 11 12 Definition 7.33. An Encoding Function Assign numbers to each state: n(h a) = 1, n(h r) = 2, n(q 0 ) = 3, n(q) 4 for other q Q. Assign numbers to each tape symbol: n(a i ) = i. Assign numbers to each tape head direction: n(r) = 1, n(l) = 2, n(s) = 3. Definition 7.33. An Encoding Function (continued) For each move m of T of the form δ(p,σ) = (q,τ,d) e(m) = 1 n(p) 01 n(σ) 01 n(q) 01 n(τ) 01 n(d) 0 We list the moves of T in some order as m 1,m 2,...,m k, and we define e(t) = e(m 1 )0e(m 2 )0...0e(m k )0 If z = z 1 z 2...z j is a string, where each z i S, e(z) = 01 n(z 1) 01 n(z 2) 0...01 n(z j) 0 13 14 Example 8.30. The Set of Turing Machines Is Countable Exercise 8.41. Let T (Σ) be set of Turing machines with input alphabet Σ There is injective function e : T (Σ) {0,1} (e is encoding function) Hence (...), set of recursively enumerable languages is countable For each case below, determine whether the given set is countable or uncountable. Prove your answer. a. The set of all three-element subsets of N. b. The set of all finite subsets of N. 15 16

Example 8.31. The Set 2 N Is Uncountable Hence, because N and {0,1} are the same size, there are uncountably many languages over {0, 1} 17 No list of subsets of N is complete, i.e., every list A 0,A 1,A 2,... of subsets of N leaves out at least one. Take 18 A 0 = {0,2,5,9,...} A 1 = {1,2,3,8,12,...} A 2 = {0,3,6} A 3 = A 4 = {4} A 5 = {2,3,5,7,11,...} A 6 = {8,16,24,...} A 7 = N A 8 = {1,3,5,7,9,...} A 9 = {n N n > 12}... 19 20 A = {2,3,6,8,9,...} 0 0 1 1 0 0 1 0 1 1... Theorem 8.32. Not all languages are recursively enumerable. In fact, the set of languages over {0,1} that are not recursively enumerable is uncountable. (including Exercise 8.38) Hence, there are uncountably many subsets of N. 21 22 Exercise 8.38. Show that is S is uncountable and T is countable, then S T is uncountable. Suggestion: proof by contradiction. Theorem 8.25. Every infinite set has a countably infinite subset, and every subset of a countable set is countable. (proof of second claim is Exercise 8.35...) 23 24

9. Undecidable Problems 9.1. A Language That Can t Be Accepted, and a Problem That Can t Be Decided 25 A slide from lecture 5: Definition 8.1. Accepting a Language and Deciding a Language A Turing machine T with input alphabet Σ accepts a language L Σ, if L(T) = L. T decides L, if T computes the characteristic function χ L : Σ {0,1} A language L is recursively enumerable, if there is a TM that accepts L, and L is recursive, if there is a TM that decides L. 26 Example 8.31. The Set 2 N Is Uncountable Hence, because N and {0,1} are the same size, there are uncountably many languages over {0, 1} No list of subsets of N is complete, i.e., every list A 0,A 1,A 2,... of subsets of N leaves out at least one. Take 27 28 A 0 = {0,2,5,9,...} A 1 = {1,2,3,8,12,...} A 2 = {0,3,6} A 3 = A 4 = {4} A 5 = {2,3,5,7,11,...} A 6 = {8,16,24,...} A 7 = N A 8 = {1,3,5,7,9,...} A 9 = {n N n > 12}... 29 30 A = {2,3,6,8,9,...} 0 0 1 1 0 0 1 0 1 1... Hence, there are uncountably many subsets of N. Set-up of Example 8.31: 1. Start with list of all subsets of N: A 0,A 1,A 2,..., each one associated with specific element of N (namely i) 2. Define another subset A by: i A i / A i 3. Conclusion: for all i, A A i Hence, contradiction Hence, there are uncountably many subsets of N 31 32

Set-up of constructing language that is not RE: 1. Start with list of all RE languages over {0,1} (which are subsets of {0,1} ): L(T 0 ),L(T 1 ),L(T 2 ),... 2. Define another language L by: x L x / (language that x is associated with) 3. Conclusion: for all i, L L(T i ) Hence, L is not RE 33 e(t 0 ) e(t 1 ) e(t 2 ) e(t 3 ) e(t 4 ) e(t 5 ) e(t 6 ) e(t 7 ) e(t 8 ) e(t 9 ). L(T 0 ) 1 0 1 0 0 1 0 0 0 1. L(T 1 ) 0 1 1 1 0 0 0 0 1 0. L(T 2 ) 1 0 0 1 0 0 1 0 0 0. L(T 3 ) 0 0 0 0 0 0 0 0 0 0. L(T 4 ) 0 0 0 0 1 0 0 0 0 0. L(T 5 ) 0 0 1 1 0 1 0 1 0 0. L(T 6 ) 0 0 0 0 0 0 0 0 1 0. L(T 7 ) 1 1 1 1 1 1 1 1 1 1. L(T 8 ) 0 1 0 1 0 1 0 1 0 1. L(T 9 ) 0 0 0 0 0 0 0 0 0 0. 34 e(t 0 ) e(t 1 ) e(t 2 ) e(t 3 ) e(t 4 ) e(t 5 ) e(t 6 ) e(t 7 ) e(t 8 ) e(t 9 ). L(T 0 ) 1 0 1 0 0 1 0 0 0 1. L(T 1 ) 0 1 1 1 0 0 0 0 1 0. L(T 2 ) 1 0 0 1 0 0 1 0 0 0. L(T 3 ) 0 0 0 0 0 0 0 0 0 0. L(T 4 ) 0 0 0 0 1 0 0 0 0 0. L(T 5 ) 0 0 1 1 0 1 0 1 0 0. L(T 6 ) 0 0 0 0 0 0 0 0 1 0. L(T 7 ) 1 1 1 1 1 1 1 1 1 1. L(T 8 ) 0 1 0 1 0 1 0 1 0 1. L(T 9 ) 0 0 0 0 0 0 0 0 0 0. NSA 0 0 1 1 0 0 1 0 1 1. : Hence, NSA is not recursively enumerable. 35 36 Set-up of constructing language NSA that is not RE: Set-up of constructing language NSA that is not RE: 1. Start with list of all RE languages over {0,1} (which are subsets of {0,1} ): L(T 0 ),L(T 1 ),L(T 2 ),... (namely e(t i )) 1. Start with collection of all RE languages over {0,1} (which are subsets of {0,1} ): {L(T) TM T} (namely e(t)) 2. Define another language NSA by: e(t i ) NSA e(t i ) / L(T i ) 2. Define another language NSA by: e(t) NSA e(t) / L(T) 3. Conclusion: for all i, NSA L(T i ) Hence, NSA is not RE 3. Conclusion: for all TM T, NSA L(T) Hence, NSA is not RE 37 38 Set-up of constructing language L that is not RE: 1. Start with list of all RE languages over {0,1} (which are subsets of {0,1} ): L(T 0 ),L(T 1 ),L(T 2 ),... (namely x i ) 2. Define another language L by: x i L x i / L(T i ) 3. Conclusion: for all i, L L(T i ) Hence, L is not RE Every infinite list x 0,x 1,x 2,... of different elements of {0,1} yields language L that is not RE 39 Definition 9.1. The Languages NSA and SA Let NSA = {e(t) T is a TM, and e(t) / L(T)} SA = {e(t) T is a TM, and e(t) L(T)} (NSA and SA are for non-self-accepting and self-accepting. ) 40

: 41 Theorem 9.2. The language NSA is not recursively enumerable. The language SA is recursively enumerable but not recursive. 42 Decision problem: problem for which the answer is yes or no : Exercise 9.2. Given..., is it true that...? Describe how a universal Turing machine could be used in the proof that SA is recursively enumerable. yes-instances of a decision problem: instances for which the answer is yes no-instances of a decision problem: instances for which the answer is no 43 44 Decision problems Given an undirected graph G = (V,E), does G contain a Hamiltonian path? Given a list of integers x 1,x 2,...,x n, is the list sorted? Self-Accepting: Given a TM T, does T accept the string e(t)? Three languages corresponding to this problem: 1. SA: strings representing yes-instances 2. NSA: strings representing no-instances 3.... 45 46 Self-Accepting: Given a TM T, does T accept the string e(t)? Three languages corresponding to this problem: 1. SA: strings representing yes-instances 2. NSA: strings representing no-instances 3. E : strings not representing instances For general decision problem P, an encoding e of instances I as strings e(i) over alphabet Σ is called reasonable, if 1. there is algorithm to decide if string over Σ is encoding e(i) 2. e is injective 3. string e(i) can be decoded 47 48

: 49 For general decision problem P and reasonable encoding e, Y(P) = {e(i) I is yes-instance of P} N(P) = {e(i) I is no-instance of P} E(P) = Y(P) N(P) E(P) must be recursive 50