Lecture 24UofH - COSC 3340 - Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Variants of Turing machines
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.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
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.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
CS5371 Theory of Computation Lecture 11: Computability Theory II (TM Variants, Church-Turing Thesis)
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Recursively Enumerable and Recursive Languages
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
Lecture 5 Turing Machines
Turing Machines.
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
January 28, 2015CS21 Lecture 101 CS21 Decidability and Tractability Lecture 10 January 28, 2015.
Lecture 27UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 27.
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Chapter 9 Turing Machine (TMs).
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
Turing Machines A more powerful computation model than a PDA ?
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
חישוביות וסיבוכיות Computability and Complexity Lecture 7 TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A AAAA.
Lecture 2UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 2.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
Turing Machines Chapter 17. Languages and Machines SD D Context-Free Languages Regular Languages reg exps FSMs cfgs PDAs unrestricted grammars Turing.
Turing Machines. Intro to Turing Machines A Turing Machine (TM) has finite-state control (like PDA), and an infinite read-write tape. The tape serves.
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.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
Lecture 11UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 11.
Recursively Enumerable and Recursive Languages
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
1 Introduction to Turing Machines
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
Turing Machines Sections 17.6 – The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Universal Turing Machine
1 Recursively Enumerable and Recursive Languages.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
Chapters 11 and 12 Decision Problems and Undecidability.
COSC 3340: Introduction to Theory of Computation
Busch Complexity Lectures: Turing Machines
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
COSC 3340: Introduction to Theory of Computation
Turing Machines Acceptors; Enumerators
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
Decidable Languages Costas Busch - LSU.
CS21 Decidability and Tractability
COSC 3340: Introduction to Theory of Computation
Formal Languages, Automata and Models of Computation
Instructor: Aaron Roth
CSE 105 theory of computation
COSC 3340: Introduction to Theory of Computation
Theory of Computation Lecture 23: Turing Machines III
Intro to Theory of Computation
CSE 105 theory of computation
Presentation transcript:

Lecture 24UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24

UofH - COSC Dr. Verma 2 Definition of Nondeterministic TM A Nondeterministic Turing Machine M = (K, , , s) – K, , and s are as for standard Turing machine –   (K X  ) X ((K  {h}) X (   {L, R})) Configurations and the relation |─ M and |─ M * are defined in the natural way but now |─ M need not be single-valued: – One configuration may yield several others in one step. NTMs will only be constructed as language acceptors – Only one accepting computation required for input to be accepted.

