Lecture 13: Turing Machine

Similar documents
Lecture 14: Recursive Languages

Lecture 2: Regular Expression

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

Lecture 1: Finite State Automaton

1 Unrestricted Computation

Turing Machines Part II

Most General computer?

CS20a: Turing Machines (Oct 29, 2002)

Fundamentals of Computer Science

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

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

CS21 Decidability and Tractability

CSE 105 THEORY OF COMPUTATION

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

CS20a: Turing Machines (Oct 29, 2002)

Introduction to Turing Machines

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

The Turing machine model of computation

Chapter 3: The Church-Turing Thesis

Turing Machines. Nicholas Geis. February 5, 2015

Introduction to Formal Languages, Automata and Computability p.1/42

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

Turing Machines. Lecture 8

Computation Histories

Introduction to Turing Machines. Reading: Chapters 8 & 9

Further discussion of Turing machines

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

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

ECS 120 Lesson 15 Turing Machines, Pt. 1

Computability and Complexity

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

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

Lecture 12: Mapping Reductions

Computability Theory. CS215, Lecture 6,

1 Showing Recognizability

The Church-Turing Thesis

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

Turing Machines. Wolfgang Schreiner

CSE 105 THEORY OF COMPUTATION

CpSc 421 Homework 9 Solution

CSE 105 THEORY OF COMPUTATION

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

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

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

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

Part I: Definitions and Properties

Busch Complexity Lectures: Turing s Thesis. Costas Busch - LSU 1

CS 301. Lecture 17 Church Turing thesis. Stephen Checkoway. March 19, 2018

CSci 311, Models of Computation Chapter 9 Turing Machines

SCHEME FOR INTERNAL ASSESSMENT TEST 3

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

Turing Machines Part III

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

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

CFGs and PDAs are Equivalent. We provide algorithms to convert a CFG to a PDA and vice versa.

Chapter Five: Nondeterministic Finite Automata

Chapter 7 Turing Machines

Variants of Turing Machine (intro)

Formal Definition of a Finite Automaton. August 26, 2013

CSCC63 Worksheet Turing Machines

Theory of Computation (IX) Yijia Chen Fudan University

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

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

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

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

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

Decidability: Church-Turing Thesis

Testing Emptiness of a CFL. Testing Finiteness of a CFL. Testing Membership in a CFL. CYK Algorithm

Equivalence of CFG s and PDA s

Introduction to Computability

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

Homework 8. a b b a b a b. two-way, read/write

Before We Start. Turing Machines. Languages. Now our picture looks like. Theory Hall of Fame. The Turing Machine. Any questions? The $64,000 Question

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

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

Outline 1 PCP. 2 Decision problems about CFGs. M.Mitra (ISI) Post s Correspondence Problem 1 / 10

V Honors Theory of Computation

Properties of Context-Free Languages. Closure Properties Decision Properties

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

Non-emptiness Testing for TMs

MTH401A Theory of Computation. Lecture 17

There are two main techniques for showing that problems are undecidable: diagonalization and reduction

UNRESTRICTED GRAMMARS

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

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

Languages, regular languages, finite automata

More About Turing Machines. Programming Tricks Restrictions Extensions Closure Properties

Theory of Computation

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

Advanced Undecidability Proofs

Nondeterministic Finite Automata

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

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

Turing Machines. Our most powerful model of a computer is the Turing Machine. This is an FA with an infinite tape for storage.

Lecture notes on Turing machines

Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. The stack

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Complexity Theory Part II

Theory of Computation Turing Machine and Pushdown Automata

Pushdown Automata (PDA) The structure and the content of the lecture is based on

Transcription:

Lecture 13: Turing Machine Instructor: Ketan Mulmuley Scriber: Yuan Li February 19, 2015 Turing machine is an abstract machine which in principle can simulate any computation in nature. Church-Turing Thesis: any function that is computable in nature is Turing-machine-computable. 1 Definition The most powerful machine we ve seen so far is (nondeterministic) PDA which consists of a read-only tape, a head, and a stack. Compared to the laptop we are using, it lacks the capability of random access writing. As long as we have a tape which supports random-access writing, there is no reason to have two different tapes. Figure 1: Turing machine with input w 1

