 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar

Slides:



Advertisements
Similar presentations
Turing Machines Memory = an infinitely long tape Persistent storage A read/write tape head that can move around the tape Initially, the tape contains only.
Advertisements

Introduction to Computability Theory
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
Variants of Turing machines
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
Turing Machines (At last!). Designing Universal Computational Devices Was Not The Only Contribution from Alan Turing… Enter the year 1940: The world is.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
Turing Machines New capabilities: –infinite tape –can read OR write to tape –read/write head can move left and right q0q0 input tape.
CS5371 Theory of Computation Lecture 11: Computability Theory II (TM Variants, Church-Turing Thesis)
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.
Lecture 5 Turing Machines
Computation Theory Introduction to Turing Machine.
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 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.
AUTOMATA THEORY VIII.
More Theory of Computing
Complexity and Computability Theory I Lecture #13 Instructor: Rina Zviel-Girshin Lea Epstein Yael Moses.
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.
CSCI 2670 Introduction to Theory of Computing September 28, 2005.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Part 1 – Pages COMPUTABILITY THEORY.
Computer Science 101 Theory of Computing. Computer Science is... The study of algorithms, with respect to –their formal properties –their linguistic realizations.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich
Lecture 9  2010 SDU Lecture9: Turing Machine.  2010 SDU 2 Historical Note Proposed by Alan Turing in 1936 in: On Computable Numbers, with an application.
Lecture 17 Undecidability Topics:  TM variations  Undecidability June 25, 2015 CSCE 355 Foundations of Computation.
CS 3240: Languages and Computation
CSCI 2670 Introduction to Theory of Computing October 7, 2004.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
Lecture 16b Turing Machines Topics: Closure Properties of Context Free Languages Cocke-Younger-Kasimi Parsing Algorithm June 23, 2015 CSCE 355 Foundations.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
1 Introduction to Turing Machines
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
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 ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CSCI 2670 Introduction to Theory of Computing September 29, 2005.
Theory of Computation Automata Theory Dr. Ayman Srour.
Complexity and Computability Theory I
Busch Complexity Lectures: Turing Machines
Turing Machines.
CS21 Decidability and Tractability
Pumping Lemma Revisited
CSE 105 theory of computation
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
Turing Machines Acceptors; Enumerators
Turing Machines (At last!).
Chapter 3: The CHURCH-Turing thesis
فصل سوم The Church-Turing Thesis
CSE 105 theory of computation
CS21 Decidability and Tractability
MA/CSSE 474 Theory of Computation
Decidability and Tractability
CSE 105 theory of computation
CSE 105 theory of computation
Instructor: Aaron Roth
Intro to Theory of Computation
CSE 105 theory of computation
CSE 105 theory of computation
Presentation transcript:

 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar

Recalling  A finite automata is a computational model that has a limited quantity of memory available.  They are good models for devices that have a small amount of memory.  A pushdown automata is a computational model that has a unlimited quantity of memory available but possesses some restrictions in they way it can use it.  LIFO memory management.

Important Observation  The previous models don’t have the sufficient properties to represent a general purpose computational model.

TMs  We introduce the most powerful of the automata we will study: Turing Machines (TMs)  Invented by Alan Turing in  TMs can compute any function normally considered computable  Indeed we can define computable to mean computable by a TM

Turing Machines  A Turing machine (TM) can compute everything a usual computer program can compute  may be less efficient  But the computation allows a mathematical analysis of questions like :  What is computable?  What is decidable?  What is complexity?

State control aaba input --- A Turing Machine is a theoretical computer consisting of a tape of infinite length and a read-write head which can move left and right across the tape.

Informal definition  TMs uses an infinite memory (tape)  Tape initially contain input string followed by blanks  When started, a TM executes a series of discrete transitions, as determined by its transition function and by the initial characters on the tape

Informal definition  For each transition, the machine checks  what state it is in and what character is written on the tape below the head.  Based on those, it then changes to a new state, writes a new character on the tape, and moves the head one space left or right.  The machine stops after transferring to the special HALT (accept or reject) state.  If TM doesn’t enter a HALT state, it will go on forever

Differences between FA and TMs  A TM can both write on the tape and read from it  The read-write head can move both to the left and to the right  The tape is infinite  The special states of rejecting and accepting take immediate effect

Examples aa,Raa,R ba,Rba,R a  a,R means TM reads the symbol a, it replaces it with a and moves head to right This TM when reading an a will move right one square stays in the same start state. When it scans a b, it will change this symbol to an a and go into the other state (accept state).

