CSE202: Introduction to Formal Languages and Automata Theory

Slides:



Advertisements
Similar presentations
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
Advertisements

Variants of Turing machines
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
CS 461 – Oct. 21 Begin chapter 3 We need a better (more encompassing) model of computation. Ex. { 1 n 2 n 3 n } couldn’t be accepted by PDA. –How could.
Week 7 - Wednesday.  What did we talk about last time?  Set proofs and disproofs  Russell’s paradox.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS 310 – Fall 2006 Pacific University CS310 Turing Machines Section 3.1 November 6, 2006.
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
Costas Busch - RPI1 Turing Machines. Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Theory of Computation. Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely.
Turing Machines Chapter Plan Turing Machines(TMs) – Alan Turing Church-Turing Thesis – Definitions Computation Configuration Recognizable vs. Decidable.
CSE202: Introduction to Formal Languages and Automata Theory Chapter 9 The Turing Machine These class notes are based on material from our textbook, An.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Models of Computation - Turing Machines Dale Roberts, Lecturer.
Turing Machines Chapter 17. Languages and Machines SD D Context-Free Languages Regular Languages reg exps FSMs cfgs PDAs unrestricted grammars Turing.
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Part 1 – Pages COMPUTABILITY THEORY.
CSE 3813 Introduction to Formal Languages and Automata Chapter 10 Other Models of Turing Machines These class notes are based on material from our textbook,
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
Theory of computing, part 4. 1Introduction 2Theoretical background Biochemistry/molecular biology 3Theoretical background computer science 4History of.
1 Turing machines Chapter 4, Smith and Kimber. A Turing machine is an abstraction of a human “computer”. Consists of - control, in the form of states -
1 IDT Open Seminar ALAN TURING AND HIS LEGACY 100 Years Turing celebration Gordana Dodig Crnkovic, Computer Science and Network Department Mälardalen University.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
CS 461 – Oct. 28 TM applications –Recognize a language √ –Arithmetic √ –Enumerate a set –Encode a data structure or problem to solve Two kinds of TMs –Decider:
1 Introduction to Turing Machines
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Week 7 - Wednesday.  What did we talk about last time?  Proving the subset relationship  Proving set equality  Set counterexamples  Laws of set algebra.
CS 154 Formal Languages and Computability April 12 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
Chapter 9 Turing Machines What would happen if we change the stack in Pushdown Automata into some other storage device? Truing Machines, which maintains.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Theory of Computation Automata Theory Dr. Ayman Srour.
Universal Turing Machine
CS 154 Formal Languages and Computability April 7 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesTuring.
TM Macro Language MA/CSSE 474 Theory of Computation.
Busch Complexity Lectures: Turing Machines
Turing Machines Chapter 17.
Pumping Lemma Revisited
(Universal Turing Machine)
COSC 3340: Introduction to Theory of Computation
Theory of Computation Lecture 22: Turing Machines III
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
Turing Machines Acceptors; Enumerators
Chapter 9 TURING MACHINES.
Chapter 3: The CHURCH-Turing thesis
Turing Machines Chapter 17.
Decidable Languages Costas Busch - LSU.
MA/CSSE 474 Theory of Computation
Recall last lecture and Nondeterministic TMs
MA/CSSE 474 Theory of Computation
CSE S. Tanimoto Turing Completeness
Instructor: Aaron Roth
Variants of Turing machines
Formal Definitions for Turing Machines
Hopcroft, Motawi, Ullman, Chap 8
Turing Machines Everything is an Integer
Theory of Computation Lecture 23: Turing Machines III
CSE 105 theory of computation
Presentation transcript:

CSE202: Introduction to Formal Languages and Automata Theory Chapter 9 The Turing Machine These class notes are based on material from our textbook, An Introduction to Formal Languages and Automata, 4th ed., by Peter Linz.

Model of computation A TM is an abstract model of a computer that lets us define in a precise, mathematical way what we mean by computation. As before, we use the concept of a “configuration” to define what we mean by computation.

Configuration A configuration of a TM is a pair, (q,xay) where q is a state, x and y are strings, and a is the symbol at the current position of the tape head. We sometimes use (q,xw) To indicate that the tape head is under the first symbol in the string w.

Configuration A configuration of a TM includes everything we need to know to continue a computation current state symbol currently under the tape head string on tape to left of the head string on tape to right of the head (up to rightmost non-blank symbol) Example (q, bbabbba)

