CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)

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
Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Variants of Turing machines
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Variants.
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.
Computation Theory Introduction to Turing Machine.
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 ? ?
AUTOMATA THEORY VIII.
Turing Machines A more powerful computation model than a PDA ?
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.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
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.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
Turing Machines – Decidability Lecture 25 Section 3.1 Fri, Oct 19, 2007.
Turing Machines Chapter 17. Languages and Machines SD D Context-Free Languages Regular Languages reg exps FSMs cfgs PDAs unrestricted grammars Turing.
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Part 1 – Pages COMPUTABILITY THEORY.
The Church-Turing Thesis Chapter 3 Giorgi Japaridze Theory of Computability.
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,
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Turing Machines.
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 3 Church-Turing Thesis Some slides are.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich
Formal Models of Computation
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.
CS 3240: Languages and Computation
CSCI 2670 Introduction to Theory of Computing October 7, 2004.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
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 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 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.
Universal Turing Machine
Complexity and Computability Theory I
Busch Complexity Lectures: Turing Machines
Turing Machines.
CS21 Decidability and Tractability
Turing Machines Chapter 17.
Intro to Theory of Computation
Pumping Lemma Revisited
CSE 105 theory of computation
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
Chapter 3: The CHURCH-Turing thesis
فصل سوم The Church-Turing Thesis
Intro to Theory of Computation
CSE 105 theory of computation
Decidable Languages Costas Busch - LSU.
CS21 Decidability and Tractability
MA/CSSE 474 Theory of Computation
Decidability and Tractability
CSE 105 theory of computation
CSE 105 theory of computation
Intro to Theory of Computation
CSE 105 theory of computation
CSE 105 theory of computation
Presentation transcript:

CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)

Objectives Introduce the Turing Machine (TM) –Proposed by Alan Turing in 1936 –finite-state control + infinitely long tape –A stronger computing device than the DFA or PDA

What is a TM? Control is similar to (but not the same as) DFA It has an infinite tape as memory A tape head can read and write symbols and move around the tape Initially, tape contains input string (on the leftmost end) and is blank everywhere control abab    = blank symbols

What is a TM? (2) Finite number of states: one for immediate accept, one for immediate reject, and others for continue Based on the current state and the tape symbol under the tape head, TM then decides the tape symbol to write on the tape, goes to the next state, and moves the tape head left or right When TM enters accept state, it accepts the input immediately; when TM enters reject state, it rejects the input immediately If it does not enter the accept or reject states, TM will run forever, and never halt

TM versus DFA Similarities: –Finite set of states Differences: –TM has an infinite tape and TM can both read and write on the tape Tape head can move both left and right –Input string of TM is stored in tape –The accept or reject states in TM take effect immediately

