Section: Other Models of Turing Machines. Definition: Two automata are equivalent if they accept the same language.

Similar documents
TM M ... TM M. right half left half # # ...

Assignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages

Nondeterminism and Nodeterministic Automata

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

Non Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51

Non-Deterministic Finite Automata

Chapter 2 Finite Automata

Non-Deterministic Finite Automata. Fall 2018 Costas Busch - RPI 1

Worked out examples Finite Automata

5.1 Definitions and Examples 5.2 Deterministic Pushdown Automata

Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Regular Expressions (RE) Kleene-*

CS S-12 Turing Machine Modifications 1. When we added a stack to NFA to get a PDA, we increased computational power

This lecture covers Chapter 8 of HMU: Properties of CFLs

CHAPTER 1 Regular Languages. Contents. definitions, examples, designing, regular operations. Non-deterministic Finite Automata (NFA)

Convert the NFA into DFA

Non Deterministic Automata. Formal Languages and Automata - Yonsei CS 1

Recursively Enumerable and Recursive. Languages

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Formal Languages and Automata

Java II Finite Automata I

Regular expressions, Finite Automata, transition graphs are all the same!!

CS:4330 Theory of Computation Spring Regular Languages. Equivalences between Finite automata and REs. Haniel Barbosa

Formal languages, automata, and theory of computation

Some Theory of Computation Exercises Week 1

First Midterm Examination

Theory of Computation Regular Languages. (NTU EE) Regular Languages Fall / 38

Minimal DFA. minimal DFA for L starting from any other

Non-deterministic Finite Automata

Finite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh

Chapter 1, Part 1. Regular Languages. CSC527, Chapter 1, Part 1 c 2012 Mitsunori Ogihara 1

Normal Forms for Context-free Grammars

Theory of Computation Regular Languages

Finite-State Automata: Recap

Non-deterministic Finite Automata

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

Grammar. Languages. Content 5/10/16. Automata and Languages. Regular Languages. Regular Languages

Let's start with an example:

CISC 4090 Theory of Computation

State Minimization for DFAs

Designing finite automata II

11.1 Finite Automata. CS125 Lecture 11 Fall Motivation: TMs without a tape: maybe we can at least fully understand such a simple model?

CSCI FOUNDATIONS OF COMPUTER SCIENCE

a,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1

1 Nondeterministic Finite Automata

Languages & Automata

Nondeterminism. Nondeterministic Finite Automata. Example: Moves on a Chessboard. Nondeterminism (2) Example: Chessboard (2) Formal NFA

input tape head moves current state

Revision Sheet. (a) Give a regular expression for each of the following languages:

Deterministic Finite-State Automata

Lecture 08: Feb. 08, 2019

1.4 Nonregular Languages

80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers

First Midterm Examination

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

Deterministic Finite Automata

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

Formal Language and Automata Theory (CS21004)

Coalgebra, Lecture 15: Equations for Deterministic Automata

NFAs and Regular Expressions. NFA-ε, continued. Recall. Last class: Today: Fun:

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS

Fundamentals of Computer Science

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

Anatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

CS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

CS 275 Automata and Formal Language Theory

Model Reduction of Finite State Machines by Contraction

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Exercises Chapter 1. Exercise 1.1. Let Σ be an alphabet. Prove wv = w + v for all strings w and v.

In-depth introduction to main models, concepts of theory of computation:

Speech Recognition Lecture 2: Finite Automata and Finite-State Transducers

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

Introduction to ω-autamata

Nondeterministic Automata vs Deterministic Automata

CS375: Logic and Theory of Computing

FABER Formal Languages, Automata and Models of Computation

Lecture 09: Myhill-Nerode Theorem

CHAPTER 1 Regular Languages. Contents

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

CSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science

CSCI 340: Computational Models. Transition Graphs. Department of Computer Science

12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016

CMSC 330: Organization of Programming Languages

Today s Topics Automata and Languages

Automata and Languages

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.

NFAs continued, Closure Properties of Regular Languages

Context-Free Grammars and Languages

Lexical Analysis Finite Automate

Finite Automata-cont d

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

NFAs continued, Closure Properties of Regular Languages

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

Harvard University Computer Science 121 Midterm October 23, 2012

