Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0

Similar documents
Chapter 3: The Church-Turing Thesis

CS21 Decidability and Tractability

CSCC63 Worksheet Turing Machines

CS4026 Formal Models of Computation

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

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

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

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

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

Computability and Complexity

Part I: Definitions and Properties

Lecture 12: Mapping Reductions

The Church-Turing Thesis

Deterministic Finite Automata (DFAs)

Turing Machines Part II

TURING MAHINES

CpSc 421 Homework 9 Solution

Deterministic Finite Automata (DFAs)

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

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

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine

Chapter 1 - Time and Space Complexity. deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE

Most General computer?

Theory of Computation

SE 3310b Theoretical Foundations of Software Engineering. Turing Machines. Aleksander Essex

Turing Machines Part III

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

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

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Computability Theory. CS215, Lecture 6,

Deterministic Finite Automata (DFAs)

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

7.2 Turing Machines as Language Acceptors 7.3 Turing Machines that Compute Partial Functions

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

Computation Histories

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

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

Foundations of

Turing Machines. Fall The Chinese University of Hong Kong. CSCI 3130: Formal languages and automata theory

CSE 105 THEORY OF COMPUTATION

Introduction to Turing Machines

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

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

Languages, regular languages, finite automata

The Power of One-State Turing Machines

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 8 Nancy Lynch

Chapter 8. Turing Machine (TMs)

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

Reducability. Sipser, pages

Turing Machines. Lecture 8

Formal Definition of Computation. August 28, 2013

Introduction to Turing Machines. Reading: Chapters 8 & 9

Embedded systems specification and design

CS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)

Please give details of your answer. A direct answer without explanation is not counted.

Further discussion of Turing machines

Computable Functions

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2. March 30, Please write your name in the upper corner of each page.

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

jflap demo Regular expressions Pumping lemma Turing Machines Sections 12.4 and 12.5 in the text

Chapter Two: Finite Automata

Computability Theory

CS 154. Finite Automata, Nondeterminism, Regular Expressions

1 Unrestricted Computation

CSCI3390-Assignment 2 Solutions

The Turing machine model of computation

Deterministic Finite Automata (DFAs)

CSE 105 THEORY OF COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

CS 361 Meeting 26 11/10/17

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

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

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

1 Showing Recognizability

COMPARATIVE ANALYSIS ON TURING MACHINE AND QUANTUM TURING MACHINE

Lecture 14: Recursive Languages

Let us first give some intuitive idea about a state of a system and state transitions before describing finite automata.

Theory of Computation - Module 4

Theory of Computation

Lecture Notes: The Halting Problem; Reductions

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

Non-emptiness Testing for TMs

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

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

Chapter 7 Turing Machines

Lecture 13: Turing Machine

Turing Machine Recap

Theory of Computation

Turing Machines. Chapter 17

Turing machines and computable functions

Undecidable Problems and Reducibility

Languages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA)

Opleiding Informatica

Nondeterministic Finite Automata

Formal Definition of a Finite Automaton. August 26, 2013

Turing Machines. Nicholas Geis. February 5, 2015

CSE 105 Theory of Computation

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

Transcription:

Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0

Turing Machines Now for a machine model of much greater power. A Turing machine has an infinite tape through which it takes its input and performs its computations. state control tape head b a a Unlike a finite automaton it can infinite tape both read from and write to the tape, and move either left or right over the tape. The tape is infinite. The machine has both accept and reject states, in which it accepts/rejects irrespective of where its tape head is. 9-1

Turing Machines Formally A Turing machine is a 7-tuple M = (Q, Σ, Γ, δ, q 0, q a, q r ) where Q is a finite set of states, Γ is a finite tape alphabet, which includes the blank character,, Σ Γ \ {} is the input alphabet, δ : Q Γ Q Γ {L, R} is the transition function, q 0 is the initial state, q a is the accept state, and q r ( q a ) is the reject state. 9-2

The Transition Function A transition δ(q i, x) = (q j, y, d) depends on two things 1. current state q i, and 2. current symbol x under the tape head It consists of three actions 1. change state to q j, 2. over-write tape symbol x by y, and 3. move the tape head in direction d. We can have a graphical notation for Turing machines similar to that for finite automata. On an arrow from q i to q j we write x d when δ(q i, x) = (q j, x, d), and x y, d when δ(q i, x) = (q j, y, d), y x. 9-3

