CS 461 – Oct. 26 TM practice Arithmetic on a TM TM variants (handout)

Slides:



Advertisements
Similar presentations
Restricted Machines Presented by Muhannad Harrim.
Advertisements

Part VI NP-Hardness. Lecture 23 Whats NP? Hard Problems.
Turing Machines Memory = an infinitely long tape Persistent storage A read/write tape head that can move around the tape Initially, the tape contains only.
CS2303-THEORY OF COMPUTATION
Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Variants of Turing machines
Lecture 6 Nondeterministic Finite Automata (NFA)
CS 461 – Oct. 21 Begin chapter 3 We need a better (more encompassing) model of computation. Ex. { 1 n 2 n 3 n } couldn’t be accepted by PDA. –How could.
Foundations of (Theoretical) Computer Science Chapter 3 Lecture Notes (Section 3.2: Variants of Turing Machines) David Martin With.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
Turing’s Thesis Fall 2006 Costas Busch - RPI.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Costas Busch - RPI1 Turing Machines. Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Costas Busch - LSU1 Non-Deterministic Finite Automata.
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
1 The Cook-Levin Theorem Zeph Grunschlag. 2 Announcements Last HW due Thursday Please give feedback about course at oracle.seas.columbia.edu/wces oracle.seas.columbia.edu/wces.
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
CS 461 – Nov. 21 Sections 7.1 – 7.2 Measuring complexity Dividing decidable languages into complexity classes. Algorithm complexity depends on what kind.
Lecture 2UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 2.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
REGULAR LANGUAGES.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automaton (DFA) Input Tape “Accept” or “Reject” String Finite Automaton Output.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Models of Computation - Turing Machines Dale Roberts, Lecturer.
1 More About Turing Machines “Programming Tricks” Restrictions Extensions Closure Properties.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
Costas Busch - LSU1 Turing’s Thesis. Costas Busch - LSU2 Turing’s thesis (1930): Any computation carried out by mechanical means can be performed by a.
Lecture 17 Undecidability Topics:  TM variations  Undecidability June 25, 2015 CSCE 355 Foundations of Computation.
1 Section 13.1 Turing Machines A Turing machine (TM) is a simple computer that has an infinite amount of storage in the form of cells on an infinite tape.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS 461 – Oct. 28 TM applications –Recognize a language √ –Arithmetic √ –Enumerate a set –Encode a data structure or problem to solve Two kinds of TMs –Decider:
1 Introduction to Turing Machines
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Turing Machines. The next level of Machine… PDAs improved on FSAs by adding memory. We make the memory more flexible to do more complicated tasks.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CSCI 2670 Introduction to Theory of Computing November 15, 2005.
Finite Automata.
Turing’s Thesis.
Turing’s Thesis Costas Busch - LSU.
CSCI 2670 Introduction to Theory of Computing
CSE202: Introduction to Formal Languages and Automata Theory
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
Time complexity Here we will consider elements of computational complexity theory – an investigation of the time (or other resources) required for solving.
Non Deterministic Automata
Busch Complexity Lectures: Turing Machines
Deterministic Turing Machines
CSE 105 theory of computation
CSCI 2670 Introduction to Theory of Computing
COSC 3340: Introduction to Theory of Computation
Turing’s Thesis Costas Busch - RPI.
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
Turing Machines Acceptors; Enumerators
COSC 3340: Introduction to Theory of Computation
Deterministic Finite Automata And Regular Languages Prof. Busch - LSU.
Non-Deterministic Finite Automata
CSE322 Definition and description of finite Automata
Non Deterministic Automata
CSE 105 theory of computation
Computability Catch up last lecture. Turing machines. Variations
Non Deterministic Automata
Intro to Theory of Computation
CSE 105 theory of computation
Presentation transcript:

CS 461 – Oct. 26 TM practice Arithmetic on a TM TM variants (handout) 0*1* Twice as many 0’s as 1’s Palindrome… Adding register(s) to simplify programming Arithmetic on a TM TM variants (handout) Adding more features doesn’t add power. If a TM can’t do it, nothing can.

Palindrome If “0”/”1”, change to _ and go to 2/4. If _, accept. Continue right until _. Then go left and go to 3. If “0”, change to _, go left. Go to 6. If “1” reject (states 4,5 are analogous to 2,3) If “1”, change to _, go left. Go to 6. If “0” reject. Continue left until _. Turn right. Start over at 1.

Closer look at δ [s1]101 _[s4]01 _0[s4]1 _01[s4]_ _0[s5]1 _[s6]0_  transitions have been added. State 1 _ 2, _, R 4, _, R  2 2, 0, R 2, 1, R 3, _, L 3 6, _, L Reject 4 4, 0, R 4, 1, R 5, _, L 5 6 6, 0, L 6, 1, L 1, _, R

Registers In palindrome example, we needed 2 extra states because leftmost input symbol could be 0 or 1. What if alphabet were { a, b, c, … z } ? Do we literally want 2*25 more states?  In place of those extra states, store a finite amount of information in TM’s “control unit”, just like registers in CPU. With a register, our state is just an ordered pair like (2, ‘t’). More and more, a TM is looking like a computer!

New palindrome If _, accept. Otherwise copy first symbol to register. Change tape to _ and go to 2. Continue right until _. Then go left and go to 3. If input matches register, change to _, go left. Go to 6. If no match, reject. (if _, accept) Continue left until _. Turn right. Start over at 1.

Arithmetic Can do binary addition on a TM. Method #1: Unary programming  Input is of the form 1101111 for 2 + 4. Method #2: With binary notation: Modify our definition of TM so it can have 3 parallel tracks on the tape. The third track can hold the answer. Can do other operations analogously.

Unary + Make sure input is of the form 1*01*. If not, reject. If so, put = at end and go back to beginning of word. Copy all the 1s on left side of 0 to the right end of word. Copy all the 1s between the 0 and = to the right end of word. This is just an outline, and I didn’t attempt to count exact number of states needed. If we didn’t care about changing the input, we could just get rid of the 0 and squeeze the 1s together!

TM Variants Based on additional features. Can save a lot of effort. Multi-tape probably most useful. We can show that a new feature can be emulated by the ordinary TM model.  Nothing can beat a TM. The extra bells and whistles just make programming easier.

Some variants Allowing a TM to “stay put” instead of having to move left or right.  Multi-tape (not to be confused with multi-track tape) Makes use of stay-put Scanning the “virtual heads”  Non-deterministic Makes use of multi-tape

Non-determinism The non-deterministic computations can be arranged in a tree. If we want to deterministically search this tree, DFS or BFS? P. 151: Tape 3 will contain a list of transitions to experiment on. Copy tape 1 to tape 2, and use tape 2 for scratch work. If reject, increment tape 3 to next possible set of transitions. Ex. Accept the union of 2+ languages Ex. For some language L, design a TM that will accept substrings (of length 3) of these words.

Computer A TM with multiple tapes can simulate a computer. One tape contains data and instruction memory. Unfortunately, need to label each with address. One tape can store the address of current instruction. Another tape can store address of data operand. Finally, a tape for scratch work.