TM in Action Let us introduce a TM that recognizes the language B = { w#w | w is in {0,1}* } We want the TM to accept if the input is in B, and to reject otherwise What should the TM do?

TM in Action (2) Use multiple passes Starts matching corresponding chars, one on each side of # To keep track of which chars are checked already, TM crosses off each char as it is examined

Snapshots of Execution (1) 01100#01100   X1100#01100   X1100#01100   X1100#01100    Tape head moves to right

Snapshots of Execution (2) X1100#01100   X1100#01100   X1100#X1100   X1100#X1100    Tape head moves to left

Snapshots of Execution (3) X1100#X1100   X1100#X1100   XX100#X1100   XX100#X1100    Tape head moves to right

Snapshots of Execution (4) XX100#X1100   XX100#X1100   XX100#XX100   XX100#XX100    Tape head moves to left

Snapshots of Execution (5) XX100#XX100   XX100#XX100   XXX00#XX100   XXX00#XX100    Tape head moves to right

Snapshots of Execution (6) XXXXX#XXXX0   XXXXX#XXXXX   XXXXX#XXXXX    XXXXX#XXXXX   Tape head moves to left

Snapshots of Execution (7) XXXXX#XXXXX   XXXXX#XXXXX   XXXXX#XXXXX    XXXXX#XXXXX   accept Tape head moves to right

Example of TM Let us take a look of state diagram of a TM that recognizes { w#w | w in {0,1}* } We shall use the shorthand a  b, L to denote current tape symbol is changed from a to b after transition, and tape head moves to L

start #  #, R 1  X, R X  X, R   , R 0  0, R #  #, R X  X, R 1  X, L 0  X, L X  X, R #  #, L 0  X, R = accept state Reject state not shown for simplicity 1  1, R 0  0, R 1  1, R 0  0, L 1  1, L 0  0, L 1  1, L X  X, L

TM (Formal Definition) A TM is a 7-tuple (Q, , , , q 0, q Acc, q Rej ) –Q = finite set of states –  = finite input alphabet, where blank symbol    –  = finite tape alphabet, where    and    –  is the transition function of the form:  : Q x   Q x  x { L, R }, where L, R indicates whether the tape head moves left or right after the transition –q 0 is the start state –q Acc = accept state, q Rej = reject state

Computation of TM Let M = (Q, , , , q 0, q Acc, q Rej ) be a TM First, M receives input w = w 1 w 2 …w n   * on the leftmost n squares of the tape –Rest of tape is blank (i.e., filled with  ’s) –Note: as   , the first blank on the tape marks the end of input Once M has started, the computation proceeds according to the transition function

Computation of TM (2) (important) If M tries to move its head to the left of the leftmost end of tape, the head simply stays for that move The computation continues until M enters accept state or reject state. Otherwise, M goes on forever

Configuration of TM The configuration of a TM specifies the current state, and the current string in the tape, and the current location of the tape head When the configuration of a TM is: current state = q, current string w = uv with tape head over the first symbol of v, we write: u q v as a shorthand notation E.g., 1100 q represents the configuration of TM when tape is , current state is q 7, the tape head is over the 3 rd 0 in the tape

Configuration of TM (2) We say a configuration C yields another configuration C’ if the machine can go from C to C’ in a single transition step E.g., if  (q, b) = (q’, c, R) ua q bv yields uac q’ v –special case when off the left end: E.g., q bv yields q’ cv if  (q, b) = (q’, c, L) How to represent the start configuration?

Configuration of TM (3) More special cases: –In an accepting configuration, the current state is the accept state q Acc –In a rejecting configuration, the current state is the accept state q Rej –These two kinds of configuration are called halting configurations and will not yield further configurations

Acceptance of TM (Formal Definition) Turing Machine M= (Q, , , , q 0, q Acc, q Rej ) accepts input w if a sequence of configurations C 1, C 2, …, C k exists with –C 1 = q 0 w –For i = 1 to k-1, C i yields C i+1 –C k is an accepting configuration i.e., this indicates C 1 is the start configuration i.e., M moves according to transition function i.e., M enters accept state in the end

High Level Description of TM Full details of TM are sometimes tedious to describe Usually, we give high-level details instead (but must be precise for understanding) Let us describe the high-level details of a TM M 2 that recognizes the language { a i b j c k | i × j = k and i, j, k  1}

On any input string w 1. Scan the input and check if the string is in the form a + b + c + (rejects if not) (how?) 2. Return the head to left end of tape (how?) 3. Cross off an ‘a’. Scan right to find the first ‘b’. Zig-zag the input string, so that we match each ‘b’ with each ‘c’ by crossing off a ‘b’ and a ‘c’ each time. If not enough ‘c’, rejects 4. Restore all crossed ‘b’. Repeat Step 3 if there are ‘a’ remaining (how?) 5. If all ‘a’ are gone, check if all ‘c’ are crossed. If yes, accepts. If no, rejects

Turing-Recognizable Language We say a TM M recognizes a language L if M accepts all strings in L Question: How about strings not in L? A language is Turing-recognizable if some TM can recognize the language Turing-recognizable language has another name: recursively enumerable language

Turing-Decidable Language If TM runs, there are three outcomes: accept, reject, or TM loops forever We say a TM M decides a language L if M accepts all strings in L and M rejects all strings not in L (M is called a decider) A language is Turing-decidable if some TM can decide the language Turing-decidable language has another name: recursive language

Questions Let L’ be the complement of language L Is the following true? 1.If L is Turing-decidable, L is Turing- recognizable 2.If L is Turing-recognizable, L is Turing- decidable 3.If L is Turing-decidable, so is L’ 4.If L is Turing-recognizable, so is L’ 5.If both L and L’ are Turing-recognizable, L is Turing-decidable