Recursively Enumerable and Recursive Languages

Slides:



Advertisements
Similar presentations
Fall 2006Costas Busch - RPI1 A Universal Turing Machine.
Advertisements

Linear Bounded Automata LBAs
Fall 2006Costas Busch - RPI1 Decidable Languages.
CS 461 – Nov. 9 Chomsky hierarchy of language classes –Review –Let’s find a language outside the TM world! –Hints: languages and TM are countable, but.
More Turing Machines Sipser 3.2 (pages ). CS 311 Fall Multitape Turing Machines Formally, we need only change the transition function to.
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
Courtesy Costas Busch - RPI1 More Applications of the Pumping Lemma.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata are like Turing Machines with a restriction: The working space of the tape is the space of the.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
Costas Busch - RPI1 Undecidable problems for Recursively enumerable languages continued…
Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Rules have form String of variables and terminals String of variables and terminals.
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
Fall 2004COMP 3351 The Chomsky Hierarchy. Fall 2004COMP 3352 Non-recursively enumerable Recursively-enumerable Recursive Context-sensitive Context-free.
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
Linear Bounded Automata LBAs
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.
Costas Busch - RPI1 Turing Machines. Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
Courtesy Costas Busch - RPI1 Reducibility. Courtesy Costas Busch - RPI2 Problem is reduced to problem If we can solve problem then we can solve problem.
Costas Busch - LSU1 Non-Deterministic Finite Automata.
Fall 2006Costas Busch - RPI1 Undecidable Problems (unsolvable problems)
Prof. Busch - LSU1 Undecidable Problems (unsolvable problems)
Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
The Halting Problem – Undecidable Languages Lecture 31 Section 4.2 Wed, Oct 31, 2007.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
A Universal Turing Machine
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Recursively Enumerable and Recursive Languages
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
1 The Chomsky Hierarchy. 2 Unrestricted Grammars: Productions String of variables and terminals String of variables and terminals.
Costas Busch - RPI1 Decidability. Costas Busch - RPI2 Consider problems with answer YES or NO Examples: Does Machine have three states ? Is string a binary.
Costas Busch - RPI1 Decidability. Costas Busch - RPI2 Another famous undecidable problem: The halting problem.
1 Recursively Enumerable and Recursive Languages.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Decidability.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
Fall 2006Costas Busch - RPI1 RE languages and Enumerators.
A Universal Turing Machine
Recursively Enumerable Languages
Recursively Enumerable and Recursive Languages
Busch Complexity Lectures: Turing Machines
Busch Complexity Lectures: Reductions
Linear Bounded Automata LBAs
Undecidable Problems Costas Busch - LSU.
Reductions Costas Busch - LSU.
Turing’s Thesis Costas Busch - RPI.
Turing Machines Acceptors; Enumerators
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Undecidable Problems (unsolvable problems)
Turing acceptable languages and Enumerators
Non-Deterministic Finite Automata
Decidable Languages Costas Busch - LSU.
Decidability and Undecidability
A Universal Turing Machine
Elementary Questions about Regular Languages
Turing acceptable languages and Enumerators
Undecidable problems:
Formal Languages, Automata and Models of Computation
Decidability continued….
Formal Definitions for Turing Machines
Presentation transcript:

Recursively Enumerable and Recursive Languages Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Definition: A language is recursively enumerable if some Turing machine accepts it Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Let be a recursively enumerable language and the Turing Machine that accepts it For string : if then halts in a final state if then halts in a non-final state or loops forever Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Definition: A language is recursive if some Turing machine accepts it and halts on any input string In other words: A language is recursive if there is a membership algorithm for it Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Let be a recursive language and the Turing Machine that accepts it For string : if then halts in a final state if then halts in a non-final state Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI We will prove: 1. There is a specific language which is not recursively enumerable (not accepted by any Turing Machine) 2. There is a specific language which is recursively enumerable but not recursive Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Non Recursively Enumerable Recursively Enumerable Recursive Courtesy Costas Busch - RPI

A Language which is not Recursively Enumerable Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI We want to find a language that is not Recursively Enumerable This language is not accepted by any Turing Machine Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Consider alphabet Strings: Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Consider Turing Machines that accept languages over alphabet They are countable: Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Example language accepted by Alternative representation Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Consider the language consists from the 1’s in the diagonal Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Consider the language consists of the 0’s in the diagonal Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Theorem: Language is not recursively enumerable Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Proof: Assume for contradiction that is recursively enumerable There must exist some machine that accepts Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Question: Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Answer: Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Question: Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Answer: Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Question: Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Answer: Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Similarly: for any Because either: or Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Therefore, the machine cannot exist Therefore, the language is not recursively enumerable End of Proof Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Observation: There is no algorithm that describes (otherwise would be accepted by some Turing Machine) Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Non Recursively Enumerable Recursively Enumerable Recursive Courtesy Costas Busch - RPI

A Language which is Recursively Enumerable and not Recursive Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI We want to find a language which Is recursively enumerable But not recursive There is a Turing Machine that accepts the language The machine doesn’t halt on some input Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI We will prove that the language Is recursively enumerable but not recursive Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Theorem: The language is recursively enumerable Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Proof: We will give a Turing Machine that accepts Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Turing Machine that accepts For any input string Compute , for which Find Turing machine (using an enumeration procedure for Turing Machines) Simulate on input If accepts, then accept End of Proof Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Observation: Recursively enumerable Not recursively enumerable (Thus, also not recursive) Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Theorem: The language is not recursive Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Proof: Assume for contradiction that is recursive Then is recursive: Take the Turing Machine that accepts halts on any input: If accepts then reject If rejects then accept Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Therefore: is recursive But we know: is not recursively enumerable thus, not recursive CONTRADICTION!!!! Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Therefore, is not recursive End of Proof Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Non Recursively Enumerable Recursively Enumerable Recursive Courtesy Costas Busch - RPI

Turing acceptable languages and Enumeration Procedures Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI We will prove: (weak result) If a language is recursive then there is an enumeration procedure for it (strong result) A language is recursively enumerable if and only if there is an enumeration procedure for it Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Theorem: if a language is recursive then there is an enumeration procedure for it Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Proof: Enumeration Machine Enumerates all strings of input alphabet Accepts Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI If the alphabet is then can enumerate strings as follows: Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Enumeration procedure Repeat: generates a string checks if YES: print to output NO: ignore End of Proof Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Example: Enumeration Output Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Theorem: if language is recursively enumerable then there is an enumeration procedure for it Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Proof: Enumeration Machine Enumerates all strings of input alphabet Accepts Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI If the alphabet is then can enumerate strings as follows: Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI NAIVE APPROACH Enumeration procedure Repeat: generates a string checks if YES: print to output NO: ignore Problem: If machine may loop forever Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI BETTER APPROACH Generates first string executes first step on Generates second string executes first step on second step on Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Generates third string executes first step on second step on third step on And so on............ Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI 1 1 1 1 Step in string 2 2 2 2 3 3 3 3 Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI If for any string machine halts in a final state then it prints on the output End of Proof Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Theorem: If for language there is an enumeration procedure then is recursively enumerable Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Proof: Input Tape Machine that accepts Enumerator for Compare Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI Turing machine that accepts For input string Repeat: Using the enumerator, generate the next string of Compare generated string with If same, accept and exit loop End of Proof Courtesy Costas Busch - RPI

Courtesy Costas Busch - RPI We have proven: A language is recursively enumerable if and only if there is an enumeration procedure for it Courtesy Costas Busch - RPI