cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Similar documents
Fundamentals of Computer Science

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Introduction to Turing Machines

CS21 Decidability and Tractability

Chapter 3: The Church-Turing Thesis

CSCC63 Worksheet Turing Machines

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

Most General computer?

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite

ECS 120 Lesson 15 Turing Machines, Pt. 1

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Computability Theory. CS215, Lecture 6,

Turing Machines (TM) The Turing machine is the ultimate model of computation.

Lecture 13: Turing Machine

Introduction to Turing Machines. Reading: Chapters 8 & 9

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

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Turing Machines. Lecture 8

CSE 105 THEORY OF COMPUTATION

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM)

Theory of Computation (IX) Yijia Chen Fudan University

CS4026 Formal Models of Computation

CSCE 551: Chin-Tser Huang. University of South Carolina

The Turing machine model of computation

Decidable Languages - relationship with other classes.

Turing Machines Part II

Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012

CSE 105 Theory of Computation

Turing Machines. Chapter 17

1 Showing Recognizability

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

COMPARATIVE ANALYSIS ON TURING MACHINE AND QUANTUM TURING MACHINE

Computation Histories

An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Theory of Computation

CSE 460: Computabilty and Formal Languages Turing Machine (TM) S. Pramanik

Decidability: Church-Turing Thesis

1 Unrestricted Computation

Turing machines COMS Ashley Montanaro 21 March Department of Computer Science, University of Bristol Bristol, UK

Variants of Turing Machine (intro)

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 16 : Turing Machines

Turing machines Finite automaton no storage Pushdown automaton storage is a stack What if we give the automaton a more flexible storage?

Computability and Complexity

Turing machines and linear bounded automata

Theory of Computation - Module 4

Turing Machines. Nicholas Geis. February 5, 2015

CSci 311, Models of Computation Chapter 9 Turing Machines

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar

Decidability (intro.)

The Church-Turing Thesis

Chapter 8. Turing Machine (TMs)

Equivalence of TMs and Multitape TMs. Theorem 3.13 and Corollary 3.15 By: Joseph Lauman

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

IV. Turing Machine. Yuxi Fu. BASICS, Shanghai Jiao Tong University

Theory of Computation

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,

Turing machines and linear bounded automata

Busch Complexity Lectures: Turing Machines. Prof. Busch - LSU 1

Lecture 12: Mapping Reductions

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM

TURING MAHINES

The purpose here is to classify computational problems according to their complexity. For that purpose we need first to agree on a computational

Turing machines and linear bounded automata

Non-emptiness Testing for TMs

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 14 : Turing Machines

Theory of Computation Lecture Notes. Problems and Algorithms. Class Information

Functions on languages:

Lecture notes on Turing machines

Automata Theory (2A) Young Won Lim 5/31/18

Part I: Definitions and Properties

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

UNIT 1 TURING MACHINE

Turing Machines. Wolfgang Schreiner

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

Turing Machines. 22c:135 Theory of Computation. Tape of a Turing Machine (TM) TM versus FA, PDA

Theory of Computation

Decidability (What, stuff is unsolvable?)

Chapter 7 Turing Machines

Homework Assignment 6 Answers

DM17. Beregnelighed. Jacob Aae Mikkelsen

The Power of One-State Turing Machines

More Turing Machines. CS154 Chris Pollett Mar 15, 2006.

Turing Machines. The Language Hierarchy. Context-Free Languages. Regular Languages. Courtesy Costas Busch - RPI 1

UNRESTRICTED GRAMMARS

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama

Decidability. Human-aware Robotics. 2017/10/31 Chapter 4.1 in Sipser Ø Announcement:

The Turing Machine. CSE 211 (Theory of Computation) The Turing Machine continued. Turing Machines

CS151 Complexity Theory. Lecture 1 April 3, 2017

CSCI3390-Assignment 2 Solutions

Decidability. William Chan

Theory of Computation Turing Machine and Pushdown Automata

Equivalent Variations of Turing Machines

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama

Undecidable Problems and Reducibility

15-251: Great Theoretical Ideas in Computer Science Lecture 7. Turing s Legacy Continues

Lecture 14: Recursive Languages

Transcription:

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

LECTURE 13

CHAPTER 4 TURING MACHINES 1. The definition of Turing machine 2. Computing with Turing machines 3. Extensions of Turing machines

CHAPTER 5 UNDECIDABILITY 1. The Church-Turing thesis 2. Universal Turing machines 3. Undecidable problems about Turing machines

CHAPTER 4 TURING MACHINES 1. The definition of Turing machine 2. Computing with Turing machines 3. Extensions of Turing machines