Example Turing Machine b R a R q 0 q 1 b R R R a R q a This machines recognises the regular language (a b) aa(a b). We can leave q r out with the understanding that transitions that are not specified go to q r. q r 9-4

Turing Machine Configurations We write uqv for this configuration: u v blank q On input aba, the example machine goes through these configurations: ǫq 0 aba (or just q 0 aba) aq 1 ba abq 0 a abaq 1 abaq r We read the relation as yields. 9-5

Computations Formally For all q i, q j Q, a, b, c Γ, and u, v Γ, we have uq i bv ucq j v if δ(q i, b) = (q j, c, R) q i bv q j cv if δ(q i, b) = (q j, c, L) uaq i bv uq j acv if δ(q i, b) = (q j, c, L) The start configuration of M on input w is q 0 w. M accepts w iff there is a sequence of configurations C 1, C 2,...,C k such that 1. C 1 is the start configuration q 0 w, 2. C i C i+1 for all i {1...k 1}, and 3. The state of C k is q a. 9-6

Turing Machines and Languages The set of strings accepted by M is the language of M, L(M). A language A is Turing-recognisable (or computably enumerable, or just c. e.) iff A = L(M) for some Turing machine M. Three behaviours are possible for M on input w: M may accept w, reject w, or fail to halt. If A is recognised by a Turing machine M that halts on all input, we say that M decides A. A language is Turing-decidable (or computable, or just decidable) iff some Turing machine decides it. 9-7

Turing Machine Example 2 This machine decides the language {0 2n n 0}. It has input alphabet {0} and tape alphabet {, 0, x, #}. x R x R q 0 #,R 0 q 0 x,r 1 q 2 R # R q a q 4 L 0 R 0 x,r 0 L x L q 3 x R Running the machine on input 000: q 0 000 #q 1 00 #xq 2 0 #x0q 3 #x0q r 9-8

Turing Machine Example 2 (cont.) This machine decides the language {0 2n n 0}. We can describe how this machine operates as follows: M 2 = On input string w: 1. Read tape from left to right crossing off every second 0. 2. If the tape contained a single 0, accept. 3. If the tape contained another odd number of 0s, reject. 4. Return to the left of the tape. 5. Go to step 1. 9-9

Turing Machine Example 3 This machine decides the language {a i b j c k k = i j, i, j > 0}. The tape alphabet is {, a, b, c, A, B, C}. a R a A,R b B,R a L b R A R a L b L B R A R b L B b,l c C,L B b,l q a C R L C R b R C R C L 9-10

Turing Machine Example 3 This machine decides the language {a i b j c k k = i j, i, j > 0}. The machine operates as follows: M 3 = On input string w: 1. Cross off the first a, and scan to the right for the first b. Alternately cross off the first b and the first c until all bs are gone. 2. Move left to the last crossed-off a, restoring the crossed-off bs. If there is another a, return to step 1. Otherwise, move right past all crossed-off bs and cs. If no c s remain, accept, else reject. 9-11

Robustness of Turing Machines Other textbooks have definitions of Turing machines that differ slightly from Sipser s. Some differences are technical and aim at making the machines easier to program (for example, we may insist that machines start with a tape that has the first cell blank, and they try to leave that cell blank to make it easier to compose machines). Similarly, in addition to the two kinds of tape movement, we can allow a no move option. Turing machines are robust in the sense that such changes to the machinery does not effect what the machines are capable of computing. In the next lecture we ll see that the robustness of Turing machines goes well beyond that. 9-12

Functionality of Turing Machines We can also decide that a Turing machine produces output (not just accept/reject) through its tape. This means that Turing machines can be general computing devices, not just language recognisers. We can capture data other than strings through suitable representations. For example, natural numbers can be represented as strings of (unary, binary, decimal,...) digits, so a Turing machine can compute number theoretic functions N N. Or, by suitable encoding, they can take multiple arguments, and/or return multiple results. Turing machines can also solve graph problems, once we decide on a suitable representation for graphs. 9-13