Languages associated with Turing machines

Similar documents
The Halting Problem is Undecidable

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

Chapter 7 Uncomputability

Lecture 2: Universality

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

Introduction to Automata Theory. Reading: Chapter 1

CS 3719 (Theory of Computation and Algorithms) Lecture 4

3515ICT Theory of Computation Turing Machines

Computational Models Lecture 8, Spring 2009

Turing Machines: An Introduction

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP

Automata and Computability. Solutions to Exercises

1 Definition of a Turing machine

Cardinality. The set of all finite strings over the alphabet of lowercase letters is countable. The set of real numbers R is an uncountable set.

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Properties of Stabilizing Computations

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology

CAs and Turing Machines. The Basis for Universal Computation

THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.

Introduction to Turing Machines

Regular Languages and Finite State Machines

How To Compare A Markov Algorithm To A Turing Machine

Deterministic Finite Automata

Notes on Complexity Theory Last updated: August, Lecture 1

Computability Theory

Automata and Formal Languages

Reading 13 : Finite State Automata and Regular Expressions

1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification)

24 Uses of Turing Machines

Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, School of Informatics University of Edinburgh als@inf.ed.ac.

Course Manual Automata & Complexity 2015

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

Omega Automata: Minimization and Learning 1

6.080/6.089 GITCS Feb 12, Lecture 3

Regular Languages and Finite Automata

The Classes P and NP

Theory of Computation Chapter 2: Turing Machines

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

How To Understand The Theory Of Computer Science

Introduction to Theory of Computation

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

Diagonalization. Ahto Buldas. Lecture 3 of Complexity Theory October 8, Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach.

C H A P T E R Regular Expressions regular expression

THE BANACH CONTRACTION PRINCIPLE. Contents

Composability of Infinite-State Activity Automata*

Automata on Infinite Words and Trees

Two-dimensional Languages

An algorithmic classification of open surfaces

Turing Machines, Part I

INTRODUCTORY SET THEORY

CS103B Handout 17 Winter 2007 February 26, 2007 Languages and Regular Expressions

So let us begin our quest to find the holy grail of real analysis.

4.6 The Primitive Recursive Functions

Lecture summary for Theory of Computation

Regular Expressions and Automata using Haskell

Fundamentele Informatica II

Learning Analysis by Reduction from Positive Data

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

Models of Sequential Computation

THEORY of COMPUTATION

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

Handout #1: Mathematical Reasoning

An example of a computable

CS5236 Advanced Automata Theory

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

Matrix Algebra. Some Basic Matrix Laws. Before reading the text or the following notes glance at the following list of basic matrix algebra laws.

Proseminar on Semantic Theory Fall 2013 Ling 720. Problem Set on the Formal Preliminaries : Answers and Notes

CS 301 Course Information

Informatique Fondamentale IMA S8

Finite Automata. Reading: Chapter 2

CMPSCI 250: Introduction to Computation. Lecture #19: Regular Expressions and Their Languages David Mix Barrington 11 April 2013

1. Prove that the empty set is a subset of every set.

Overview of E0222: Automata and Computability

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

NP-Completeness and Cook s Theorem

8 Divisibility and prime numbers

Notes on Complexity Theory Last updated: August, Lecture 1

Universality in the theory of algorithms and computer science

MATH10040 Chapter 2: Prime and relatively prime numbers

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

Follow links for Class Use and other Permissions. For more information send to:

Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm

Formal Grammars and Languages

On Recognizable Timed Languages FOSSACS 2004

Degrees that are not degrees of categoricity

Solving Linear Systems, Continued and The Inverse of a Matrix

Pushdown Automata. International PhD School in Formal Languages and Applications Rovira i Virgili University Tarragona, Spain

T Reactive Systems: Introduction and Finite State Automata

NUMBER SYSTEMS. William Stallings

3. Mathematical Induction

Theoretical Computer Science (Bridging Course) Complexity

Set Theory Basic Concepts and Definitions