The definition of Turing machine A bit of HISTORY The Turing machine was invented in 1936 by Alan Turing - hence the name From Wikipedia:. Alan Mathison Turing (23 June 1912 7 June 1954), was a British mathematician, logician, cryptanalyst, and computer scientist He was highly influential in the development of computer science, giving a formalization of the concepts of algorithm and computation with the Turing machine, which can be considered a model of a general purpose computer. Turing is widely considered to be the father of computer science and artificial intelligence

Short History Finite and Pushdown automata were developed in 1960ties Their definition is based on the Turing Machine but simplified to fit different needs Context-free Grammars were developed after Chomsky work published 1957 From Wikipedia:. Avram Noam Chomsky (born December 7, 1928) is an American linguist, philosopher, cognitive scientist, logician, political commentator and activist Sometimes described as the father of modern linguistics Chomsky has spent most of his career at the Massachusetts Institute of (MIT), where he is currently Professor Emeritus, and has authored over 100 books He has been described as a prominent cultural figure, and was voted the world s top public intellectual in a 2005 poll.

The definition of Turing machine Finite and Pushdown automata can t be regarded as truly general models of computers, or computations because they can t recognize even such simple languages as L = {a n b n c n : n 0} Turing machines can recognize those- and more complicated languages and much more! Turing machines are not automata, but are similar in their design

The definition of Turing machine The main idea of the TMachine is similar to the Finite and Pushdown automata; We also have a tape, a finite control module and a reading head We assume that the tape has a special symbol for the leftmost end of the tape We can have the Turing Machines models without it

The definition of Turing machine Turing Machine consists of a Finite Control unit, a tape, and a read/write head that moves in both directions The read/write head reads symbols from the tape and is also used to change symbols on the tape T Machine can move the head one square at the time We visit only a finite number of squares during a finite computation

The definition of Turing machine Finite Control at each step performs 2 functions dependent on a current state and a symbol scanned by the reading head Function 1: puts the FC unit in a new state Function 2: performs either; (a) writes a symbol in the tape square currently scanned, replacing the one already there; or (b) moves the read/write head one tape square to the left or right The tape has left end, but it extends indefinitely to the right

The definition of Turing machine To prevent the machine from moving its head off the left end of the tape we assume that the tape has always a special symbol for the leftmost end of the tape We also assume that all our T Machines are so designed that, whenever the head reads a symbol, it immediately moves to the right We use the distinct symbols and to denote movement of the head to the left and the right, respectively The symbols and are not members of any alphabet we consider The symbol is never erased

The definition of Turing machine T Machine is supplied with input by writing the input string on the tape immediately after the symbol The rest of the tape initially contains blank symbols, denoted by T Machine is free to alter its input It also can write on the unlimited blank portion of the tape to the right

Turing Machine Mathematical Model Definition A Turing Machine is a quintuple where K Σ Σ Σ is a finite set of states TM = (K, Σ, δ, s, H) as an alphabet contains a blank symbol and a left end symbol does not contain symbols and s K is the initial state H K is the set of halting states We usually use different symbols for K, Σ, i.e. we have that K Σ =

Turing Machine Mathematical Model Turing Machine components continue δ is a transition function δ : (K H) Σ K (Σ {, }) such that the following conditions hold 1. If δ(q, ) = (p, b) then b = 2. If δ(q, a) = (p, b) then b Observe that δ deterministic is a function, so Turing Machine is always

Operation of Turing machine If q K H, a Σ and δ(q, a) = (p, b) then TM in state q scanning a on the tape will enter state p and

Operation of Turing machine TM stops only when enters a halting state h H Observe that δ is not defined for h H TM has also two extra requirements - the two extra conditions in the definition of δ Condition 1. If TM sees (end of the tape) then TM must move right: If δ(q, ) = (p, b) then b = It means that symbol is never erased and TM never gets out of the tape

Operation of Turing machine Condition 2. of the definition of δ is If δ(q, a) = (p, b) then b It says that TM never writes on Observe that the conditions 1. and 2. guarantee that the symbol is well defined and acts a protective barrier

Turing Machine Examples Example 1 Let M = (K, Σ, δ, s, H) where K = {q 0, q 1, h}, s = q 0, Σ = {a,, }, H = {h} and δ is given by the table

Examples Operation of M - lets look at δ again M starts at q 0, changes a to (erases a) and goes to q 1 When M in q 1 sees a - and goes to q 0 - and q 0 erases a When M in q 0 sees - M halts When M in q 1 sees - M goes to q 0 and moves right

Examples Operation of M Remark: assignment δ(q 1, a) = (q 0, a) is irrelevant because M never can be in state q 1 scanning a) if it started at q 0 - THIS is like a TRAP State; δ must be a function Here a computation of M