Lecture 24UofH - COSC Dr. Verma 3 Example: L = {w  {a, b}*: w contains an occurrence of the substring abaab L LLLLa # b, # a, #b, ## abaab a, b

Lecture 24UofH - COSC Dr. Verma 4 Example: L = {w  {a, b}*: w contains an occurrence of the substring abaab} The machine receives input in the form #w#, where w  {a,b}*. It first scans from the right to left and nondeterministically guesses a point in w to start checking for the specified pattern. It checks to see that the next five symbols are, from right to left, b, a, a, b, a. If this pattern is detected, the machine halts and therefore accepts the input string. If a violation of this pattern is found, the machine goes into an infinite loop.

Lecture 24UofH - COSC Dr. Verma 5 Example: L = {I n : n is composite} RIRIR# # # Given input #I n # – Nondeterministically choose two numbers p, q > 1 and transform the input into #I n #I p #I q #. See TM for writing I p above. – Use the multiplication machine to transform the result of Step 1 into #I n #I p * q #. – Check to see that I n = I p * q ; this is easy, since only the lengths of these strings need to be compared. Halt if the lengths are equal; otherwise continue computing forever in some trivial fashion.

Lecture 24UofH - COSC Dr. Verma 6 Simulation Idea for NTM DTM will explore the computation graph in BFS (breadth-first order ) fashion. Enumerate all possible computation starting from all 1-step computations, then 2-step computations, … b 1 2 b 1 2 b 1 2 b Initial configurations NTM NTM are designed as language acceptors only halt & accept

Lecture 24UofH - COSC Dr. Verma 7 Simulation Idea for NTM D 0010 … xx#□ … 12□ … □□ 01x Deterministic TM D simulating nondeterministic TM N input tape simulation tape address tape

Lecture 24UofH - COSC Dr. Verma 8 Simulation Idea for NTM N Initially tape 1 contains the input w, and tapes 2 and 3 are empty. Copy tape 1 onto tape 2. Use tape 2 to simulate N with input w on one branch of its nondeterministic computation. – Consult tape 3 to determine which choice to make. – If no more symbol remain on tape 3 or if choice invalid, abort and go to next step. – Go to next step if a reject configuration is encountered Replace the string on tape 3 with the lexicographically next string. Simulate the next branch of N’s computation by going to stage 2.

Lecture 24UofH - COSC Dr. Verma 9 Church-Turing Thesis The thesis states that: – The Turing Machine is the formal equivalent of the informal concept of algorithm. It is NOT a theorem, since it cannot be proved. (Algorithm is an informal concept). Recall, algorithm -- a sequence of precise steps, each of which can be executed in a finite amount of time with finite resources. – Precise means no intelligence or judgment required, can be executed literally.

Lecture 24UofH - COSC Dr. Verma 10 Evidence for the Thesis All reasonable formal models so far have turned out to be equivalent to TM. Reasonable -- means no infinite resources or power. Examples of other formal models: – Post Correspondence systems – Random Access Machine model – Unrestricted grammars. – Partial Recursive Functions, etc.

Lecture 24UofH - COSC Dr. Verma 11 Universal Turing Machine We shall assume that there are fixed countably infinite sets K  = {q 1, q 2, q 3, …} and   = {a 1, a 2, a 3, …} such that for every TM, the state set is a finite subset of K  and the tape alphabet is a finite subset of  .

Lecture 24UofH - COSC Dr. Verma 12 Universal Turing Machine (contd.) Let c be another symbol – We encode TM over the two-symbol alphabet {c, I}. Let M = (K, , , s) be a TM where now K  K  and    . Thus K = {q i1, q i2, …, q ik } and  = {a j1, a j2, …, a jk } where i 1 < i 2 < … < i k and j 1 < j 2 < … < j k s = q im for some m, 1  m  k  (  ) qiqi I i+1 hI LI RII aiai I i+2

Lecture 24UofH - COSC Dr. Verma 13 Universal Turing Machine (contd.) Next we define kl strings S pr the transition function where 1  p  k and 1  r  l Let  (q ip, a jr ) = (q’, b), where – q’  K  {h} – b    {L, R} Let S pr = cw1cw2cw3cw4c, where – w 1 = (q ip ) – w 2 = (a jr ) – w 3 = (q’) – w 4 = (b)

Lecture 24UofH - COSC Dr. Verma 14 Universal Turing Machine (contd.) A Universal TM uses the encoding  (M) of other machines as programs to direct its operation. Therefore, U takes two arguments –  (M) – description of machine M –  (w) – encoding of input string w and performs whatever M does on w.

Lecture 24UofH - COSC Dr. Verma 15 Universal Turing Machine (contd.) If M halts on input w, then U halts on an input consisting of the encoding of M followed by the encoding of w. If U halts on an input consisting of the encoding of M followed by the encoding of w, then M halts on input w

Lecture 24UofH - COSC Dr. Verma 16 Universal TM as a 3-tape TM Let U’ = 3-tape TM U’ uses it three tapes as follows: The first tape contains the encoding of the tape of M The second tape contains the encoding of M itself The third tape contains the encoding of the state of M at the current point in the simulated computation.

Lecture 24UofH - COSC Dr. Verma 17 Universal TM as a 3-tape TM U’ U’ is started with some string #  (M)  (w) on its first tape and the other two tapes are blank. – First U’ moves  (M) onto the second tape and shift  (w) down to the left end of the first tape, preceding it by #c  (#) and following it by (#)c. Thus at this point the first tape contains #  (#w#). – From  (M), U’ extracts the encoding of the initial state of M, which it copies onto the third tape.

Lecture 24UofH - COSC Dr. Verma 18 Universal TM as a 3-tape TM U’ (contd.) – U’ sets about simulating the steps of the computation of M U’ keeps the head on the second and third tapes at the left – Since M starts off scanning the last blank of #w#, U’ should begin its simulation by moving its head on the first tape to the last c on the tape.

Lecture 24UofH - COSC Dr. Verma 19 Universal TM as a 3-tape TM U’ (contd.) – Now U’ finds on its second tape the block of the form ccI i cI j cI k cI l cc such that I i is the sting of I’s ending at the current head position on the third tape I j is that on the first tape, and changes the first tape appropriately. – Finally, U’ puts I k on the third tape and checks whether the third tape now contains (h). If it does not, then U’ simulates another computation step by M If it does, then U’ itself halts.