1 8.4 Extensions to the Basic TM Extended TM’s to be studied: Multitape Turing machine Nondeterministic Turing machine The above extensions make no increase.

Slides:



Advertisements
Similar presentations
Restricted Machines Presented by Muhannad Harrim.
Advertisements

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
Complexity Classes: P and NP
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
Variants of Turing machines
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Programming Languages Wrap-up. Your Toolkit Object-oriented Imperative Functional Logic.
Foundations of (Theoretical) Computer Science Chapter 3 Lecture Notes (Section 3.2: Variants of Turing Machines) David Martin With.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Variants.
Computability and Complexity 14-1 Computability and Complexity Andrei Bulatov Cook’s Theorem.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
P, NP, PS, and NPS By Muhannad Harrim. Class P P is the complexity class containing decision problems which can be solved by a Deterministic Turing machine.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata are like Turing Machines with a restriction: The working space of the tape is the space of the.
CS5371 Theory of Computation Lecture 11: Computability Theory II (TM Variants, Church-Turing Thesis)
Programming the TM qa  (,q) (,q) q1q1 0q1q1 R q1q1 1q1q1 R q1q1  h  Qa  (,q) (,q) q1q1 0q2q2  q1q1 1q3q3  q1q1  h  q2q2 0q4q4 R q2q2 1q4q4.
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Chapter 9 Turing Machine (TMs).
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Section 11.4 Language Classes Based On Randomization
Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { ‘{‘, ‘}’ } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite language,
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Machines with Memory Chapter 3 (Part B). Turing Machines  Introduced by Alan Turing in 1936 in his famous paper “On Computable Numbers with an Application.
Turing Machines Recursive and Recursively Enumerable Languages
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
1 More About Turing Machines “Programming Tricks” Restrictions Extensions Closure Properties.
1 Turing Machines Reading: Chapter 8. 2 Turing Machines are… Very powerful (abstract) machines that could simulate any modern day computer (although very,
CSE 3813 Introduction to Formal Languages and Automata Chapter 10 Other Models of Turing Machines These class notes are based on material from our textbook,
Computability Chapter 5. Overview  Turing Machine (TM) considered to be the most general computational model that can be devised (Church-Turing thesis)
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
Chapter 15 P, NP, and Cook’s Theorem. 2 Computability Theory n Establishes whether decision problems are (only) theoretically decidable, i.e., decides.
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 Chapter 8 Introduction to Turing Machines Rothenberg, Germany.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
Lecture 16b Turing Machines Topics: Closure Properties of Context Free Languages Cocke-Younger-Kasimi Parsing Algorithm June 23, 2015 CSCE 355 Foundations.
Transparency No. P3C2-1 Formal Language and Automata Theory PART III Chapter 2 Other Equivalent models of Standard Turing machine.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
Umans Complexity Theory Lectures Lecture 1b: Turing Machines & Halting Problem.
1 Chapter 9 Undecidability  Turing Machines Coded as Binary Strings  Universal Turing machine  Diagonalizing over Turing Machines  Problems as Languages.
Summary of Previous Class There are languages that are not decidable –(we have not proved this yet) Why not extend Turing machines just as we did with.
Universal Turing Machine
Computability. Turing Machines Read input letter & tape letter, write tape letter, move left or right.
CS6800 Advance Theory of Computation Spring 2016 Nasser Alsaedi
Chapters 11 and 12 Decision Problems and Undecidability.
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesTuring.
More About Turing Machines
8. Introduction to Turing Machines
More variants of Turing Machines
Part VI NP-Hardness.
Non Deterministic Automata
Turing Machines.
Pushdown Automata.
OTHER MODELS OF TURING MACHINES
CSE 105 theory of computation
Turing Machines Acceptors; Enumerators
Hierarchy of languages
Summary.
Jaya Krishna, M.Tech, Assistant Professor
Turing Machines (TM) Deterministic Turing Machine (DTM)
8. Introduction to Turing Machines
CSE 105 theory of computation
Variants of Turing machines
Intro to Theory of Computation
CSE 105 theory of computation
Presentation transcript:

1 8.4 Extensions to the Basic TM Extended TM’s to be studied: Multitape Turing machine Nondeterministic Turing machine The above extensions make no increase of the original TM’s power, but make TM’s easier to use: Multitape TM --- useful for simulating real computers Nondeterministic TM --- making TM programming easier.

2 8.4 Extensions to the Basic TM Multitape TM’s Finite control Tape 1 Tape 2 Tape 3 Figure A multitape TM.

3 8.4 Extensions to the Basic TM Multitape TM’s Initially, the input string is placed on the 1 st tape; the other tapes hold all blanks; the finite control is in its initial state; the head of the 1 st tape is at the left end of the input; the tape heads of all other tapes are at arbitrary positions. A move consists of the following steps: the finite control enters a new state; on each tape, a symbol is written; each tape head moves left or right, or stationary.

4 8.4 Extensions to the Basic TM Equivalence of One –tape & Multitape TM’s Theorem 8.9 Every language accepted by a multitape TM is recursive enumerable. (That is, the one-tape TM and the multitape one are equivalent) Proof: see the textbook.

5 8.4 Extensions to the Basic TM Running Time and the Many-Tapes-to- One Construction Theorem 8.10 The time taken by the one-tape TM of Theorem 8.9 to simulate n moves of the k-tape TM is O(n 2 ). Proof: see the textbook. Meaning: the equivalence of the two types of TM’s is good in the sense that their running times are roughly the same within polynomial complexity.

6 8.4 Extensions to the Basic TM Nondeterministic TM’s A nondeterministic TM (NTM) has multiple choices of next moves, i.e.,  (q, X) = {(q 1, Y 1, D 1 ), (q 2, Y 2, D 2 ), …, (q k, Y k, D k )}. The NTM is not any ‘powerful’ than a deterministic TM (DTM), as said by the following theorem. Theorem 8.11 If M N is NTM, then there is a DTM M D such that L(M N ) = L(M D ). (for proof, see the textbook)

7 8.4 Extensions to the Basic TM Nondeterministic TM’s The equivalent DTM constructed for a NTM in the last theorem may take exponentially more time than the DTM. It is unknown whether or not this exponential slowdown is necessary! More investigation will be done in Chapter 10.

8 8.5 Restricted TM’s Restricted TM’s to be studied: the tape is infinite only to the right, and the blank cannot be used as a replacement symbol; the tapes are only used as stacks (“stack machines”); the stacks are used as counters only (“counter machines”). The above restrictions make no decrease of the original TM’s power, but are useful for theorem proving. Undecidability of the TM also applies to these restricted TM’s.

9 8.5 Restricted TM’s TM’s with Semi-infinite Tapes Theorem 8.12 Every language accepted by a TM M 2 is also accepted by a TM M 1 with the following restrictions: M 1 ’s head never moves left of its initial position (so the tape is semi-infinite essential); M 1 never writes a blank. (i.e., M 1 and M 2 are equivalent) Proof. See the textbook.

Restricted TM’s Multistack Machines Multistack machines, which are restricted versions of TM’s, may be regarded as extensions of pushdown automata (PDA’s). Actually, a PDA with two stacks has the same computation power as the TM. See Fig.8.20 for a figure of a multistack TM. Theorem 8.13 If a language is accepted by a TM, then it is accepted by a two-stack machine. Proof. See the textbook.

Restricted TM’s Counter Machines There are two ways to think of a counter machine. Way 1: as a multistack machine with each stack replaced by a counter regarded to be on a tape of a TM. A counter holds any nonnegative integer. The machine can only distinguish zero and nonzero counters. A move conducts the following operations:  changing the state;  add or subtract 1 from a counter which cannot becomes negative.

Restricted TM’s Counter Machines Way 2: as a restricted multistack machine with each stack replaced by a counter implemented on a stack of a PDA. There are only two stack symbols Z 0 and X. Z 0 is the initial stack symbol, like that of a PDA. Can replace Z 0 only by X i Z 0 for some i  0. Can replace X only by X i for some i  0. For an example of a counter machine of the 2 nd type, do the exercise (part a) of this chapter.

Restricted TM’s The Power of Counter Machines Every language accepted by a one-counter machine is a CFL. Every language accepted by a counter machine (of any number of counters) is recursive enumerable. Theorem 8.14 Every recursive enumerable language is accepted by a three-counter machine. Proof. See the textbook.

Restricted TM’s The Power of Counter Machines Theorem 8.15 Every recursive enumerable language is accepted by a two-counter machine. Proof. See the textbook.

Turing Machines and Computers In this section, it is shown informally that: a computer can simulate a TM; and that a TM can simulate a computer. That means: the real computer we use every day is nearly an implementation of the maximal computational model. under the assumptions that the memory space (including registers, RAM, hard disks, …) is infinite in size. the address space is infinite (not only that defined by 32 bits used in most computers today).

Turing Machines and Computers Simulating a TM by Computer If the previous two assumptions are not satisfied, then a real computer is actually a finite automaton! We can simulate an infinite memory space by “storage swapping.” Also, simulating the infinite tape of the TM by two stacks of disks, respectively for the left portion and the right portion of the tape, with the head as the middle.

Turing Machines and Computers Simulating a TM by a Computer Write a program on the computer to simulate the states and the symbols of the TM in the following way: encode the states as character strings; encode the tape symbols with fixed-length character strings, too; use a table of transitions to determine each move. By the above way, a TM may be said to be simulatable by a program of a real computer (informally)!

Turing Machines and Computers Simulating a Computer by a TM Meaning of this section: The TM is as powerful as a modern-day computer though it seems so simple! Sketch of the simulation using a Multitape TM (see Fig. 8.22) use a TM tape as the computer memory; use a TM tape to simulate the instruction counter; use a TM tape for the memory address; use a TM tape as scratch to perform computation operations on it.

Turing Machines and Computers Simulating a Computer by a TM Meaning of this section: the TM is as powerful as a modern-day computer though it seems so simple! Sketch of using a Multitape TM (see Fig. 8.22) to simulate the sequence of instructions (described by an assembly-language program usually) of the computer: use a TM tape as the computer memory; use a TM tape to simulate the instruction counter; use a TM tape for the memory address; use a TM tape as scratch to perform computation operations on it.

Turing Machines and Computers Simulating a Computer by a TM The TM simulates the instruction cycle of the computer using the above tapes. For more details, see pp of the textbook. Assume that the computer has an “accept” instruction. The TM simulate it and enters an accepting state. Essence of simulation above: the TM has many tapes of different purposes to use; the TM can do any computation on the tapes.

Turing Machines and Computers Comparing the Running Times of Computers and Turing Machines If the simulation discussed in the previous section take exponential times, then it is less meaningful. What is the fact? We hope the two types of machines are polynomially equivalent, i.e., the computer is simulatable by the TM in polynomial time. The answer is yes! (cont’d)

Turing Machines and Computers Comparing the Running Times of Computers and Turing Machines Theorem 8.17 If a computer: (1) has only instructions that increase the maximum word length by at most 1 and; (2) has only instructions that a multitape TM can perform on words of length k in (k 2 ) steps or less, then the TM described in Section can simulate n steps of the computer in O(n 3 ) of its own steps. (see the textbook for a proof)

Turing Machines and Computers Comparing the Running Times of Computers and Turing Machines Theorem 8.18 A computer of the type described in Theorem 8.17 can be simulated for n steps by a one-tape TM, using at most O(n 6 ) steps for the TM. Conclusion: the TM is as “powerful” as a real computer seen today!