Fall 2006Costas Busch - RPI1 Turing Machines. Fall 2006Costas Busch - RPI2 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 Reductions. Fall 2006Costas Busch - RPI2 Problem is reduced to problem If we can solve problem then we can solve problem.
Fall 2006Costas Busch - RPI1 Time Complexity. Fall 2006Costas Busch - RPI2 Consider a deterministic Turing Machine which decides a language.
Fall 2006Costas Busch - RPI1 A Universal Turing Machine.
Turing Machines.
Deterministic Turing Machines
Linear Bounded Automata LBAs
Fall 2003Costas Busch - RPI1 Properties of Context-Free languages.
Fall 2006Costas Buch - RPI1 Simplifications of Context-Free Grammars.
Context-Free Languages
Fall 2006Costas Busch - RPI1 Decidable Languages.
Introduction to Computability Theory
Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Variants of Turing machines
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automata And Regular Languages.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Recursively Enumerable and Recursive Languages
Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Turing Machines.
1 Computing Functions with Turing Machines. 2 A function Domain: Result Region: has:
Fall 2006Costas Busch - RPI1 Pushdown Automata PDAs.
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 ? ?
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 ? ?
Fall 2005Costas Busch - RPI1 Pushdown Automata PDAs.
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.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automaton (DFA) Input Tape “Accept” or “Reject” String Finite Automaton Output.
Turing Machines (13.5) Based on slides by Costas Busch from the course
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 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.
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 ? ?
1 Computing Functions with Turing Machines. 2 A function Domain Result Region has:
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 ? ?
Fall 2006Costas Busch - RPI1 RE languages and Enumerators.
Turing’s Thesis Costas Busch - LSU.
Busch Complexity Lectures: Turing Machines
Deterministic Turing Machines
Reductions Costas Busch - LSU.
Turing Machines.
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
Computing Functions with Turing Machines
Turing Machines 2nd 2017 Lecture 9.
Turing Machines Acceptors; Enumerators
Chapter 9 TURING MACHINES.
Turing acceptable languages and Enumerators
Turing Machines (11.5) Based on slides by Costas Busch from the course
Non-Deterministic Finite Automata
Decidable Languages Costas Busch - LSU.
Computing Functions with Turing Machines
Theory of computing, part 4
Formal Definitions for Turing Machines
Presentation transcript:

Fall 2006Costas Busch - RPI1 Turing Machines

Fall 2006Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?

Fall 2006Costas Busch - RPI3 Regular Languages Context-Free Languages Languages accepted by Turing Machines

Fall 2006Costas Busch - RPI4 A Turing Machine Tape Read-Write head Control Unit

Fall 2006Costas Busch - RPI5 The Tape Read-Write head No boundaries -- infinite length The head moves Left or Right

Fall 2006Costas Busch - RPI Read-Write head The head at each transition (time step): 1. Reads a symbol 2. Writes a symbol 3. Moves Left or Right

Fall 2006Costas Busch - RPI Example: Time Time 1 1. Reads 2. Writes 3. Moves Left

Fall 2006Costas Busch - RPI Time Time 2 1. Reads 2. Writes 3. Moves Right

Fall 2006Costas Busch - RPI9 The Input String Blank symbol head Head starts at the leftmost position of the input string Input string

Fall 2006Costas Busch - RPI10 States & Transitions Read Write Move Left Move Right

Fall 2006Costas Busch - RPI11 Example: Time 1 current state

Fall 2006Costas Busch - RPI Time Time 2

Fall 2006Costas Busch - RPI Time Time 2 Example:

Fall 2006Costas Busch - RPI Time Time 2 Example:

Fall 2006Costas Busch - RPI15 Determinism Allowed Not Allowed No lambda transitions allowed Turing Machines are deterministic

Fall 2006Costas Busch - RPI16 Partial Transition Function Example: No transition for input symbol Allowed:

Fall 2006Costas Busch - RPI17 Halting The machine halts in a state if there is no transition to follow

Fall 2006Costas Busch - RPI18 Halting Example 1: No transition from HALT!!!

Fall 2006Costas Busch - RPI19 Halting Example 2: No possible transition from and symbol HALT!!!

Fall 2006Costas Busch - RPI20 Accepting States Allowed Not Allowed Accepting states have no outgoing transitions The machine halts and accepts

Fall 2006Costas Busch - RPI21 Acceptance Accept Input If machine halts in an accept state Reject Input If machine halts in a non-accept state or If machine enters an infinite loop string

Fall 2006Costas Busch - RPI22 Observation: In order to accept an input string, it is not necessary to scan all the symbols in the string

Fall 2006Costas Busch - RPI23 Turing Machine Example Accepts the language: Input alphabet

Fall 2006Costas Busch - RPI24 Time 0

Fall 2006Costas Busch - RPI25 Time 1

Fall 2006Costas Busch - RPI26 Time 2

Fall 2006Costas Busch - RPI27 Time 3

Fall 2006Costas Busch - RPI28 Time 4 Halt & Accept

Fall 2006Costas Busch - RPI29 Rejection Example Time 0

Fall 2006Costas Busch - RPI30 Time 1 No possible Transition Halt & Reject

Fall 2006Costas Busch - RPI31 Accepts the language: but for input alphabet A simpler machine for same language

Fall 2006Costas Busch - RPI32 Time 0 Halt & Accept Not necessary to scan input

Fall 2006Costas Busch - RPI33 Infinite Loop Example A Turing machine for language

Fall 2006Costas Busch - RPI34 Time 0

Fall 2006Costas Busch - RPI35 Time 1

Fall 2006Costas Busch - RPI36 Time 2

