Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?

Slides:



Advertisements
Similar presentations
ALAK ROY. Assistant Professor Dept. of CSE NIT Agartala
Advertisements

Introduction to Turing Machines
Fall 2006Costas Busch - RPI1 Turing Machines. Fall 2006Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Turing Machines.
Deterministic Turing Machines
Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
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.
Turing Machines New capabilities: –infinite tape –can read OR write to tape –read/write head can move left and right q0q0 input tape.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automata And Regular Languages.
1 Turing Machines. 2 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 ? ?
Turing Machines.
Fall 2004COMP 3351 Pushdown Automata PDAs. Fall 2004COMP 3352 Pushdown Automaton -- PDA Input String Stack States.
1 Computing Functions with Turing Machines. 2 A function Domain: Result Region: has:
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
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.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2011.
1 Language Recognition (11.4) and Turing Machines (11.5) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch.
CSCI 2670 Introduction to Theory of Computing September 28, 2005.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automaton (DFA) Input Tape “Accept” or “Reject” String Finite Automaton Output.
1 Turing Machines There are languages that are not context-free. What can we say about the most powerful automata and the limits of computation?. Alan.
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.
Turing Machines (13.5) Based on slides by Costas Busch from the course
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Theory of computing, part 4. 1Introduction 2Theoretical background Biochemistry/molecular biology 3Theoretical background computer science 4History of.
Costas Busch - LSU1 Turing’s Thesis. Costas Busch - LSU2 Turing’s thesis (1930): Any computation carried out by mechanical means can be performed by a.
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 - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
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 ? ?
CS 154 Formal Languages and Computability April 12 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
1 Computing Functions with Turing Machines. 2 A function Domain Result Region has:
Chapter 9 Turing Machines What would happen if we change the stack in Pushdown Automata into some other storage device? Truing Machines, which maintains.
Turing Machines. The next level of Machine… PDAs improved on FSAs by adding memory. We make the memory more flexible to do more complicated tasks.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
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.
Turing’s Thesis Costas Busch - LSU.
CSE202: Introduction to Formal Languages and Automata Theory
Busch Complexity Lectures: Turing Machines
Deterministic Turing Machines
COSC 3340: Introduction to Theory of Computation
Turing Machines.
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
COSC 3340: Introduction to Theory of Computation
Computing Functions with Turing Machines
Turing Machines 2nd 2017 Lecture 9.
Turing Machines Acceptors; Enumerators
Chapter 9 TURING MACHINES.
Turing Machines (11.5) Based on slides by Costas Busch from the course
Non Deterministic Automata
Computing Functions with Turing Machines
Theory of computing, part 4
COSC 3340: Introduction to Theory of Computation
Formal Definitions for Turing Machines
Presentation transcript:

Fall 2004COMP 3351 Turing Machines

Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?

Fall 2004COMP 3353 Regular Languages Context-Free Languages Languages accepted by Turing Machines

Fall 2004COMP 3354 A Turing Machine Tape Read-Write head Control Unit

Fall 2004COMP 3355 The Tape Read-Write head No boundaries -- infinite length The head moves Left or Right

Fall 2004COMP Read-Write head The head at each time step: 1. Reads a symbol 2. Writes a symbol 3. Moves Left or Right

Fall 2004COMP Example: Time Time 1 1. Reads 2. Writes 3. Moves Left

Fall 2004COMP Time Time 2 1. Reads 2. Writes 3. Moves Right

Fall 2004COMP 3359 The Input String Blank symbol head Head starts at the leftmost position of the input string Input string

Fall 2004COMP Blank symbol head Input string Remark: the input string is never empty

Fall 2004COMP States & Transitions Read Write Move Left Move Right

Fall 2004COMP Example: Time 1 current state

Fall 2004COMP Time Time 2

Fall 2004COMP Time Time 2 Example:

Fall 2004COMP Time Time 2 Example:

Fall 2004COMP Determinism Allowed Not Allowed No lambda transitions allowed Turing Machines are deterministic

Fall 2004COMP Partial Transition Function Example: No transition for input symbol Allowed:

Fall 2004COMP Halting The machine halts if there are no possible transitions to follow

Fall 2004COMP Example: No possible transition HALT!!!

Fall 2004COMP Final States Allowed Not Allowed Final states have no outgoing transitions In a final state the machine halts

Fall 2004COMP Acceptance Accept Input If machine halts in a final state Reject Input If machine halts in a non-final state or If machine enters an infinite loop

Fall 2004COMP Turing Machine Example A Turing machine that accepts the language:

Fall 2004COMP Time 0

Fall 2004COMP Time 1

Fall 2004COMP Time 2

Fall 2004COMP Time 3

Fall 2004COMP Time 4 Halt & Accept

Fall 2004COMP Rejection Example Time 0

Fall 2004COMP Time 1 No possible Transition Halt & Reject

Fall 2004COMP Infinite Loop Example

Fall 2004COMP Time 0

Fall 2004COMP Time 1

Fall 2004COMP Time 2

Fall 2004COMP Time 2 Time 3 Time 4 Time 5 Infinite loop

Fall 2004COMP Because of the infinite loop: The final state cannot be reached The machine never halts The input is not accepted

Fall 2004COMP Another Turing Machine Example Turing machine for the language

Fall 2004COMP Time 0

Fall 2004COMP Time 1

Fall 2004COMP Time 2

Fall 2004COMP Time 3

Fall 2004COMP Time 4

Fall 2004COMP Time 5

Fall 2004COMP Time 6

Fall 2004COMP Time 7

Fall 2004COMP Time 8

Fall 2004COMP Time 9

Fall 2004COMP Time 10

Fall 2004COMP Time 11

Fall 2004COMP Time 12

Fall 2004COMP Halt & Accept Time 13

Fall 2004COMP We easily modify the machine for the language to construct a TM for the language Observation:

Fall 2004COMP Formal Definitions for Turing Machines

Fall 2004COMP Transition Function

Fall 2004COMP Transition Function

Fall 2004COMP Turing Machine: States Input alphabet Tape alphabet Transition function Initial state blank Final states

Fall 2004COMP Configuration Instantaneous description:

Fall 2004COMP Time 4Time 5 A Move:

Fall 2004COMP Time 4Time 5 Time 6Time 7

Fall 2004COMP Equivalent notation:

Fall 2004COMP Initial configuration: Input string

Fall 2004COMP The Accepted Language For any Turing Machine Initial stateFinal state

Fall 2004COMP Standard Turing Machine Deterministic Infinite tape in both directions Tape is the input/output file The machine we described is the standard:

Fall 2004COMP Computing Functions with Turing Machines

Fall 2004COMP A function Domain: Result Region: has:

Fall 2004COMP A function may have several parameters / arguments: Example: The Addition function

Fall 2004COMP Integer Domain Unary: Binary: Decimal: We prefer unary representation: easier to manipulate with Turing machines

Fall 2004COMP Definition: A function is computable if there is a Turing Machine such that: Initial configurationFinal configuration Domain final stateinitial state For all

Fall 2004COMP Initial Configuration Final Configuration A function is computable if there is a Turing Machine such that: In other words: (the domain)

Fall 2004COMP Example The function is computable A Turing Machine M for f: Input string: unary Output string: unary are integers

Fall 2004COMP Start initial state The 0 is the delimiter that separates the two numbers

Fall 2004COMP Start Finish final state initial state

Fall 2004COMP Finish final state The 0 helps when we use the result for other operations

Fall 2004COMP Turing machine M for the function:

Fall 2004COMP Execution Example: Input (time 0) Output (final result) (2)

Fall 2004COMP Time 0

Fall 2004COMP Time 1

Fall 2004COMP Time 2

Fall 2004COMP Time 3

Fall 2004COMP Time 4

Fall 2004COMP Time 5

Fall 2004COMP Time 6

Fall 2004COMP Time 7

Fall 2004COMP Time 8

Fall 2004COMP Time 9

Fall 2004COMP Time 10

Fall 2004COMP Time 11

Fall 2004COMP Time 12

Fall 2004COMP HALT & accept Time 13

Fall 2004COMP Another Example The function is computable Turing Machine: Input string: unary Output string:unary is integer

Fall 2004COMP Start Finish final state initial state

Fall 2004COMP Turing Machine Pseudocode for Replace every 1 with $ Repeat: Find rightmost $, replace it with 1 Go to right end, then insert 1 Until no more $ remains

Fall 2004COMP A Turing Machine for:

Fall 2004COMP Example Start Finish

Fall 2004COMP Another Example The function is computable if

Fall 2004COMP A Turing Machine for Input: Output: or if

Fall 2004COMP Pseudocode for our Turing Machine: Match a 1 from with a 1 from Repeat Until all of or is matched If a 1 from is not matched erase tape, then write 1 else erase tape, then write 0

Fall 2004COMP Combining Turing Machines

Fall 2004COMP Block Diagram Turing Machine inputoutput

Fall 2004COMP Example: if Comparer Adder Eraser