Local periods and binary partial words: An algorithm

CHAPTER 7 GENERAL PROOF SYSTEMS

Computability Classes for Enforcement Mechanisms*

INCIDENCE-BETWEENNESS GEOMETRY

Factoring & Primality

On the Structure of Turing Universe: The Non-Linear Ordering of Turing Degrees

Transcription:

Languages associated with Turing machines What are the languages associated with Turing machines? The non-trivial question is whether there are any languages that are not accepted by some Turing machine. What is the grammar formalism associated with Turing machines? We will define the concepts of recognizability and decidability. We will define the concept of enumerability and recall the concept of computability.

Languages associated with Turing machines Languages for which there exists an accepting Turing machine: If the string is in the language, then the TM halts in a final state; If the string is not in the language, then the TM may halt in a non-final state or never halt. We say that a TM recognizes (or accepts) L if it halts in a final state iff its input is a word in L. Languages for which there exists a membership algorithm: If the string is in the language, then the TM halts in a final state If the string is not in the language, then the TM halts. We say that a TM decides L if it halts in a final state whenever its input is a word in L and halts in a non-final state for all other inputs.

Turing machine as recognizers (or acceptors) Definition Let Σ be an alphabet and L a language over Σ. Let M A = (Q, Σ, Γ, δ,, q 0, F ) be a Turing machine. We say that M A recognizes (or accepts) L if for every w L there is a q f F and u, v Γ with q 0 w uq f v.

Turing machine as deciders Definition Let Σ be an alphabet and L a language over Σ. Let M D = (Q, Σ, Γ, δ,, q 0, F ) be a Turing machine. We say that M D decides L if for every w Σ there is a q Q and u, v Γ with q 0 w uqv. Furthermore, q F, iff w L. We also say that M D is a membership algorithm for L.

Recursively enumerable languages Definition A language L is said to be recursively enumerable if there exists a Turing machine that recognizes (or accepts) it. This definition implies only that there exists a Turing machine M, such that, for every w L, with q f a final state. q 0 w x 1 q f x 2, This definition says nothing about what happens for w not in L; it may be that the machine halts in a nonfinal state or that it never halts and goes into an infinite loop. The family of all recursively enumerable languages is denoted by RE.

Recursive languages Definition A language L on Σ is said to be recursive if there exists a Turing machine M that recognizes (or accepts) L and halts on every w Σ +. In other words, a language is recursive if and only if there exists a membership algorithm for it. In yet other words, a language L is recursive if there is a TM that decides L. The family of all recursive languages is denoted by REC.

Recursive and recursively enumerable languages Theorem The family of recursive languages is a proper subset of the family of recursively enumerable languages. One way of exhibiting the relationships between language families is (our preliminary) Chomsky hierarchy.

The concept of enumerability and enumeration procedure For infinite sets we distinguish between countable and uncountable. A set is said to be countable if its elements can be put into a one-to-one correspondence with the positive integers. By this we mean that the elements of the set can be written in some order, say x 1, x 2, x 3,... so that every element of the set has some finite index. Example: The set of all even integers can be written in the order 0, 2, 4,... Since any positive integer 2n occurs in position n + 1, the set is countable.

Enumeration procedure We can prove that a set is countable if we can produce a method by which its elements can be written in some sequence. Such a method is called an enumeration procedure. Since an enumeration procedure is some kind of mechanical process, we can use a Turing machine model to define it formally.

Enumeration procedure Definition Let S be a set of strings on some alphabet Σ. Then an enumeration procedure for S is a Turing machine that can carry out the sequence of steps q 0 q s x 1 #s 1 qs x 2 #s 2... with x i Γ \ {#}, s i S, in such a way that any s in S is produced in a finite number of steps. The set q s is a state signifying membership in S, that is, whenever q s is entered, the string following # must be in S.

