Costas Busch - RPI1 Turing Machines. Costas 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 Turing Machines. Fall 2006Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Turing Machines.
Deterministic Turing Machines
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
Turing Machines New capabilities: –infinite tape –can read OR write to tape –read/write head can move left and right q0q0 input tape.
Turing’s Thesis Fall 2006 Costas Busch - RPI.
Costas Busch - RPI1 Pushdown Automata PDAs. Costas Busch - RPI2 Pushdown Automaton -- PDA Input String Stack States.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
Courtesy Costas Busch - RPI1 Pushdown Automata PDAs.
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.
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.
Courtesy Costas Busch - RPI1 Reducibility. Courtesy Costas Busch - RPI2 Problem is reduced to problem If we can solve problem then we can solve problem.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Finite Automata Costas Busch - RPI.
Costas Busch - LSU1 Non-Deterministic Finite Automata.
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
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 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. 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.
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.
Costas Busch - LSU1 Deterministic Finite Automata And Regular Languages.
Turing’s Thesis Costas Busch - LSU.
Busch Complexity Lectures: Turing Machines
Deterministic Turing Machines
Reductions Costas Busch - LSU.
Pushdown Automata PDAs
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.
Chapter 9 TURING MACHINES.
Undecidable Problems (unsolvable problems)
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:

Costas Busch - RPI1 Turing Machines

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

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

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

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

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

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

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

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

Costas Busch - RPI Blank symbol head Input string Remark: the input string is never empty

Costas Busch - RPI11 States & Transitions Read Write Move Left Move Right

Costas Busch - RPI12 Example: Time 1 current state

Costas Busch - RPI Time Time 2

Costas Busch - RPI Time Time 2 Example:

Costas Busch - RPI Time Time 2 Example:

Costas Busch - RPI16 Determinism Allowed Not Allowed No lambda transitions allowed Turing Machines are deterministic

Costas Busch - RPI17 Partial Transition Function Example: No transition for input symbol Allowed:

Costas Busch - RPI18 Halting The machine halts if there are no possible transitions to follow

Costas Busch - RPI19 Example: No possible transition HALT!!!

Costas Busch - RPI20 Final States Allowed Not Allowed Final states have no outgoing transitions In a final state the machine halts

Costas Busch - RPI21 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

Costas Busch - RPI22 Turing Machine Example A Turing machine that accepts the language:

Costas Busch - RPI23 Time 0

Costas Busch - RPI24 Time 1

Costas Busch - RPI25 Time 2

Costas Busch - RPI26 Time 3

Costas Busch - RPI27 Time 4 Halt & Accept

Costas Busch - RPI28 Rejection Example Time 0

Costas Busch - RPI29 Time 1 No possible Transition Halt & Reject

Costas Busch - RPI30 Infinite Loop Example A Turing machine for language

Costas Busch - RPI31 Time 0

Costas Busch - RPI32 Time 1

Costas Busch - RPI33 Time 2

Costas Busch - RPI34 Time 2 Time 3 Time 4 Time 5 Infinite loop

Costas Busch - RPI35 Because of the infinite loop: The final state cannot be reached The machine never halts The input is not accepted

Costas Busch - RPI36 Another Turing Machine Example Turing machine for the language

Costas Busch - RPI37 Time 0

Costas Busch - RPI38 Time 1

Costas Busch - RPI39 Time 2

Costas Busch - RPI40 Time 3

Costas Busch - RPI41 Time 4

Costas Busch - RPI42 Time 5

Costas Busch - RPI43 Time 6

Costas Busch - RPI44 Time 7

Costas Busch - RPI45 Time 8

Costas Busch - RPI46 Time 9

Costas Busch - RPI47 Time 10

Costas Busch - RPI48 Time 11

Costas Busch - RPI49 Time 12

Costas Busch - RPI50 Halt & Accept Time 13

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

Costas Busch - RPI52 Formal Definitions for Turing Machines

Costas Busch - RPI53 Transition Function

Costas Busch - RPI54 Transition Function

Costas Busch - RPI55 Turing Machine: States Input alphabet Tape alphabet Transition function Initial state blank Final states

Costas Busch - RPI56 Configuration Instantaneous description:

Costas Busch - RPI57 Time 4Time 5 A Move:

Costas Busch - RPI58 Time 4Time 5 Time 6Time 7

Costas Busch - RPI59 Equivalent notation:

Costas Busch - RPI60 Initial configuration: Input string

Costas Busch - RPI61 The Accepted Language For any Turing Machine Initial stateFinal state

Costas Busch - RPI62 Standard Turing Machine Deterministic Infinite tape in both directions Tape is the input/output file The machine we described is the standard:

Costas Busch - RPI63 Computing Functions with Turing Machines

Costas Busch - RPI64 A function Domain: Result Region: has:

Costas Busch - RPI65 A function may have many parameters: Example: Addition function

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

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

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

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

Costas Busch - RPI70 Start initial state The 0 is the delimiter that separates the two numbers

Costas Busch - RPI71 Start Finish final state initial state

Costas Busch - RPI72 Finish final state The 0 helps when we use the result for other operations

Costas Busch - RPI73 Turing machine for function

Costas Busch - RPI74 Execution Example: Time 0 Final Result (2)

Costas Busch - RPI75 Time 0

Costas Busch - RPI76 Time 1

Costas Busch - RPI77 Time 2

Costas Busch - RPI78 Time 3

Costas Busch - RPI79 Time 4

Costas Busch - RPI80 Time 5

Costas Busch - RPI81 Time 6

Costas Busch - RPI82 Time 7

Costas Busch - RPI83 Time 8

Costas Busch - RPI84 Time 9

Costas Busch - RPI85 Time 10

Costas Busch - RPI86 Time 11

Costas Busch - RPI87 HALT & accept Time 12

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

Costas Busch - RPI89 Start Finish final state initial state

Costas Busch - RPI90 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

Costas Busch - RPI91 Turing Machine for

Costas Busch - RPI92 Example Start Finish

Costas Busch - RPI93 Another Example The function is computable if

Costas Busch - RPI94 Turing Machine for Input: Output: or if

Costas Busch - RPI95 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

Costas Busch - RPI96 Combining Turing Machines

Costas Busch - RPI97 Block Diagram Turing Machine inputoutput

Costas Busch - RPI98 Example: if Comparer Adder Eraser