Formal Languages, Automata and Models of Computation

Slides:



Advertisements
Similar presentations
By John E. Hopcroft, Rajeev Motwani and Jeffrey D. Ullman
Advertisements

Fall 2006Costas Busch - RPI1 A Universal Turing Machine.
Fall 2006Costas Busch - RPI1 Decidable Languages.
Introduction to Computability Theory
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.
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.
Fall 2003Costas Busch - RPI1 Decidability. Fall 2003Costas Busch - RPI2 Recall: A language is decidable (recursive), if there is a Turing machine (decider)
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Recursively Enumerable and Recursive Languages
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.
CHAPTER 4 Decidability Contents Decidable Languages
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive 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.
Fall 2006Costas Busch - RPI1 Undecidable Problems (unsolvable problems)
Prof. Busch - LSU1 Undecidable Problems (unsolvable problems)
1 Introduction to Computability Theory Lecture11: The Halting Problem Prof. Amos Israeli.
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
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.
Basic Structures: Sets, Functions, Sequences, and Sums CSC-2259 Discrete Structures Konstantin Busch - LSU1.
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
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability Some slides are in courtesy.
Lecture 24UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
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.
Chapters 11 and 12 Decision Problems and Undecidability.
The Acceptance Problem for TMs
A Universal Turing Machine
CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets
Recursively Enumerable and Recursive Languages
Standard Representations of Regular Languages
This statement is false.
Busch Complexity Lectures: Reductions
Linear Bounded Automata LBAs
Undecidable Problems Costas Busch - LSU.
Lecture12 The Halting Problem
CSCI 2670 Introduction to Theory of Computing
Reductions Costas Busch - LSU.
BCS 2143 Theory of Computer Science
LIMITS OF ALGORITHMIC COMPUTATION
Turing Machines Acceptors; Enumerators
COSC 3340: Introduction to Theory of Computation
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Turing acceptable languages and Enumerators
Andreas Klappenecker [based on slides by Prof. Welch]
CSCE 411 Design and Analysis of Algorithms
Decidable Languages Costas Busch - LSU.
Elementary Questions about Regular Languages
Turing acceptable languages and Enumerators
Undecidable problems:
CS21 Decidability and Tractability
Recall last lecture and Nondeterministic TMs
CS21 Decidability and Tractability
Instructor: Aaron Roth
Turing Machines Everything is an Integer
MA/CSSE 474 Theory of Computation
Presentation transcript:

Formal Languages, Automata and Models of Computation CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012 1

Countable Sets Based on course materials by Prof. Costas Busch

Infinite sets are either: Countable Uncountable

Countable set: There is a one to one correspondence between elements of the set and positive integers

Example: The set of even integers is countable Even integers: Correspondence: Positive integers: corresponds to

Example: The set of rational numbers is countable Rational numbers:

Naive Approach Rational numbers: Correspondence: Positive integers: Doesn’t work: we will never count numbers with nominator 2

Better Approach

Rational Numbers: Correspondence: Positive Integers:

We proved: the set of rational numbers is countable by giving an enumeration procedure

Definition Let be a set of strings An enumeration procedure for is a Turing machine that generates any string of in finite number of steps.

strings Enumeration Machine for output Finite time:

Enumeration Machine Configuration Time 0 Time

Time Time

A set is countable if there is an enumeration procedure for it

Example: The set of all strings is countable. We will describe the enumeration procedure.

Naive procedure: Produce the strings in lexicographic order: Doesn’t work! Strings starting with will never be produced.

Better procedure: Proper Order Produce all strings of length 1 Produce all strings of length 2 ..........

Produce strings: Length 1 Length 2 Proper Order Length 3

Theorem: The set of all Turing Machines is countable. Proof: Any Turing machine is a finite string Encoded with a sequence of 0’s and 1’s. Find an enumeration procedure for the set of Turing Machine strings.

Enumeration Procedure: Repeat 1. Generate the next string of 0’s and 1’s in proper order 2. Check if the string defines a Turing Machine if YES: print string on output if NO: ignore string

Uncountable Sets

Definition: A set is uncountable if it is not countable