Enumeration procedure Any set for which an enumeration procedure exists is countable because the enumeration gives the required sequence. Strictly speaking, an enumeration procedure cannot be called an algorithm since it will not terminate when S is infinite. Example: Let Σ = {a, b, c}. We can show that S = Σ + is countable if we can find an enumeration procedure that produces its elements in some order. We use the lexicographic order. We take the length of the string as the first criterion, followed by an alphabetic ordering of all equal-length strings. This is an enumeration procedure that gives the sequence a, b, c, aa, ab, ac, ba, bb, bc, ca, cb, cc, aaa, aba,... We call it the proper order.

Enumeration procedure Theorem The set of all Turing machines, although infinite, is countable. We can encode each Turing machine using 0 and 1. We then construct the following enumeration procedure: 1. Generate the next string in {0, 1} + in proper order. 2. Check the generated string to see if it defines a Turing machine. If so, write it on the tape. If not, ignore the string. 3. Return to step 1.

RE and enumeration Theorem If a language L is recursively enumerable, then there is an enumeration procedure for L.

Georg Cantor Cantor was a German mathematician (1845 1918) at University of Halle. He is best know as the inventor of set theory. Cantor used diagonalisation to demonstrate that the set of real numbers is not countable.

Powersets of infinite countable sets are not countable Theorem Let S be an infinite countable set. Then its powerset 2 S is not countable. Let S = {s 1, s 2, s 3,...}. Then any element t of 2 S can be represented by a sequence of 0 s and 1 s, with a 1 in position i iff s i is in t. For example, the set {s 2, s 3, s 6 } is represented by 01100100..., while {s 1, s 3, s 5 } is represented by 10101... Clearly, any element of 2 S can be represented by such a sequence, and any such sequence represents a unique element of 2 S.

Proof (continued) Suppose that 2 S were countable, then its elements could be written in some order, say t 1, t 2,..., and we could enter these into a table. t 1 1 0 0 0 0... t 2 1 1 0 0 0.... In this table, take the elements in the main diagonal and complement each entry. This new sequence along the diagonal represents some element of 2 S, say t i for some i. But it cannot be t 1 because it differs from t 1 through s 1... Contradiction and 2 S is not countable.

Languages that are not recursively enumerable As an immediate consequence of this result, we can show that, in some sense, there are fewer Turing machines than there are languages, so that there must be some languages that are not recursively enumerable. Theorem For any nonempty Σ, there exists languages that are not recursively enumerable. A language is a subset of Σ, and every such subset is a language. Therefore, the set of all languages is exactly 2 Σ. Since Σ is infinite, we know by our previous theorem, that the set of all languages on Σ is not countable. But the set of all Turing machines can be enumerated, so the set of all recursively enumerable languages is countable. There must be some languages on Σ that are not recursively enumerable.

Languages that are not recursively enumerable Let s summarize: Let Σ be an alphabet. Then there are languages over Σ that are not recursively enumerable. A language is recursively enumerable if and only if there is a Turing machine that accepts it. There are countably many Turing machines. There are uncountably many languages over Σ.

A language that is not recursively enumerable The description of a language that is not recursively enumerable is indirect. There is no easy way for an intuitive interpretation of such a language, but we can define such a language properly. Theorem There exists a recursively enumerable language whose complement is not recursively enumerable. Proof (whiteboard).

Combining enumeration of complements Theorem If a language L and its complement L are both recursively enumerable, then both languages are recursive. Proof idea. If L and L are both recursively enumerable, then there exists a TM M and ˆM that serve as enumeration procedures for L and L, resp. The first will produce w 1, w 2,... in L, the second ŵ 1, ŵ 2,... in L. Suppose now we are given any w Σ +. We first let M generate w 1 and compare it with w. If they are not the same, we let ˆM generate ŵ 1 and compare again (and so on). Any w Σ + will be generated by either M or ˆM, so eventually we will get a match. If the matching string is produced by M, then w L, otherwise w L. The process is a membership algorithm for both L and L, so they are both recursive.