Formally, Turing machine M = (Q, Σ, Γ, δ, q 0, F Q), where Q is a finite set of states, Σ the input alphabet, Γ Σ {B} the tape alphabet (B is a special symbol denotes blank ), δ the transition function, q 0 the initial state, F Q the set of final accepting states, and δ : Q Γ Q Γ {L, R}. The transition function δ describes the program. If δ(q, a) = (p, b, L), then at current state q, input symbol a, machine M will go to state p, replace a by b, and the head moves left; if δ(q, a) = (p, b, R), then at current state q, input symbol a, machine M will go to state p, replace a by b, and the head moves right; if δ(q, a) is undefined, then M halts, and the input is rejected. If the current state q is in F, then machine M accepts w. If the machine never halts, then the input is assumed to be rejected. At the first glance, it is not clear how powerful Turing machine is. Following is Turing s argument why the machine can simulate anything computable by human-like computer. Assume someone is working at a desk with a pencil and an eraser (see Figure 4). Instead of turning the pages, he can put the pages one by one (looks like a tape), and moves left or right as he wants. He is working on one page at a time. Depending on the state of his head, where the number of states is finite assuming his head has finite number of neurons, and the symbols he is reading on that page, he may erase some symbols and write down some new symbols. After he is done with this page, he may move left or right continue working on a new page. We assume each page has finite number of pixels. If two assumptions above hold (head has finite number of neurons and each page has finite number of pixels), then the person is equivalent to a Turing machine. Therefore, we come to the conclusion that the machine can compute anything computable by human-like computer. By the way, Turing invented this machine when he was an undergraduate. There is another computation system called lambda calculus first formulated by Alonzo Church, which turns out to be equivalent to Turing machine. But I have never seen anyone thinking like lambda calculus. 2

Figure 2: Someone works like a Turing machine 2 Instantaneous Description In order to formally define the language accepted by a Turing machine, we need the concept of instantaneous description. Instantaneous description is a snapshot of Turing machine at runtime, which is α 1 qα 2, where α 1, α 2 Γ, q Q. String α 1 is the tape content to the left of the head, q is the state, α 2 is the tape content to the right of the head (the tape head is on the first symbol of α 2 ). Define I 1 M I 2 if I 2 is the next ID of I 1 of Turing machine M. Formally, let I 1 = x 1 x 2... x i 1 qx i x i+1... x n If δ(q, x i ) = (p, y, R), then If δ(q, x i ) = (p, y, L), then I 1 M x 1 x 2... x i 1 ypx i+1... x n I 1 M x 1 x 2... x i 2 px i 1 yx i+1... x n 3

when i > 1; the machine M halts if i = 1. Let M be the reflexive transitive closure of M. The initial ID is q 0 w (If α 1 or α 2 is empty, we do not mention it). The language accepted by M is L(M) = {w : q 0 w M α 1 pα 2 for some p F, α 1, α 2 Γ }. 3 Examples Let L = {0 n 1 n : n 1}, which is a CFL. We will design a Turing machine M accepting L. Let M = (Q, Σ, Γ, δ, q 0, F Q), where Q = {q 0, q 1,..., q 4 }, Σ = {0, 1}, Γ = {0, 1, X, Y, B}, F = {q 4 }, and δ is shown in the following figure. Figure 3: Turing machine accepts {0 n 1 n : n 1} Turing machine M works as follows: it marks the first 0 as X, then goes to the first 1 and marks it as Y ; it goes left to the second 0, and marks it 4

as X, then goes to the second 1 and marks it as Y, etc. Until all the 0 s and 1 s are marked, it moves to the right most symbol and then accepts. All undefined transitions means stuck, and the input is rejected. 0 1 X Y B q 0 (q 1, X, R) (q 3, Y, R) q 1 (q 1, 0, R) (q 2, Y, L) (q 1, Y, R) q 2 (q 2, 0, R) (q 0, X, R) (q 2, Y, L) q 3 (q 3, Y, R) (q 4, B, R) q 4 Designing a Turing machine accepting certain language is like programming. Turing machine is the minimal programming language. Let us take another example which is not a CFL. Let L = {0 n 1 n 2 n : n 1}. The Turing machine works similar with the above it: it marks the first 0 as X, the first 1 as Y, the first 2 as Z; then it goes back to the second 0, and marks it as X, the second 2 as Y, the second 2 as Z, and so on. Figure 4: Turing machine accepts {0 n 1 n 2 n : n 1} 5