Computation A computation is a sequence of configurations such that each configuration is obtained from the previous configuration by some transition of the TM Given input string aabb, the TM that accepts the language a*b* begins a computation as follows: (s, aabb) |- (s, Aabb) |- (s, AAbb) |- … Continue this computation to the end

Example: Here is the TM to process the language consisting of strings containing any number of a’s, with a single b at the end. q1 q2 q0 h  / , R b / b, R  / , R a / a, R  a b

Example: An FA that accepts {a, b}* {aba} {a, b}*

Example: A TM that accepts {a, b}* {aba} {a, b}*

Example: An FA that accepts {a, b}* {aba}

Example: A TM that accepts {a, b}* {aba}

Example: A TM that accepts pal, the palindrome language:

A TM that accepts strings of L = {ss}:

Computable A function f with domain D is said to be Turing-computable or just computable if there exist some Turing machine M = (Q, S, G, d, q0, D, F) such that q0w |-M* qf f(w), qf F, For all w D.

Combining Turing Machines You can combine several smaller TMs in order to make a larger, more complicated TM. The composite of two different TMs, T1 and T2, is written as T1T2. It would be represented as: T1  T2 What happens is that T1T2 begins by executing the moves of T1, up to the point where T1 would halt. Instead of halting, T1T2 moves to the initial state of T2, where it begins executing the moves of T2. If T2 halts, then T1T2 halts. If T1 or T2 crashes, then T1T2 crashes.

Combining Turing Machines You can also make the transition to T2 conditional. a T1  T2 Here, T1 would execute its moves up to the point where it would normally halt. If the symbol on the tape at that point is an a, then T1T2 will begin executing the moves of T2. Otherwise T1T2 will crash.

Designing complex Turing machines The book describes a “language” for combining simple TMs into complex ones, using the sequence, branching, and looping operators of imperative programming languages. If you were going to be a Turing machine programmer, this would be useful. Since you’re not, you will not be tested on this. But you need to understand how a Turing machine works and how to design simple ones.

Computing functions We use automata to recognize languages and compute functions (although we haven’t talked about computing functions until now). In fact, computing functions allows language recognition, since every language can be represented by a characteristic function if the input string is in the language, output 1 otherwise output 0

String and numeric functions A TM can compute functions on strings. Given an input string, the output of the function is the string left on the tape after the TM halts. A TM can also compute numeric functions. Using a binary alphabet for strings, the input string can represent a binary number and the output string can represent a binary number. A TM can compute a function with multiple arguments. Each argument is separated by a blank on the tape. We can create TMs that compute arithmetic functions such as addition, subtraction, multiplication, etc.

Computing a Partial Function A Turing Machine can compute a function by leaving a string on the tape when it enters the halt state. A partial function f on S*may be undefined at certain points (the points not in the domain of f). A total function enters the halt state for all inputs in the domain. We say that a TM, T, computes f if T halts where f is defined and fails to halt elsewhere. So f is Turing-computable, or just computable, if there exists some TM computing f.

Computing a numerical function We can represent numbers on a TM by using the unary representation, which just uses n 1’s to represent the number n. Example: 11111 = 5 We can construct a TM to concatenate two strings together. If we represent two numbers in unary form, then a TM which concatenates these two strings is actually performing addition!

Computing a numerical function Addition of two numbers as simple as concatenation of two strings. Assume two integers are represented in unary form on the tape of a Turing machine. Assume the two integers are separated by a 0 between them. Design a Turing machine that will add these two numbers.

Computing a numerical function

Characteristic Function Computing the characteristic function L is very similar to accepting a language. The TM must always halt. The TM will leave a 1 on the tape if string is accepted, a 0 otherwise. HOWEVER: A TM can accept a language if it halts on all strings that are in the language, but doesn't halt on strings which are not.

Characteristic function: In a standard TM, strings which are not accepted can cause the TM to: crash if it enters a state where there are no transitions for the current tape symbol, crash if it tries to move left at the left end of the tape, or get into an infinite loop, A TM computing the characteristic function must halt on all inputs

Conclusion: Anything that is effectively calculable can be executed on a TM. A universal TM can compute anything that any other Turing machine can compute. The universal TM is itself a standard TM. A CPU with RAM is a finite version of a TM; it has the power of a TM up to the point that it runs out of memory. Languages or hardware that provides compares, loops, and increments are termed Turing complete and can also compute anything that is effectively calculable.