E 1 (n) = E 0 (n-1) E 0 (n) = E 0 (n-1)+e 0 (n-2) T(n -1)=2E 0 (n-2) + E 0 (n-3)

CMSC 330: Organization of Programming Languages. DFAs, and NFAs, and Regexps (Oh my!)

CS 330 Formal Methods and Models

Transcription:

Section: Other Models of Turing Mchines Definition: Two utomt re equivlent if they ccept the sme lnguge. Turing Mchines with Sty Option Modify δ, Theorem Clss of stndrd TM s is equivlent to clss of TM s with sty option. Proof: ( ): Given stndrd TM M, then there exists TM M with sty option such tht L(M)=L(M ). 1

( ): Given TM M with sty option, construct stndrd TM M such tht L(M)=L(M ). M=(Q,Σ, Γ,δ,q 0,B,F) M = For ech trnsition in M with move (L or R) put the trnsition in M. So, for put into δ δ(q i,)=(q j,,lorr) For ech trnsition in M with S (sty-option), move right nd move left. So for δ(q i,)=(q j,,s) L(M)=L(M ). QED. 2

Definition: A multiple trck TM divides ech cell of the tpe into k cells, for some constnt k. A 3-trck TM: c 1 1 1 tpe hed A multiple trck TM strts with the input on the first trck, ll other trcks re lnk. δ: 3

Theorem Clss of stndrd TM s is equivlent to clss of TM s with multiple trcks. Proof: (sketch) ( ): Given stndrd TM M there exists TM M with multiple trcks such tht L(M)=L(M ). ( ): Given TM M with multiple trcks there exists stndrd TM M such tht L(M)=L(M ). 4

Definition: A TM with semi-infinite tpe is stndrd TM with left oundry. Theorem Clss of stndrd TM s is equivlent to clss of TM s with semi-infinite tpes. Proof: (sketch) ( ): Given stndrd TM M there exists TM M with semi-infinite tpe such tht L(M)=L(M ). Given M, construct 2-trck semi-infinite TM M 5

TM M... c... TM M # # c... right hlf left hlf ( ): Given TM M with semi-infinite tpe there exists stndrd TM M such tht L(M)=L(M ). 6

Definition: An Multitpe Turing Mchine is stndrd TM with multiple ( finite numer) red/write tpes. Control Unit tpe 2 tpe 1 c tpe 3 For n n-tpe TM, define δ: 7

Theorem Clss of Multitpe TM s is equivlent to clss of stndrd TM s. Proof: (sketch) ( ): Given stndrd TM M, construct multitpe TM M such tht L(M)=L(M ). ( ): Given n-tpe TM M construct stndrd TM M such tht L(M)=L(M ). # c # 1 # # 1 # # 1 8

Definition: An Off-Line Turing Mchine is stndrd TM with 2 tpes: red-only input tpe nd red/write output tpe. Define δ: c input tpe (red only) Control Unit d red/write tpe 9

Theorem Clss of stndrd TM s is equivlent to clss of Off-line TM s. Proof: (sketch) ( ): Given stndrd TM M there exists n off-line TM M such tht L(M)=L(M ). ( ): Given n off-line TM M there exists stndrd TM M such tht L(M)=L(M ). # c # 1 # d # 1 10

Running Time of Turing Mchines Exmple: Given L={ n n c n n>0}. Given w Σ, iswinl? Write 3-tpe TM for this prolem. 11

Definition: An Multidimensionl-tpe Turing Mchine is stndrd TM with multidimensionl tpe c Define δ: 12

Theorem Clss of stndrd TM s is equivlent to clss of 2-dimensionl-tpe TM s. Proof: (sketch) ( ): Given stndrd TM M, construct 2-dim-tpe TM M such tht L(M)=L(M ). ( ): Given 2-dim tpe TM M, construct stndrd TM M such tht L(M)=L(M ). 13

-1,2 1,2 2,2-2,1-1,1 1,1 2,1 c3,1-2,-1-1,-1 1,-1 2,-1 Construct M # # # c # 1 # 1 # 1 1 # 1 # 1 1 1 # 1 14

