Courtesy Costas Busch - RPI1 Turing Machines. Courtesy 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
Courtesy Costas Busch - RPI1 NPDAs Accept Context-Free Languages.
Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Courtesy Costas Busch - RPI1 Turing’s Thesis. Courtesy Costas Busch - RPI2 Turing’s thesis: Any computation carried out by mechanical means can be performed.
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 ? ?
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:
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:

Courtesy Costas Busch - RPI1 Turing Machines

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

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

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

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

Courtesy 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

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

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

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

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

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

Courtesy Costas Busch - RPI12 Example: Time 1 current state

Courtesy Costas Busch - RPI Time Time 2

Courtesy Costas Busch - RPI Time Time 2 Example:

Courtesy Costas Busch - RPI Time Time 2 Example:

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

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

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

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

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

Courtesy 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

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

Courtesy Costas Busch - RPI23 Time 0

Courtesy Costas Busch - RPI24 Time 1

Courtesy Costas Busch - RPI25 Time 2

Courtesy Costas Busch - RPI26 Time 3

Courtesy Costas Busch - RPI27 Time 4 Halt & Accept

Courtesy Costas Busch - RPI28 Rejection Example Time 0

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

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

Courtesy Costas Busch - RPI31 Time 0

Courtesy Costas Busch - RPI32 Time 1

Courtesy Costas Busch - RPI33 Time 2

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

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

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

Courtesy Costas Busch - RPI37 Time 0

Courtesy Costas Busch - RPI38 Time 1

Courtesy Costas Busch - RPI39 Time 2

Courtesy Costas Busch - RPI40 Time 3

Courtesy Costas Busch - RPI41 Time 4

Courtesy Costas Busch - RPI42 Time 5

Courtesy Costas Busch - RPI43 Time 6

Courtesy Costas Busch - RPI44 Time 7

Courtesy Costas Busch - RPI45 Time 8

Courtesy Costas Busch - RPI46 Time 9

Courtesy Costas Busch - RPI47 Time 10

Courtesy Costas Busch - RPI48 Time 11

Courtesy Costas Busch - RPI49 Time 12

Courtesy Costas Busch - RPI50 Halt & Accept Time 13

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

Courtesy Costas Busch - RPI52 Formal Definitions for Turing Machines

Courtesy Costas Busch - RPI53 Transition Function

Courtesy Costas Busch - RPI54 Transition Function

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

Courtesy Costas Busch - RPI56 Configuration Instantaneous description:

Courtesy Costas Busch - RPI57 Time 4Time 5 A Move:

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

Courtesy Costas Busch - RPI59 Equivalent notation:

Courtesy Costas Busch - RPI60 Initial configuration: Input string

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

Courtesy 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:

Courtesy Costas Busch - RPI63 Computing Functions with Turing Machines

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

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

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

Courtesy 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

Courtesy 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

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

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

Courtesy Costas Busch - RPI71 Start Finish final state initial state

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

Courtesy Costas Busch - RPI73 Turing machine for function

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

Courtesy Costas Busch - RPI75 Time 0

Courtesy Costas Busch - RPI76 Time 1

Courtesy Costas Busch - RPI77 Time 2

Courtesy Costas Busch - RPI78 Time 3

Courtesy Costas Busch - RPI79 Time 4

Courtesy Costas Busch - RPI80 Time 5

Courtesy Costas Busch - RPI81 Time 6

Courtesy Costas Busch - RPI82 Time 7

Courtesy Costas Busch - RPI83 Time 8

Courtesy Costas Busch - RPI84 Time 9

Courtesy Costas Busch - RPI85 Time 10

Courtesy Costas Busch - RPI86 Time 11

Courtesy Costas Busch - RPI87 HALT & accept Time 12

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

Courtesy Costas Busch - RPI89 Start Finish final state initial state

Courtesy 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

Courtesy Costas Busch - RPI91 Turing Machine for

Courtesy Costas Busch - RPI92 Example Start Finish

Courtesy Costas Busch - RPI93 Another Example The function is computable if

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

Courtesy 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

Courtesy Costas Busch - RPI96 Combining Turing Machines

Courtesy Costas Busch - RPI97 Block Diagram Turing Machine inputoutput

Courtesy Costas Busch - RPI98 Example: if Comparer Adder Eraser