CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.

Similar documents
3515ICT Theory of Computation Turing Machines

Turing Machines: An Introduction

Automata and Computability. Solutions to Exercises

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

CS 3719 (Theory of Computation and Algorithms) Lecture 4

Computability Theory

Notes on Complexity Theory Last updated: August, Lecture 1

Computational Models Lecture 8, Spring 2009

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

CAs and Turing Machines. The Basis for Universal Computation

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

Theory of Computation Chapter 2: Turing Machines

Introduction to Turing Machines

Turing Machines, Part I

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

1 Definition of a Turing machine

Lecture 2: Universality

24 Uses of Turing Machines

Deterministic Finite Automata

Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP

Reading 13 : Finite State Automata and Regular Expressions

Regular Languages and Finite State Machines

Finite Automata. Reading: Chapter 2

CS 301 Course Information

6.080/6.089 GITCS Feb 12, Lecture 3

The Halting Problem is Undecidable

THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER

C H A P T E R Regular Expressions regular expression

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

NP-Completeness and Cook s Theorem

4.6 The Primitive Recursive Functions

Lecture 36: Turing Machines [Fa 14]

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology

Welcome to... Problem Analysis and Complexity Theory , 3 VU

Automata and Formal Languages

Notes on Complexity Theory Last updated: August, Lecture 1

Chapter 7 Uncomputability

Regular Expressions and Automata using Haskell

How To Compare A Markov Algorithm To A Turing Machine

Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, School of Informatics University of Edinburgh als@inf.ed.ac.

Finite Automata. Reading: Chapter 2

The Ergodic Theorem and randomness

Genetic programming with regular expressions

CSC4510 AUTOMATA 2.1 Finite Automata: Examples and D efinitions Definitions

Automata and Formal Languages. Push Down Automata. Sipser pages Lecture 13. Tim Sheard 1

Turing Machines and Understanding Computational Complexity

Automata on Infinite Words and Trees

Turing Machines, Busy Beavers, and Big Questions about Computing

The Classes P and NP

Increasing Interaction and Support in the Formal Languages and Automata Theory Course

Complexity Theory. Jörg Kreiker. Summer term Chair for Theoretical Computer Science Prof. Esparza TU München

SRM UNIVERSITY FACULTY OF ENGINEERING & TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF SOFTWARE ENGINEERING COURSE PLAN

CS5236 Advanced Automata Theory

Lecture I FINITE AUTOMATA

Diagonalization. Ahto Buldas. Lecture 3 of Complexity Theory October 8, Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach.

Outline 2. 1 Turing Machines. 2 Coding and Universality. 3 The Busy Beaver Problem. 4 Wolfram Prize. 5 Church-Turing Thesis.

The P versus NP Solution

Universal Turing Machine: A Model for all Computational Problems

1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification)

Introduction to Automata Theory. Reading: Chapter 1

Model 2.4 Faculty member + student

Oracle Turing machines faced with the verification problem

How To Understand The Theory Of Computer Science

Lecture summary for Theory of Computation

Universality in the theory of algorithms and computer science

Introduction to Logic in Computer Science: Autumn 2006

Introduction to computer science

Finite Automata and Formal Languages

Simulation-Based Security with Inexhaustible Interactive Turing Machines

Quantum and Non-deterministic computers facing NP-completeness

Theoretical Computer Science (Bridging Course) Complexity

Overview of E0222: Automata and Computability

Introduction to Theory of Computation

Regular Languages and Finite Automata

Computational complexity theory

WE write string to mean a finite binary string. Other. Information Distance

Hilberts Entscheidungsproblem, the 10th Problem and Turing Machines

Notes on NP Completeness

Prime Numbers. Difficulties in Factoring a Number: from the Perspective of Computation. Computation Theory. Turing Machine 電 腦 安 全

3 Monomial orders and the division algorithm

Complexity of Algorithms

Mathematical Induction

Two Way F finite Automata and Three Ways to Solve Them

Scanner. tokens scanner parser IR. source code. errors

Introduction to NP-Completeness Written and copyright c by Jie Wang 1

Formal Grammars and Languages

Closest Pair Problem

SECTION 10-2 Mathematical Induction

2.1 Complexity Classes

Hypercomputation: computing more than the Turing machine

11 Multivariate Polynomials

Computability Classes for Enforcement Mechanisms*

CHAPTER 6. Shannon entropy

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

On the Unique Games Conjecture

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

Transcription:

CS54 Turing Machines Turing Machine q 0 AI N P U T IN TAPE read write move read write move Language = {0} q This Turing machine recognizes the language {0} Turing Machines versus DFAs TM can both write to and read from the tape The head can move left and right The input doesn t have to be read entirely, and the computation can continue further (even, forever) after all input has been read Accept and Reject take immediate effect Deciding the language L = { w#w w {0,}* } q 0, FIND q, # FIND # q #, FIND q 0, FIND q, FIND q GO LEFT X X # 0# 0X. If there s no # on the tape,. 2. While there is a bit to the left of #, Replace the first bit with X, and check if the first bit to the right of the # is identical. (If not,.) Replace that bit with an X too. 3. If there s a bit to the right of #, then else accept

Definition: A Turing Machine is a 7-tuple T = (Q, Σ, Γ, δ, q 0,, q ), where: Q is a finite set of s Σ is the input alphabet, where Σ Γ is the tape alphabet, where Γand Σ Γ δ : Q Γ Q Γ {L, R} q 0 Q is the start Q is the accept q Q is the, and q Turing Machine Configurations q 7 0 0 0 corresponds to the configuration: 00q 7 000 Defining Acceptance and Rejection Let C and C 2 be configurations of M We say C yields C 2 if, after running M in C for one step, M is then in configuration C 2 Suppose δ(q, b) = (q 2, c, L) Then aaq bb yields aq 2 acb Suppose δ(q, a) = (q 2, c, R) Then cabq a yields cabcq 2 Let w Σ* and M be a Turing machine M accepts w if there are configs C 0, C,..., C k, s.t. C 0 = q 0 w C i yields C i+ for i = 0,..., k-, and C k contains the accepting A TM M recognizes a language L iff M accepts all and only those strings in L A language L is called recognizable or recursively enumerable (r.e.) iff some TM recognizes L A TM M decides a language L iff M accepts all strings in L and s all strings not in L A language L is called decidable or recursive iff some TM decides L A language is called recognizable (recursively enumerable) if some TM recognizes it A language is called decidable (recursive) if some TM decides it recognizable languages decidable languages { 02 n n 0 } PSEUDOCODE:. Sweep from left to right, cross out every other 0 2. If in stage, the tape had only one 0, accept 3. If in stage, the tape had an odd number of 0 s, 4. Move the head back to the first input symbol. 5. Go to stage. Why does this work? Idea: Every time we return to stage, the number of 0 s on the tape is halved. 2

2 { 0 n n 0 } q 0 q 0, R q q 2 0 x, R 0 x, R x x, L 0 0, L q 3 q 4 C = {a i b j c k k = i*j, and i, j, k } PSEUDOCODE:. If the input doesn t match a*b*c*,. 2. Move the head back to the leftmost symbol. 3. Cross off an a, scan to the right until b. Sweep between b s and c s, crossing off one of each until all b s are crossed off. If all c s get crossed off while doing this,. 4. Uncross all the b s. If there s another a left, then repeat stage 3. If all a s are crossed out, Check if all c s are crossed off. If yes, then accept, else. C = {a i b j c k k = i*j, and i, j, k } aabbbcccccc xabbbcccccc xayyyzzzccc xabbbzzzccc xxyyyzzzzzz Multitape Turing Machines δ : Q Γ k Q Γ k {L,R} k k # # # # # # 3

# # # # # # Nondeterministic TMs Theorem: Every nondeterministic Turing machine N can be transformed into a single tape Turing Machine M that recognizes the same language. Proof Idea (more details in Sipser): M(w): For all strings C {Q Γ #}* in lex. order, Check if C = C 0 # #C k where C 0,,C k is some accepting computation history for N on w. If so, accept. We can encode a TM as a bit string. n s 0 n 0 m 0 k 0 s 0 t 0 r 0 u m tape symbols (first k are input symbols) start accept blank symbol ( (p, a), (q, b, L) ) = 0 p 0 a 0 q 0 b 0 ( (p, a), (q, b, R) ) = 0 p 0 a 0 q 0 b Similarly, we can encode DFAs and NFAs as bit strings. So we can define the following languages: A DFA = { (B, w) B is a DFA that accepts string w } A NFA = { (B, w) B is an NFA that accepts string w } A TM = { (C, w) C is a TM that accepts string w } (Can define (x, y) := 0 x xy) A DFA = { (D, w) D is a DFA that accepts string w } Theorem: A DFA is decidable Proof Idea: Directly simulate D on w! A NFA = { (N, w) N is an NFA that accepts string w } Theorem: A NFA is decidable. (Why?) A TM = { (M, w) M is a TM that accepts string w } A TM is recognizable but not decidable 4

Universality of Turing Machines Theorem: There is a universal Turing machine U that can take as input - the code of an arbitrary TM M - an input string w, such that U(M, w) accepts iff M(w) accepts. This is a fundamental property: Turing machines can run their own code! Note that DFAs/NFAs do not have this property. That is, A DFA is not regular. The Church-Turing Thesis Everyone s Intuitive Notion = Turing Machines of Algorithms This thesis is tested every time you write a program that does something! A TM recognizes a language if it accepts all and only those strings in the language A language is called recognizable or recursively enumerable, (or r.e.) if some TM recognizes it w Σ* TM w L? yes no w Σ* TM w L? yes no A TM decides a language if it accepts all strings in the language and s all strings not in the language A language is called decidable (or recursive) if some TM decides it accept L is decidable (recursive) accept or no output L is recognizable (recursively enumerable) Theorem: L is decidable if both L and L are recursively enumerable Recall: Given L Σ*, define L := Σ* - L Theorem: L is decidable iff both L and L are recognizable Given: a TM M that recognizes A and a TM M2 that recognizes A, we can build a new machine M that decides A How? Any ideas? M always accepts x, when x is in A M2 always accepts x, when x is not in A There are languages over {0,} that are not decidable Assuming the Church-Turing Thesis, this means there are problems that NO computing device can solve We can prove this using a counting argument. We will show there is no onto function from the set of all Turing Machines to the set of all languages over {0,}. (But it works for any Σ) That is, every mapping from Turing machines to languages must miss some language. 5