Definition: A nondeterministic Turing mchine is stndrd TM in which the rnge of the trnsition function is set of possile trnsitions. Define δ: Theorem Clss of deterministic TM s is equivlent to clss of nondeterministic TM s. Proof: (sketch) ( ): Given deterministic TM M, construct nondeterministic TM M such tht L(M)=L(M ). ( ): Given nondeterministic TM M, construct deterministic TM M such tht L(M)=L(M ). Construct M to e 2-dim tpe TM. 15

A step consists of mking one move for ech of the current mchines. For exmple: Consider the following trnsition: δ(q 0,)={(q 1,,R),(q 2,,L),(q 1,c,R)} Being in stte q 0 with input c. # # # # # # c # # q 0 # # # # # # 16

The one move hs three choices, so 2 dditionl mchines re strted. # # # # # # # c # # q 1 # # c # # q 2 # # c c # # q 1 # # # # # # # 17

Definition: A 2-stck NPDA is n NPDA with 2 stcks. Control Unit stck 2 stck 1 Define δ: 18

Consider the following lnguges which could not e ccepted y n NPDA. 1. L={ n n c n n>0} 2. L={ n n n n n>0} 3. L={w Σ numer of s equls numer of s equls numer of c s}, Σ={,, c} 19

Theorem Clss of 2-stck NPDA s is equivlent to clss of stndrd TM s. Proof: (sketch) ( ): Given 2-stck NPDA, construct 3-tpe TM M such tht L(M)=L(M ). 20

( ): Given stndrd TM M, construct 2-stck NPDA M such tht L(M)=L(M ). 21

Universl TM - progrmmle TM Input: n encoded TM M input string w Output: Simulte M on w 22

An encoding of TM Let TM M={Q,Σ, Γ,δ,q 1,B,F} Q={q 1,q 2,...,q n } Designte q 1 s the strt stte. Designte q 2 s the only finl stte. q n will e encoded s n 1 s Moves L will e encoded y 1 R will e encoded y 11 Γ={ 1, 2,..., m } where 1 will lwys represent the B. 23

For exmple, consider the simple TM: ;,R ;,L q 1 q 2 Γ={B,,} which would e encoded s The TM hs 2 trnsitions, δ(q 1,)=(q 1,,R), δ(q 1,)=(q 2,,L) which cn e represented s 5-tuples: (q 1,,q 1,,R),(q 1,,q 2,,L) Thus, the encoding of the TM is: 0101101011011010111011011010 24

For exmple, the encoding of the TM ove with input string would e encoded s: 010110101101101011101101101001101110110 Question: Given w {0,1} +,iswthe encoding of TM? 25

Universl TM The Universl TM (denoted M U )is 3-tpe TM: Control Unit 0 1 1 0... tpe contents of M 0 1 0 encoding of M 1... 1 1 1 current stte of M 26

Progrm for M U 1. Strt with ll input (encoding of TM nd string w) on tpe 1. Verify tht it contins the encoding of TM. 2. Move input w to tpe 2 3. Initilize tpe 3 to 1 (the initil stte) 4. Repet (simulte TM M) () consult tpe 2 nd 3, (suppose current symol on tpe 2 is nd stteontpe3isp) () lookup the move (trnsition) on tpe 1, (suppose δ(p,)=(q,,r).) (c) pply the move writeontpe2(write) move on tpe 2 (move right) write new stte on tpe 3 (write q) 27

Oservtion: Every TM cn e encoded s string of 0 s nd 1 s. Enumertion procedure - process to list ll elements of set in ordered fshion. Definition: An infinite set is countle if its elements hve 1-1 correspondence with the positive integers. Exmples: S ={positive odd integers } S ={rel numers } S={w Σ + },Σ={, } S={TM s } S ={(i,j) i,j>0, re integers} 28

Liner Bounded Automt We plce restrictions on the mount of tpe we cn use, [ c ] Definition: A liner ounded utomton (LBA) is nondeterministic TM M=(Q,Σ, Γ,δ,q 0,B,F) such tht [, ] Σ nd the tpe hed cnnot move out of the confines of [] s. Thus, δ(q i, [) = (q j, [,R), nd δ(q i, ]) = (q j, ],L) Definition: Let M e LBA. L(M)={w (Σ {[,]}) q 0 [w] [x 1 q f x 2 ]} Exmple: L={ n n c n n>0}is ccepted y some LBA 29