Examples  A TM (M1) that tests for memberships in the language  B= {w#w | w belongs to {0,1}*}  We want to design M1 to accept if its input is a member of B.  Idea:  Zig-zag across tape, crossing off matching symbols

Machine M1 Design  M1 makes multiple passes over the input string with the read-write head.  On each pass it matches one of the characters on each side of the # symbol.  To keep track of which symbols have been checked already, M1 crosses off each symbol as it is examined.

Machine M1 Design  If it crosses off all the symbols, that means that everything matched successfully, and M1 goes into an accept state.  If it discovers a mismatch, it enters a reject state.

M1: Algorithm

Examples: M1  Tape head starts over leftmost symbol  Record symbol in control and overwrite X  Scan right: reject if blank encountered before #  When # encountered, move right one space  If symbols don’t match, reject abb#abbXbb#abbXbb#abbb

Examples  Overwrite X  Scan left, past # to X  Move one space right  Record symbol and overwrite X  When # encountered, move right one space  If symbols don’t match, reject XXb#XbbbXbb#XbbbXXb#Xbb

Examples  Finally scan left  If a or b encountered, reject  When blank encountered, accept bXXX#XXX

Formal Definition  A Turing Machine is a 7-tuple (Q,∑,T, ξ,q0,q accept, q reject ), where  Q is a finite set of states  ∑ is a finite set of symbols called the alphabet  T is the tape alphabet, where – belongs to T, and ∑ ⊆ T  ξ : Q x T  Q x T x {L,R} is the transition function  q0 Є Q is the start state  q accept ⊆ Q is the accept state  q reject ⊆ Q is the reject state, where q accept ≠ q reject

Transition function  ξ : Q x T  Q x T x {L,R} is the transition function ξ (q,a) = (r,b,L) means in state q where head reads tape symbol a the machine overwrites a with b enters state r move the head left

Workings of a TM  M = (Q,∑,T, ξ,q0,q accept, q reject ) computes as follows  Input w=w1w2…wn is on leftmost n tape squares  Rest of tape is blank –  Head is on leftmost square of tape

Workings of a TM  M = (Q,∑,T, ξ,q0,q accept, q accept )  When computation starts  M Proceeds according to transition function ξ  If M tries to move head beyond left-hand-end of tape, it doesn’t move  Computation continues until q accept or q accept is reached  Otherwise M runs forever

Configurations  Computation changes  Current state  Current head position  Tape contents

Configurations  Configuration  1011r0111  Means  State is r  Left-Hand-Side (LHS) is 1011  Right-Hand-Side (RHS) is 0111  Head is on RHS 0

Configurations  uarbv yields upacv if  ξ (r,b) = (p,c,L)  uarbv yields uacpv if  ξ (r,b) = (p,c,R)  Special cases: rbv yields pcv if  ξ (r,b) = (p,c,L)  The head moves (tries) to the left, so it only overwrites if it is in the extreme left end.  wr is the same as wr– (right hand end)

More configurations  We have  starting configuration q0w  Indicates machine is in a start state q0 with its head at the leftmost position.  accepting configuration w0q accept w1  rejecting configuration w0q reject w1  halting configurations  w0q accept w1  w0q reject w1

Observations  The accept and reject configurations do not derive in further configurations (or states).

Accepting a language  TM M accepts input w if a sequence of configurations C 1,C 2,…,C k exist  C 1 is start configuration of M on w  Each C i yields C i+1  C k is an accepting configuration

TM Language  The collection of strings that M accepts is the language of M, denoted by L(M).

Detailed example

Detailed Example  Do the following test runs:  q 1 0.  q  q  q

Detailed Example  Sample run for q

Software:  JFLAP (  DEMO:

Exercise 2:  B= {w#w | w belongs to {0,1}*}

Exercise 2  Design the state transition diagram based on the previous informal definition of the turing machine M3.  Test the diagram with #  Transfer the diagram to JFLAP

State Diagram

Enumerable languages  Definition: A language is ( recursively ) enumerable if some TM accepts it  In some other textbooks Turing-recognizable

Enumerable languages  On an input to a TM we may  accept  reject  loop (run for ever)  Not very practical: never know if TM will halt

Enumerable languages  Definition: A TM decides a language if it always halts in an accept or reject state. Such a TM is called a decider  A decider that recognizes some language is said to decide that language.  Definition: A language is decidable if someTM decides it  Some textbooks use recursive instead of decidable  Therefore, every decidable language is enumerable, but not the reverse!

Example of decidable language  Here is a decidable language  L={a i b j c k | ix j = k, I,j,k > 0}  Because there exist a TM that decides it  How?

Example of decidable language  How? 1. Scan from left to right to check that input is of the form a*b*c* 2. Return to the start 3. Cross off an a and 4. scan right till you see a b 5. Mark each b and scan right till you see a c 6. Cross off that c 7. Move left to the next b, and repeat previous two steps until all b’s are marked 8. Unmark all b’s and go to the start of the tape 9. Goto step 1 until all a’s are crossed off 10. Check if all c’s are crossed off; if so accept; otherwise reject

TM: Variants  Turing Machine head stays put  Does not add any power  Three possible states for the tape {L,R, S }  Nondetermisim added to TMs  Does not add any power  Halting states may produce transitions.

Remarks  Many models have been proposed for general-purpose computation  Remarkably all “reasonable” models are equivalent to Turing Machines  All ”reasonable” programming languages like C, C++, Java, Prolog, etc are equivalent  The notion of an algorithm is model-independent!