CSCI 2670 Introduction to Theory of Computing September 28, 2005.

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
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
Turing Machines New capabilities: –infinite tape –can read OR write to tape –read/write head can move left and right q0q0 input tape.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 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
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Turing Machines.
CS 490: Automata and Language Theory Daniel Firpo Spring 2003.
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
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 ? ?
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
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.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Turing Machines Chapter Plan Turing Machines(TMs) – Alan Turing Church-Turing Thesis – Definitions Computation Configuration Recognizable vs. Decidable.
CS490 Presentation: Automata & Language Theory Thong Lam Ran Shi.
CSE202: Introduction to Formal Languages and Automata Theory Chapter 9 The Turing Machine These class notes are based on material from our textbook, An.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Models of Computation - Turing Machines Dale Roberts, Lecturer.
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.
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,
Theory of computing, part 4. 1Introduction 2Theoretical background Biochemistry/molecular biology 3Theoretical background computer science 4History of.
CS 3240: Languages and Computation
CSCI 2670 Introduction to Theory of Computing October 7, 2004.
Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous.
1 Section 13.1 Turing Machines A Turing machine (TM) is a simple computer that has an infinite amount of storage in the form of cells on an infinite tape.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
1 Course Overview Why this course “formal languages and automata theory?” What do computers really do? What are the practical benefits/application of formal.
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.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Unit – 5 : STATE MACHINES Syllabus: Languages and Grammars – Finite State Machines State machines and languages – Turing Machines – Computational Complexity.
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 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 ? ?
CSCI 2670 Introduction to Theory of Computing September 29, 2005.
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY * Read chapter 4 of the book for next time * Lecture9x.ppt.
Theory of Computation Automata Theory Dr. Ayman Srour.
CSCI 2670 Introduction to Theory of Computing September 22, 2004.
8. Introduction to Turing Machines
Busch Complexity Lectures: Turing Machines
Turing Machines.
CS21 Decidability and Tractability
Pumping Lemma Revisited
Pushdown Automata PDAs
Pushdown Automata PDAs
COSC 3340: Introduction to Theory of Computation
Turing Machines 2nd 2017 Lecture 9.
Chapter 9 TURING MACHINES.
Chapter 3: The CHURCH-Turing thesis
فصل سوم The Church-Turing Thesis
Non-Deterministic Finite Automata
8. Introduction to Turing Machines
CS21 Decidability and Tractability
Recall last lecture and Nondeterministic TMs
Decidability and Tractability
Computability Catch up last lecture. Turing machines. Variations
Presentation transcript:

CSCI 2670 Introduction to Theory of Computing September 28, 2005

Agenda This week –Turing machines –Read section 3.1

September 28, 2005 Announcements Tests will be returned tomorrow Tutorial sessions are suspended until further notice –Extended office hours while tutorials are suspended Monday 11:00 – 12:00 Tuesday 3:00 – 4:00 Wednesday 3:00 – 5:00

September 28, 2005 Recap to date Finite automata (both deterministic and nondeterministic) machines accept regular languages –Weakness: no memory Pushdown automata accept context- free grammars –Add memory in the form of a stack –Weakness: stack is restrictive

September 28, 2005 Turing machines Similar to a finite automaton –Unrestricted memory in the form of a tape Can do anything a real computer can do! –Still cannot solve some problems Church-Turing thesis: any effective computation can be carried out by some Turing machine

September 28, 2005 Touring machine schematic Control a b a ~ Initially tape contains the input string –Blanks everywhere else (denoted ~ in class … different symbol in book) Machine may write information on the tape

September 28, 2005 Touring machine schematic Control a b a ~ Can move tape head to read information written to tape Continues computing until output produced –Output values accept or reject

September 28, 2005 Touring machine schematic Control a b a ~ Turing machine results –Accept –Reject –Never halts We may not be able to tell result by observation

September 28, 2005 Differences between TM and FA 1.TM has tape you can read from and write to 2.Read-write head can be moved in either direction 3.Tape is infinite 4.Accept and reject states take immediate effect