Fall 2006Costas Busch - RPI37 Time 2 Time 3 Time 4 Time 5 Infinite loop

Fall 2006Costas Busch - RPI38 Because of the infinite loop: The accepting state cannot be reached The machine never halts The input string is rejected

Fall 2006Costas Busch - RPI39 Another Turing Machine Example Turing machine for the language

Fall 2006Costas Busch - RPI40 Match as with bs: Repeat: replace leftmost a with x find leftmost b and replace it with y Until there are no more as or bs If there is a remaining a or b reject Basic Idea:

Fall 2006Costas Busch - RPI41 Time 0

Fall 2006Costas Busch - RPI42 Time 1

Fall 2006Costas Busch - RPI43 Time 2

Fall 2006Costas Busch - RPI44 Time 3

Fall 2006Costas Busch - RPI45 Time 4

Fall 2006Costas Busch - RPI46 Time 5

Fall 2006Costas Busch - RPI47 Time 6

Fall 2006Costas Busch - RPI48 Time 7

Fall 2006Costas Busch - RPI49 Time 8

Fall 2006Costas Busch - RPI50 Time 9

Fall 2006Costas Busch - RPI51 Time 10

Fall 2006Costas Busch - RPI52 Time 11

Fall 2006Costas Busch - RPI53 Time 12

Fall 2006Costas Busch - RPI54 Halt & Accept Time 13

Fall 2006Costas Busch - RPI55 If we modify the machine for the language we can easily construct a machine for the language Observation:

Fall 2006Costas Busch - RPI56 Formal Definitions for Turing Machines

Fall 2006Costas Busch - RPI57 Transition Function

Fall 2006Costas Busch - RPI58 Transition Function

Fall 2006Costas Busch - RPI59 Turing Machine: States Input alphabet Tape alphabet Transition function Initial state blank Accept states

Fall 2006Costas Busch - RPI60 Configuration Instantaneous description:

Fall 2006Costas Busch - RPI61 Time 4Time 5 A Move: (yields in one mode)

Fall 2006Costas Busch - RPI62 Time 4Time 5 Time 6Time 7 A computation

Fall 2006Costas Busch - RPI63 Equivalent notation:

Fall 2006Costas Busch - RPI64 Initial configuration: Input string

Fall 2006Costas Busch - RPI65 The Accepted Language For any Turing Machine Initial stateAccept state

Fall 2006Costas Busch - RPI66 If a language is accepted by a Turing machine then we say that is: Turing Acceptable Recursively Enumerable Turing Recognizable Other names used:

Fall 2006Costas Busch - RPI67 Computing Functions with Turing Machines

Fall 2006Costas Busch - RPI68 A function Domain: Result Region: has:

Fall 2006Costas Busch - RPI69 A function may have many parameters: Example: Addition function

Fall 2006Costas Busch - RPI70 Integer Domain Unary: Binary: Decimal: We prefer unary representation: easier to manipulate with Turing machines

Fall 2006Costas Busch - RPI71 Definition: A function is computable if there is a Turing Machine such that: Initial configurationFinal configuration Domain accept stateinitial state For all

Fall 2006Costas Busch - RPI72 Initial Configuration Final Configuration A function is computable if there is a Turing Machine such that: In other words: Domain For all

Fall 2006Costas Busch - RPI73 Example The function is computable Turing Machine: Input string: unary Output string: unary are integers

Fall 2006Costas Busch - RPI74 Start initial state The 0 is the delimiter that separates the two numbers

Fall 2006Costas Busch - RPI75 Start Finish final state initial state

Fall 2006Costas Busch - RPI76 Finish final state The 0 here helps when we use the result for other operations

Fall 2006Costas Busch - RPI77 Turing machine for function

Fall 2006Costas Busch - RPI78 Execution Example: Time 0 Final Result (=2)

Fall 2006Costas Busch - RPI79 Time 0

Fall 2006Costas Busch - RPI80 Time 1

Fall 2006Costas Busch - RPI81 Time 2

Fall 2006Costas Busch - RPI82 Time 3

Fall 2006Costas Busch - RPI83 Time 4

Fall 2006Costas Busch - RPI84 Time 5

Fall 2006Costas Busch - RPI85 Time 6

Fall 2006Costas Busch - RPI86 Time 7

Fall 2006Costas Busch - RPI87 Time 8

Fall 2006Costas Busch - RPI88 Time 9

Fall 2006Costas Busch - RPI89 Time 10

Fall 2006Costas Busch - RPI90 Time 11

Fall 2006Costas Busch - RPI91 HALT & accept Time 12

Fall 2006Costas Busch - RPI92 Another Example The function is computable Turing Machine: Input string: unary Output string:unary is integer

Fall 2006Costas Busch - RPI93 Start Finish accept state initial state

Fall 2006Costas Busch - RPI94 Turing Machine Pseudocode for Replace every 1 with $ Repeat: Find rightmost $, replace it with 1 Go to right end, insert 1 Until no more $ remain

Fall 2006Costas Busch - RPI95 Turing Machine for

Fall 2006Costas Busch - RPI96 Example Start Finish

Fall 2006Costas Busch - RPI97 Another Example The function is computable if Input: Output: or

Fall 2006Costas Busch - RPI98 Turing Machine Pseudocode: Match a 1 from with a 1 from Repeat Until all of or is matched If a 1 from is not matched erase tape, write 1 else erase tape, write 0

Fall 2006Costas Busch - RPI99 Combining Turing Machines

Fall 2006Costas Busch - RPI100 Block Diagram Turing Machine inputoutput

Fall 2006Costas Busch - RPI101 Example: if Comparator Adder Eraser