Let be an infinite countable set. The powerset of is uncountable. Theorem: Let be an infinite countable set. The powerset of is uncountable. The power set of natural numbers has the same cardinality as the set of real numbers. (Using the Cantor–Bernstein–Schröder theorem, it is easy to prove that there exists a bijection between the set of reals and the power set of the natural numbers).

Proof: Since is countable, we can write Element of

Elements of the powerset have the form:

We encode each element of the power set with a string of 0’s and 1’s * Encoding Powerset element *Cantor’s diagonal argument

Let’s assume the contrary, that the powerset is countable. We can enumerate the elements of the powerset.

Powerset element Encoding

Take the powerset element whose bits are the complements of the diagonal.

New element: (Diagonal complement)

The new element must be some This is impossible: The i-th bit must be the complement of itself.

We have contradiction! Therefore the powerset is uncountable.

Theorem: Let be an infinite countable set. The powerset of is uncountable.

Application: Languages Alphabet: Set of Strings: infinite and countable Powerset: all languages uncountable

Languages: uncountable Turing machines: countable There are infinitely many more languages than Turing machines!

There are some languages not accepted by Turing Machines. These languages cannot be described by algorithms.

Recursively Enumerable Languages and Recursive Languages

Definition: A language is recursively enumerable if some Turing machine accepts it.

Let be a recursively enumerable language and be the Turing Machine that accepts it. For a string : if then halts in a final state if then halts in some state or loops forever

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

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

We will prove: 1. There is a specific language which is not recursively enumerable. 2. There is a specific language which is recursively enumerable but not recursive.

Non Recursively Enumerable

First we prove: If a language is recursive then there is an enumeration procedure for it. A language is recursively enumerable if and only if there is an enumeration procedure for it.

Theorem: if a language is recursive then there is an enumeration procedure for it.

Proof: Enumeration Machine Enumerates all strings of input alphabet Accepts

Enumeration procedure Repeat: generates a string checks if YES: print to output NO: ignore End of proof

Theorem: if language is recursively enumerable then there is an enumeration procedure for it.

Proof: Enumeration Machine Enumerates all strings of input alphabet Accepts

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

BETTER APPROACH generates first string executes first step on generates second string executes first step on second step on

Generates third string executes first step on second step on third step on And so on............

Move 1 2 3

If for string machine halts in a final state then it prints on the output. End of proof

Theorem: If for language there is an enumeration procedure then is recursively enumerable.

Proof: Input Tape Machine that accepts Enumerator for Compare

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

Question: This is not a membership algorithm. Why? Answer: The enumeration procedure may not produce strings in proper order

We have shown: A language is recursively enumerable if and only if there is an enumeration procedure for it.

A Language which is not Recursively Enumerable

We search for a language that is not Recursively Enumerable. This language is not accepted by any Turing Machine.

Consider alphabet Strings:

Consider Turing Machines that accept languages over alphabet They are countable:

Example language accepted by Alternative representation

Consider the language consists of the 1’s on the diagonal

Consider the language consists from of 0’s on the diagonal

Theorem: Language is not recursively enumerable.

Proof: Assume on the contrary that is recursively enumerable There must exist some machine that accepts

Question:

Answer:

Question:

Answer:

Question:

Answer:

Similarly: for any Because either: or

Therefore the machine cannot exist CONTRADICTION!!! The language is not recursively enumerable. End of proof

Observation: There is no algorithm that describes (otherwise it would be accepted by a Turing Machine)

A Language which is Recursively Enumerable and not Recursive

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 necessarily halt on any input

We will prove that the language Is recursively enumerable but not recursive.

Theorem: The language is recursively enumerable

Proof: We will give a Turing Machine that accepts

Turing Machine that accepts For any input string Write Find Turing machine (using the enumeration procedure for Turing Machines) Simulate on input If accepts, then accept End of proof

Observation: Recursively enumerable Not recursively enumerable (Thus, not recursive)

Theorem: The language is not recursive.

Proof: Assume on the contrary that is recursive. Then is recursive: Take the Turing Machine that accepts halts on any input If accepts then reject If rejects then accept

Therefore: recursive But we know: not recursively enumerable thus, not recursive CONTRADICTION! Therefore, is not recursive End of proof

Non Recursively Enumerable