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

Similar documents
Automata Theory CS S-12 Turing Machine Modifications

This lecture covers Chapter 8 of HMU: Properties of CFLs

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

Chapter 2 Finite Automata

1 Nondeterministic Finite Automata

Designing finite automata II

First Midterm Examination

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

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

Formal languages, automata, and theory of computation

CS 275 Automata and Formal Language Theory

Formal Language and Automata Theory (CS21004)

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

Nondeterminism and Nodeterministic Automata

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

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.

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

input tape head moves current state

Worked out examples Finite Automata

Convert the NFA into DFA

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

5.1 Definitions and Examples 5.2 Deterministic Pushdown Automata

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

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

First Midterm Examination

Part 5 out of 5. Automata & languages. A primer on the Theory of Computation. Last week was all about. a superset of Regular Languages

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

Recursively Enumerable and Recursive. Languages

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

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

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

Deterministic Finite Automata

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

Some Theory of Computation Exercises Week 1

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

Finite Automata-cont d

Converting Regular Expressions to Discrete Finite Automata: A Tutorial

Turing Machines Part One

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

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

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

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

AUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton

TM M ... TM M. right half left half # # ...

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

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

CSC 473 Automata, Grammars & Languages 11/9/10

CISC 4090 Theory of Computation

Non-Deterministic Finite Automata

NFAs continued, Closure Properties of Regular Languages

CS375: Logic and Theory of Computing

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

CMSC 330: Organization of Programming Languages

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

Lexical Analysis Finite Automate

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

Homework 3 Solutions

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

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.

Let's start with an example:

NFA DFA Example 3 CMSC 330: Organization of Programming Languages. Equivalence of DFAs and NFAs. Equivalence of DFAs and NFAs (cont.

Lecture 08: Feb. 08, 2019

CS375: Logic and Theory of Computing

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

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

More on automata. Michael George. March 24 April 7, 2014

Java II Finite Automata I

Non-deterministic Finite Automata

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions

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

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

Normal Forms for Context-free Grammars

CS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018

CS 311 Homework 3 due 16:30, Thursday, 14 th October 2010

Context-Free Grammars and Languages

1.4 Nonregular Languages

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.

CS 330 Formal Methods and Models

Languages & Automata

Theory of Computation Regular Languages

Formal Languages and Automata

CSC 311 Theory of Computation

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

Fundamentals of Computer Science

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Non-deterministic Finite Automata

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

Minimal DFA. minimal DFA for L starting from any other

Finite-State Automata: Recap

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

CS5371 Theory of Computation. Lecture 20: Complexity V (Polynomial-Time Reducibility)

NON-DETERMINISTIC FSA

Lexical Analysis Part III

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

CSCI FOUNDATIONS OF COMPUTER SCIENCE

NFAs continued, Closure Properties of Regular Languages

Harvard University Computer Science 121 Midterm October 23, 2012

Turing Machines Part One

Decidability. Models of Computation 1

Homework Solution - Set 5 Due: Friday 10/03/08

Transcription:

CS411-2015S-12 Turing Mchine Modifictions 1 12-0: Extending Turing Mchines When we dded stck to NFA to get PDA, we incresed computtionl power Cn we do the sme thing for Turing Mchines? Tht is, cn we dd some new feture to TMs tht will increse their computtionl power? 12-1: Multi-Trck Tpe Insted of ech tpe loction holding single symol, we dd severl trcks to the tpe Bsed on contents of ll trcks, either move hed left, move hed right, or write new vlues to ny of the trcks c Red/write hed 12-2: Multi-Trck Tpe Cn simulte mutli-trck mchine with stndrd TM Increse the size of the tpe lphet k trcks, ech with n lphet ofnsymols New lphet of sizen k 12-3: Multi-Trck Tpe Red/write hed = = = C= D= E= F= G= H= GEF EH Red/write hed 12-4: Multiple Tpes Severl tpes, with independent red/write heds Rech symol on ech tpe, nd sed on contents of ll tpes:

CS411-2015S-12 Turing Mchine Modifictions 2 Write or move ech tpe independently Trnsition to new stte Red/write hed Red/write hed c Red/write hed 12-5: Multiple Tpes Crete 2-Tpe Mchine tht dds two numers Convert w;v to w +v (leding zeros OK) Assume tht tpe 1 holds input (nd output), nd tpe 2 strts out with lnks 12-6: Multiple Tpes Crete 2-Tpe Mchine tht dds two numers Convert w;v to w +v (leding zeros OK) Copy first # to second tpe (zeroing out first # on first tpe) Do stndrd ddition, keeping trck of crries. 12-7: Multiple Tpes Crete 2-Tpe Mchine tht dds two numers 0 1 0 1 0 2 1 = R 1,2 0 1 2 0 R 1 2 1 2 1 1 1 1 L 1,2 0 1, 1 0 0 1 1 1 1 2 1 0 1 0 2 1 1 1 2 1 1 0 L 1 1 2 1 1 2 0 1 2 1 1 1 2 1 2 1 2 0 1, 0 1,2 L 0 1 0 1 2 0 1 1 1 12-8: Multiple Tpes Are k-tpe mchines more powerful thn 1-tpe mchines? 12-9: Multiple Tpes

CS411-2015S-12 Turing Mchine Modifictions 3 c c 1 c 1 c 1 12-10: Multiple Tpes Ech trnsition from the originl, multi-tpe mchine will require severl trnsitions from the simulted mchine nd ech stte in the multiple-tpe mchine will e represented y set of sttes in the simultion mchine First, need to scn tpe hed to find ll virtul heds, nd rememer wht symol is stored t ech hed loction Use stte to store this informtion Next, scn tpe to implement the ction on ech tpe (moving hed, rewriting symols, etc) Finlly, trnsition to new set of sttes 12-11: 2-Wy Infinite Tpe c d e f g h i 12-12: 2-Wy Infinite Tpe Red/write hed c d e f g h i Red/write hed f g h i * e d c 12-13: 2-Wy Infinite Tpe Red/write hed

CS411-2015S-12 Turing Mchine Modifictions 4 Mke 2 copies of sttes in originl mchine: One set for top tpe, one set for ottom tpe Top Tpe Sttes Use the top trck Execute s norml When Move Left commnd, nd eginning of tpe symol is on the ottom tpe, move Right insted, switch to Bottom Tpe Sttes 12-14: 2-Wy Infinite Tpe Mke 2 copies of sttes in originl mchine: One set for top tpe, one set for ottom tpe Bottom Tpe Sttes Use the ottom trck Move left on Move Right commnd, move right on Move Left commnd When the eginning of tpe symol is encountered, switch to Top Tpe Sttes 12-15: Simple Computer CPU 3 Registers ( (IR), Progrm Counter (PC), Accumultor (ACC) Opertion: Set IR MEM[PC] Increment PC Execute instruction in IR Repet 12-16: Simple Computer CPU Registers Instruction Register Progrm Counter Accumultor 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015

CS411-2015S-12 Turing Mchine Modifictions 5 12-17: Simple Computer Instruction Mening 00 HALT Stop Computtion 01 LOAD x ACC MEM[x] 02 LOADI x ACC x 03 STORE x MEM[x] AC 04 ADD x ACC ACC + MEM[x] 05 ADDI x ACC ACC + x 06 SUB x ACC ACC - MEM[x] 07 SUBI x ACC ACC - x 08 JUMP x IP x 09 JZERO x IP xif ACC = 0 10 JGT x IP xif ACC>0 Write progrm tht multiplies two numers (in loctions 1000 & 1001), nd stores the result in 1002 12-18: Simple Computer Mchine Code Assemly 0001 011000 LOAD 1000 0002 031003 STORE 1003 0003 020000 LOADI 0 0004 031002 STORE 1002 0005 021003 LOAD 1003 0006 090012 JZERO 0012 0007 070001 SUBI 1 0008 031003 STORE 1003 0009 011002 LOAD 1002 0010 041001 ADD 1001 0011 080004 STORE 1002 0012 000000 HALT 12-19: Computers & TMs We cn simulte this computer with multi-tpe Turing mchine: One tpe for ech register (IR, IP, ACC) One tpe for the tpe will e entries of the form<ddress><contents> 12-20: Computers & TMs ddress contents 0 0 0 1 1 1 0 0 0 Accumultor 0 12-21: Computers & TMs Opertion: Scn through memory until rech n ddress tht mtches the IP Copy contents of memory t tht ddress to the IR Increment IP Bsed on the instruction code: Copy vlue into IP Copy vlue into Copy vlue into the ACC Do ddition/sutrction

CS411-2015S-12 Turing Mchine Modifictions 6 12-22: Computers & TMs 1 0 0 0 & 0 0 0 0 2 1 & 1 0 0 1 & 0 0 0 0 0 5 & 1 0 0 2 & 0 0 0 0 0 0 & 1 0 0 3 & 0 0 0 0 0 0 0 0 0 1 Accumultor 12-23: Computers & TMs 1 0 0 0 & 0 0 0 2 1 & 1 0 0 1 & 0 0 0 0 0 5 & 1 0 0 2 & 0 0 0 0 0 0 & 1 0 0 3 & 0 0 0 0 0 0 0 0 0 0 1 Accumultor 12-24: Computers & TMs 1 0 0 0 & 0 0 0 2 1 & 1 0 0 1 & 0 0 0 0 0 5 & 1 0 0 2 & 0 0 0 0 0 0 & 1 0 0 3 & 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 Accumultor 12-25: Computers & TMs (LOAD 1000)

CS411-2015S-12 Turing Mchine Modifictions 7 1 0 0 0 & 0 0 0 2 1 & 1 0 0 1 & 0 0 0 0 0 5 & 1 0 0 2 & 0 0 0 0 0 0 & 1 0 0 3 & 0 0 0 0 0 0 0 0 0 0 2 0 1 1 0 0 0 Accumultor 12-26: Computers & TMs (LOAD 1000) 1 0 0 0 & 0 0 0 2 1 & 1 0 0 1 & 0 0 0 0 0 5 & 1 0 0 2 & 0 0 0 0 0 0 & 1 0 0 3 & 0 0 0 0 0 0 0 0 0 0 2 0 1 1 0 0 0 Accumultor 12-27: Computers & TMs (LOAD 1000) 1 0 0 0 & 0 0 0 2 1 & 1 0 0 1 & 0 0 0 0 0 5 & 1 0 0 2 & 0 0 0 0 0 0 & 1 0 0 3 & 0 0 0 0 0 0 0 0 0 0 2 0 1 1 0 0 0 Accumultor 0 0 0 0 2 1 12-28: Computers & TMs (LOAD 1000)

CS411-2015S-12 Turing Mchine Modifictions 8 1 0 0 0 & 0 0 0 2 1 & 1 0 0 1 & 0 0 0 0 0 5 & 1 0 0 2 & 0 0 0 0 0 0 & 1 0 0 3 & 0 0 0 0 0 0 0 0 0 0 2 Accumultor 0 0 0 0 2 1 12-29: Computers & TMs 1 0 0 0 & 0 0 0 2 1 & 1 0 0 1 & 0 0 0 0 0 5 & 1 0 0 2 & 0 0 0 0 0 0 & 1 0 0 3 & 0 0 0 0 0 0 0 0 0 0 2 Accumultor 0 0 0 0 2 1 12-30: Computers & TMs 1 0 0 0 & 0 0 0 2 1 & 1 0 0 1 & 0 0 0 0 0 5 & 1 0 0 2 & 0 0 0 0 0 0 & 1 0 0 3 & 0 0 0 0 0 0 0 0 0 0 2 0 3 1 0 0 3 Accumultor 0 0 0 0 2 1 12-31: Computers & TMs (STORE 1003)

CS411-2015S-12 Turing Mchine Modifictions 9 1 0 0 0 & 0 0 0 2 1 & 1 0 0 1 & 0 0 0 0 0 5 & 1 0 0 2 & 0 0 0 0 0 0 & 1 0 0 3 & 0 0 0 0 0 0 0 0 0 0 3 0 3 1 0 0 3 Accumultor 0 0 0 0 2 1 12-32: Computers & TMs (STORE 1003) 1 0 0 0 & 0 0 0 2 1 & 1 0 0 1 & 0 0 0 0 0 5 & 1 0 0 2 & 0 0 0 0 0 0 & 1 0 0 3 & 0 0 0 0 0 0 0 0 0 0 3 0 3 1 0 0 3 Accumultor 0 0 0 0 2 1 12-33: Computers & TMs (STORE 1003) 1 0 0 0 & 0 0 0 2 1 & 1 0 0 1 & 0 0 0 0 0 5 & 1 0 0 2 & 0 0 0 0 0 0 & 1 0 0 3 & 0 0 0 0 2 1 0 0 0 0 3 0 3 1 0 0 3 Accumultor 0 0 0 0 2 1 12-34: Computers & TMs (STORE 1003)

CS411-2015S-12 Turing Mchine Modifictions 10 1 0 0 0 & 0 0 0 2 1 & 1 0 0 1 & 0 0 0 0 0 5 & 1 0 0 2 & 0 0 0 0 0 0 & 1 0 0 3 & 0 0 0 0 2 1 0 0 0 0 3 Accumultor 0 0 0 0 2 1 12-35: Computers & TMs Simple Computer cn e modeled y Turing Mchine Any current mchine cn e modeled in the sme wy y Turing Mchine If there is n lgorithm for it, Turning Mchine cn do it Note tht t this point, we don t cre how long it might tke, just tht it cn e done 12-36: Turing Complete A computtion formlism is Turing Complete if it cn simulte Turing Mchine Turing Complete cn compute nything Of course it might not e convenient 12-37: Non-Determinism Finl extension to Turing Mchines: Non-Determinism Just like non-determinism in NFAs, PDAs String is ccepted y non-deterministic Turing Mchine if there is t lest one computtionl pth tht ccepts 12-38: Non-Determinism A Non-Deterministic Mchine M Decides lnguge L if: All computtionl pths hlt For echw L, t lest one computtionl pth forw ccepts For ll w L, no computtionl pth ccepts 12-39: Non-Determinism A Non-Deterministic Mchine M Semi-Decides lnguge L if: For echw L, t lest one computtionl pth forw hlts nd ccepts For ll w L, no computtionl pth hlts nd ccepts 12-40: Non-Determinism A Non-Deterministic Mchine M Computes Function if:

CS411-2015S-12 Turing Mchine Modifictions 11 All computtionl pths hlt Every computtionl pth produces the sme result 12-41: Non-Determinism Non-Deterministic TM forl = {w {0,1} : w is composite} (semi-decides is OK) 12-42: Non-Determinism Non-Deterministic TM forl = {w {0,1} : w is composite} 0 0 R R ; R L M MULT M w w 1 1 How could we mke this mchine decide (insted of semi-decide)l? 12-43: Non-Determinism How we cn mke this mchine decide (insted of semi-decide)l First, trnsform w into w w; w Non-deterministiclly modify the second 2w s Multiply the second 2 w s Check to see if the resulting string is w w 12-44: Non-Determinism Are Non-Deterministic Turing Mchines more powerful thn Deterministic Turing mchines? Is there some L which cn e semi-decided y non-deterministic Turing Mchine, which cnnot e semi-decided y Deterministic Turing Mchine? Non-determinism in Finite Automt didn t uy us nything Non-determinism in Push-Down Automt did 12-45: Non-Determinism How to Simulte Non-Deterministic Turing Mchine with Deterministic Turing Mchine 12-46: Non-Determinism How to Simulte Non-Deterministic Turing Mchine with Deterministic Turing Mchine Try one computtionl pth if it sys yes, hlt nd sy yes. Otherwise, try different computtionl pth. Repet until success 12-47: Non-Determinism

CS411-2015S-12 Turing Mchine Modifictions 12 How to Simulte Non-Deterministic Turing Mchine with Deterministic Turing Mchine Try one computtionl pth if it sys yes, hlt nd sy yes. Otherwise, try different computtionl pth. Repet until success 12-48: Non-Determinism But wht if the first computtionl pth runs forever How to Simulte Non-Deterministic Turing Mchine with Deterministic Turing Mchine Try ll computtionl pths of length 1 Try ll computtionl pths of length 2 Try ll computtionl pths of length 3 If there is hlting configurtion, you will find it eventully. Otherwise, run forever. 12-49: Non-Determinism Originl Tpe c d e f g Work Tpe c d e f g Control Tpe 1 12-50: Non-Determinism, R R R yes R,,, (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) 12-51: Non-Determinism

CS411-2015S-12 Turing Mchine Modifictions 13 Originl Tpe Work Tpe Control Tpe 1 (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte: q0 12-52: Non-Determinism Originl Tpe Work Tpe Control Tpe 1 12-53: Non-Determinism (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte:

CS411-2015S-12 Turing Mchine Modifictions 14 Originl Tpe Work Tpe Control Tpe 2 (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte: q0 12-54: Non-Determinism Originl Tpe Work Tpe Control Tpe 2 12-55: Non-Determinism (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte:

CS411-2015S-12 Turing Mchine Modifictions 15 Originl Tpe Work Tpe Control Tpe 1 1 (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte: q0 12-56: Non-Determinism Originl Tpe Work Tpe Control Tpe 1 1 12-57: Non-Determinism (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte:

CS411-2015S-12 Turing Mchine Modifictions 16 Originl Tpe Work Tpe Control Tpe 1 1 (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte: 12-58: Non-Determinism Originl Tpe Work Tpe Control Tpe 1 2 12-59: Non-Determinism (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte: q0

CS411-2015S-12 Turing Mchine Modifictions 17 Originl Tpe Work Tpe Control Tpe 1 2 (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte: 12-60: Non-Determinism Originl Tpe Work Tpe Control Tpe 1 2 12-61: Non-Determinism (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte:

CS411-2015S-12 Turing Mchine Modifictions 18 Originl Tpe Work Tpe Control Tpe 2 1 (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte: q0 12-62: Non-Determinism Originl Tpe Work Tpe Control Tpe 2 1 12-63: Non-Determinism (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte:

CS411-2015S-12 Turing Mchine Modifictions 19 Originl Tpe Work Tpe Control Tpe 2 1 (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte: 12-64: Non-Determinism Originl Tpe Work Tpe Control Tpe 2 2 12-65: Non-Determinism (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte: q0

CS411-2015S-12 Turing Mchine Modifictions 20 Originl Tpe Work Tpe Control Tpe 1 1 1 2 1 1 (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte: q0 12-66: Non-Determinism Originl Tpe Work Tpe Control Tpe 1 1 1 2 1 1 12-67: Non-Determinism (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte:

CS411-2015S-12 Turing Mchine Modifictions 21 Originl Tpe Work Tpe Control Tpe 1 1 1 2 1 1 (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte: 12-68: Non-Determinism Originl Tpe Work Tpe Control Tpe 1 1 1 2 1 1 12-69: Non-Determinism (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte:

CS411-2015S-12 Turing Mchine Modifictions 22 Originl Tpe Work Tpe Control Tpe 1 1 1 2 1 1 (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte: 12-70: Non-Determinism Originl Tpe Work Tpe Control Tpe 1 1 1 2 1 1 12-71: Non-Determinism (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte:

CS411-2015S-12 Turing Mchine Modifictions 23 Originl Tpe Work Tpe Control Tpe 1 1 1 2 1 1 12-72: Turing Mchines (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) (,R) yes (,R) (,R) (,R) Stte: yes Some Turing Mchine review prolems: Crete Turing Mchine tht semi-decides the lnguge L = ll strings over {, } with t lest s mny s s s 12-73: Turing Mchines Crete Turing Mchine tht semi-decides the lngugel=ll strings over{, } with t lest s mny s s s R, yes X L R X L 12-74: Turing Mchines Some Turing Mchine review prolems: Crete Turing Mchine tht computes the function lgx, wherex is inry numer 12-75: Turing Mchines Some Turing Mchine review prolems: Crete Turing Mchine tht computes the function lgx, wherex is inry numer

CS411-2015S-12 Turing Mchine Modifictions 24 12-76: Turing Mchines Set result to 0 While x 2, dividexy 2, nd dd one to the result Crete Turing Mchine tht computes the function lgx, wherexis inry numer 0 R R0L L YR 0 1 R 1 R M INC L L R M LeftShift 12-77: Turing Mchines 0,1 Crete Turing Mchine tht computes the function lgx, wherexis inry numer Set mrker for shifting t end of computtion Eliminte leding zeroes Initilize result to 0 0 R R0L L YR 0 1 R 1 R M INC L R M LeftShift 0,1 Blnk out MSB 12-78: Turing Mchines M LeftShift Increment Result R x=0,1 ZL Y R x R Z R x=0,1 L Y