Turing Machine Examples Example 2 Let M = (K, Σ, δ, s, H) where K = {q 0, h}, s = q 0, Σ = {a,, }, H = {h} and δ is given by the table If every tape square from the head position to the left contains an a the M will go to the left end of the tape and then M indefinitely goes between the left end and the square to its right Operation of M may never stop

Formal Definition Formal definition of operation of Turing Machine is similar to the one for FA and PD automata We define first a notion of a configuration Configuration of M is any element Picture (q, w, u) K Σ (Σ (Σ { }) {e})

Configuration Configuration/not Configuration examples Picture

Configuration Configuration shorthand notation Picture Halted Configuration is a configuration whose state components is in H

Transition Relation Given a set S of all configurations of M S K Σ (Σ (Σ { }) {e}) The transition relation acts between two configurations and hence M is a certain binary relation defined on S S, i.e. M (K Σ (Σ (Σ { }) {e})) 2 We write and say C 1 YIELDS C 2 Formal definition follows C 1 M C 2

Transition Relation Definition of C 1 M C 2 and either

and either Transition Relation

Computation Given a transition relation M We denote as usual, its reflexive, transitive closure is denoted by M and C 1 M C n is a computation of the length n in M from C 1 By definition of M we have that to C n C 1 M C n if and only of C 1 M C 2 M... M C n

Computation Let M be the Turing Machine from Example 1 that scans the tape to the right changing a s to until finds a blank and then halts Here is a computation of M of lengths 10

CHAPTER 4 TURING MACHINES 1. The definition of Turing machine 2. Computing with Turing machines 3. Extensions of Turing machines

Computing with Turing machines Consider a Turing Machine for y n H = {y, n} where TM = (K, Σ, δ, s, H) denotes accepting configuration denotes rejecting configuration TM accepts a word w (Σ {, }) if and only if the initial configuration (s, w) on input word w yields an accepting configuration TM rejects a word w (Σ {, }) if and only if the initial configuration (s, w) on input word w yields an rejecting configuration

Computing with Turing machines Given TM = (K, Σ, δ, s, H) for H = {y, n} The alphabet Σ 0 = Σ { } is called an input alphabet of TM By fixing Σ 0 to be subset of Σ { }we allow out Turing machine to use extra symbols during their computation, besides those appearing in their inputs Definition The Turing machine TM decides a language L Σ 0, if for any word w Σ 0 the following is true If w L, then then TM accepts w; and if w L then TM rejects w

Computing with Turing machines Definition A language L Σ 0 is recursive if there is a Turing machine TM that decides it Observe that a Turing machine decides a language L if, when started with input w Σ 0, it always halts, and does so in a halt state that is the correct response to the input, namely it is y if w L and n if w L Notice that no guarantees are given about what happens if the input to TM contains blanks or the left end symbol

Computing with Turing machines Let f be any function from Σ 0 to Σ 0 A Turing machine TM computes function f if for all w Σ 0 TM eventually halts on input w, and when it does halt, its tape contains the string f(w) Definition A function f is called recursive, if there is a Turing machine TM that computes f

Computing with Turing machines Definition A Turing machine csemidecides a language L Σ 0 if for any word w Σ 0 the following is true: w L if and only if TM halts on input w Definition A language L Σ 0 is recursively enumerable if there is a Turing machine TM that semidecides it Observe that when in this case TM is presented with input w L, it is required to halt eventually; we do not care precisely which halting configuration it reaches, as long as it does eventually arrive at a halting configuration

Two important Theorems Theorem 1 If a language is recursive then it is recursively enumerable Theorem 2 If L Σ 0 is a recursive language, then its complement Σ 0 L is also recursive

CHAPTER 4 TURING MACHINES 1. The definition of Turing machine 2. Computing with Turing machines 3. Extensions of Turing machines

Extensions of Turing machines Multiple tapes ORIGINAL Turing Machine 1936: Two way infinite tape Two dimentional tape Random access machines Non-deterministic machines Theorem All models of Turing Machine are computationally equivalent to the standard TM

ChurchTuring Thesis A Turing machine that is able to simulate any other Turing machine is called a universal Turing machine UTM, or simply a universal machine A more mathematically-oriented definition with a similar universal nature was introduced by Alonzo Church Church work on lambda calculus intertwined with Turing s in a formal theory of computation known as the ChurchTuring thesis The ChurchTuring thesis states that Turing machines indeed capture the informal notion of effective method in logic and mathematics, and provide a precise definition of an algorithm or mechanical procedure Studying their abstract properties yields many insights into computer science and complexity theory