September 28, 2005 Example How can we design a Turing machine to find the middle of a string? –If string length is odd, return middle symbol –If string length is even, reject string Make multiple passes over string Xing out symbols at end until only middle remains

September 28, 2005 Processing input 1.Check if string is empty  If so, return reject 2.Write X over first and last non-X symbols  After this, the head will be at the second X 3.Move left one symbol  If symbol is an X, return reject (string is even in length) 4.Move left one symbol  If symbol is an X, return accept (string is even in length) 5.Go to step 2

September 28, 2005 Example 00110~ –First check if string is empty –X first and last non-X symbols X011X~ –Move left one symbol X011X~ –Is symbol an X? No –Move left one symbol X011X~ –Is symbol an X? No –Write X over first and last non-X symbols

September 28, 2005 Example XX1XX~ –Move left one symbol XX1XX~ –Is symbol an X? No –Move left one symbol XX1XX~ –Is symbol an X? Yes –Return accept

September 28, 2005 Formal definition of a TM Definition: A Turing machine is a 7- tuple (Q, , , ,q 0,q accept,q reject ), where Q, , and  are finite sets and 1.Q is the set of states, 2.  is the input alphabet not containing the special blank symbol ~ 3.  is the tape alphabet, where ~  and , 4.  : Q  Q  {L,R} is the transition function,

September 28, 2005 What is the Transition Function?? Q = set of states,  = tape alphabet  : Q  Q  {L,R} Given: The current internal state  Q The symbol on the current tape cell Then  tells us what the TM does: Changes to new internal state  Q Either writes new symbol   Or moves one cell left or right

September 28, 2005 Formal definition of a TM Definition: A Turing machine is a 7- tuple (Q, , , ,q 0,q accept,q reject ), where Q, , and  are finite sets and 5.q 0  Q is the start state, 6.q accept  Q is the accept state, and 7.q reject  Q is the reject state, where q reject  q accept

September 28, 2005 Computing with a TM M receives input w = w 1 w 2 …w n  * on leftmost n squares of tape –Rest of tape is blank (all ~ symbols) Head position begins at leftmost square of tape Computation follows rules of  Head never moves left of leftmost square of the tape –If  says to move L, head stays put!

September 28, 2005 Completing computation Continue following  transition rules until M reaches q accept or q reject –Halt at these states May never halt if the machine never transitions to one of these states!

September 28, 2005 Another TM example We want to create a TM to add two numbers Use a simple tape alphabet {0,1} plus the blank symbol Represent a number n by a string of n+1 1’s terminated by a zero Input to compute 3+4 looks like this:

September 28, 2005 Result of the TM addition example Note that the TM is initially positioned on the leftmost cell of the input. When the TM halts in the accept state, it must also be on the leftmost cell of the output:

September 28, 2005 Breaking down the addition problem Good computer scientists like to simplify A successor TM appends a 1 to the right end of a string of 1’s

September 28, 2005 The successor subroutine The TM starts in the initial state s 0, positioned on the leftmost of a string of 1’s If it sees a 1, it writes a 1, moves right, and stays in state s 0 If it sees a 0, it writes a 1 and moves to

September 28, 2005 Successor subroutine state transitions (original state, input, new state, action)

September 28, 2005 TM state interpretation S 0 – the TM has seen only 1’s so far and is scanning right S 1 – the TM has seen its first zero and is scanning left S 2 – the TM has returned to the leftmost 1 and halts. View movie of this TM

September 28, 2005 From successor TM to addition TM The successor TM will join the two blocks of n+1 1’s and m+1 1’s into a single block of n+m+3 1’s To complete the computation, knock off two 1’s from left end (states s 2 and s 3 )

September 28, 2005 TM configurations The configuration of a Turing machine is the current setting –Current state –Current tape contents –Current tape location Notation uqv –Current state = q –Current tape contents = uv Only ~ symbols after last symbol of v –Current tape location = first symbol of v

September 28, 2005 Acknowledgements TM addition example from Stanford,