REC is closed under complementation Theorem Let L be a recursive language. Then its complement ˆL is also recursive. Proof idea. Let M be a TM that is a membership algorithm for L. Construct ˆM that answers yes whenever M answers no and vice versa. From the previous two theorems we conclude that REC RE.

Languages that are not recursively enumerable but recursive Theorem There exists a recursively enumerable language that is not recursive; that is, the family of recursive languages is a proper subset of the family of recursively enumerable languages. Proof. (ref. proof from whiteboard). The language L is recursively enumerable (ref. proof from whiteboard), but its complement is not. Therefore, it is not recursive (since REC is closed under complementation).

Recall: Computability Definition A function f with domain D is said to be Turingcomputable or just computable if there exists some TM M = (Q, Σ, Γ, δ, q 0,, F ) such that q f F, for all w D. q 0 w q f f(w), Homework: Define the concepts recognizability, decidability, enumerability and computability and think about how they are related.

Unrestricted grammars Definition A grammar G = (N, T, P, S) is called unrestricted if all the productions are of the form u v, where u is in (N T ) + and v is in (N T ). In an unrestricted grammar, essentially no conditions are imposed on the productions. There is only one restriction: λ is not allowed as the left side of a production.

Unrestricted grammars and recursively enumerable languages Theorem Any language generated by an unrestricted grammar is recursively enumerable. Theorem For every recursively enumerable language L, there exists an unrestricted grammar G, such that L = L(G). The family of languages associated with unrestricted grammars is identical with the family of recursively enumerable languages.

Linear bounded automata It is not possible to extend the power of the basic Turing machine by complicating the tape structure. But it is possible to limit it by restricting the way in which the tape can be used. We allow the machine to use only that part of the tape occupied by the input. Thus, more space is available for long input strings than for short ones. Linear bounded automata (LBA). An LBA has an unbounded tape, but how much of the tape can be used is a function of the input.

Linear bounded automata We restrict the usable part of the tape to exactly the cells taken by the input. To enforce this, we can envision the input as bracketed by two special symbols, the left-end marker [ and the right-end marker ]. For an input w, the initial configuration of the machine is given by the instantaneous description q 0 [w]. The end markers cannot be rewritten, and the read-write head cannot move to the left of [ or to the right of ].

Linear bounded automata Definition A linear-bounded automaton is a nondeterministic Turing machine M = (Q, Σ, Γ, q 0,, F ), subject to the restriction that Σ must contain two special symbols [ and ], such that δ(q i, [) can contain only elements of the form (q j, [, R), and δ(q i, ]) can contain only elements of the form (q j, ], L).

Linear bounded automaton Definition A string w is accepted by a linear bounded automaton if there is a possible sequence of moves for some q f F, x 1, x 2 Γ. q 0 [w] [x 1 q f x 2 ] The language accepted by the LBA is the set of all such accepted strings. Open problem: Are nondeterminstic LBA s equivalent to deterministic LBA s?

Context-Sensitive Grammars and Languages Definition A grammar G = (N, T, P, S) is said to be context-sensitive if all productions are of the form where x, y (N T ) + and x y, x y. This definition shows clearly one aspect of this type of grammar; it is noncontracting. The length of successive sentential forms can never decrease.

Context-Sensitive Grammars and Languages Definition A language L is said to be context-sensitive if there exists a context-sensitive grammar G, such that L = L(G). Theorem For every context-sensitive language L, there exists some linear bounded automaton M such that L = L(M). Theorem If a language L is accepted by some linear bounded automaton M, then there exists a context-sensitive grammar that generates L.

The Chomsky hierarchy We have encountered a number of language families: the recursively enumerable language family, the recursive language family, the context-sensitive language family, the context-free language family, the deterministic context-free language family, and the regular language family. One way of exhibiting the relationship between these families is by the extended Chomsky hierarchy.

References LINZ, P. An introduction to Formal Languages and Automata. Jones and Bartlett Learning, 2012.