Complexity and Computability Theory I

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

Introduction to Computability Theory
Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Variants of Turing machines
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
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 ? ?
CS 310 – Fall 2006 Pacific University CS310 Turing Machines Section 3.1 November 6, 2006.
Lecture 5 Turing Machines
Computation Theory Introduction to Turing Machine.
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
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 ? ?
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Complexity and Computability Theory I Lecture #13 Instructor: Rina Zviel-Girshin Lea Epstein Yael Moses.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
CSCI 2670 Introduction to Theory of Computing September 28, 2005.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
Turing Machines – Decidability Lecture 25 Section 3.1 Fri, Oct 19, 2007.
Turing Machines Chapter 17. Languages and Machines SD D Context-Free Languages Regular Languages reg exps FSMs cfgs PDAs unrestricted grammars Turing.
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Part 1 – Pages COMPUTABILITY THEORY.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich
Lecture 9  2010 SDU Lecture9: Turing Machine.  2010 SDU 2 Historical Note Proposed by Alan Turing in 1936 in: On Computable Numbers, with an application.
CS 3240: Languages and Computation
CSCI 2670 Introduction to Theory of Computing October 7, 2004.
Lecture 24UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
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 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.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CSCI 2670 Introduction to Theory of Computing September 29, 2005.
Theory of Computation Automata Theory Dr. Ayman Srour.
The Church-Turing Thesis
Recursively Enumerable Languages
Busch Complexity Lectures: Turing Machines
Turing Machines.
CS21 Decidability and Tractability
Turing Machines Chapter 17.
Pumping Lemma Revisited
CS154, Lecture 7: Turing Machines.
COSC 3340: Introduction to Theory of Computation
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
Turing Machines Acceptors; Enumerators
Turing Machines Sipser pages
COSC 3340: Introduction to Theory of Computation
Chapter 3: The CHURCH-Turing thesis
فصل سوم The Church-Turing Thesis
Intro to Theory of Computation
CSE 105 theory of computation
CS21 Decidability and Tractability
MA/CSSE 474 Theory of Computation
The Church-Turing Thesis
Decidability and Tractability
CSE 105 theory of computation
CSE 105 theory of computation
Instructor: Aaron Roth
Computability Catch up last lecture. Turing machines. Variations
Variants of Turing machines
Turing Machines Everything is an Integer
Intro to Theory of Computation
CSE 105 theory of computation
CSE 105 theory of computation
Presentation transcript:

Complexity and Computability Theory I Lecture #14 Instructor: Rina Zviel-Girshin Lea Epstein Computation & Complexity/Y. Moses

Formally: (Q, , , , q0, qaccept, qreject) Q is the set of states.  is the input alphabet _  .  is the tape alphabet, _ and . :Qx  Qxx{R,L} the transition function. q0, qaccept, qreject the start, accept and reject states. qaccept  qreject Computation & Complexity/Y. Moses

Example of TM Computing a Function f1(w)=0|w| For every , (q0, )=(q0,0,R) (q0,_)=(q1,_,R). (q1,_)=(qaccept,_,L). s 1 2 3 4 5 qaccept Computation & Complexity/Y. Moses

Computing the Function: f2(w)=w For every , (q0, )=(q0, ,R) (q0,_)=(q1,_,R). (q1,_)=(qaccept,_,L). Computation & Complexity/Y. Moses

States as Memory of Symbols For each  there exists a state q. M that returns n of the input w= 12 ...n. (q0, i)=(qi,#,R) mark left cell+ remember first cell. (qi, j)=(qj,_,R) erase and remember the current cell. (qi, _)=(q’i,_,L) end-of-tape + return the last cell. (q’i, _)=(q’i,_,L) go backward with last cell. (q’i, #)=(qaccept, i,R) detect left cell write right cell+ stop. Computation & Complexity/Y. Moses

M that Computes the Right Cyclic Transformation: f(12 ...n)= n12 ...n-1 Remember the left cell (using a state), mark it with # and move Right. Until right-end, _, write the previous cell value, remember the current value, and move right. When reach the right end, remember the value by the state and move left until reach the first cell, #. Write the last cell value in the first cell and stop. Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses B={w#w|w{0,1}*} Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses Summary TM: formal definition (Q, , , , q0, qaccept, qreject) TM: input. TM: output. Some examples. Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses A “Stay” Move Can use: (q0,_)=(q1,_,R) (q1,_)=(qaccept,_,L) :Qx  Qxx{R,L,S} Computation & Complexity/Y. Moses

Computing the Function: f2(w)=w For every , (q0, )=(q0, ,R) (q0,_)=(qaccept,_,S). Computation & Complexity/Y. Moses

Computers and Intuitive Computation Every computer has a set of “simple” steps that change the environment. Can every function be computed by some computer? Formally: Can every function f:{0,1}* :{0,1}* be computed? Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses Class 2 TM Configurations A Decider A Language of a TM More Examples of TM’s Computation & Complexity/Y. Moses

Formally: (Q, , , , q0, qaccept, qreject) Q is the set of states q0, qaccept, qrejectQ .  is the input alphabet _  .  is the tape alphabet, _ and . :{Q\ qaccept, qreject }x  Qxx{R,L} the transition function. q0, qaccept, qreject the start, accept and rejects states. qaccept  qreject Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses Configuration The tape. The state. The control location on the tape. uqrejectv u,v * u=bbac v=bbdac b a c q d _ u v Computation & Complexity/Y. Moses

Intial Configuration: q0w The tape: w (the input) on the leftmost n squares of the tape. Example: w=00101 The rest of the tape is blank. The head starts on the left most square. 1 _ ... q0 Computation & Complexity/Y. Moses

Final Configuration: uqw q {qaccept , qreject} The tape contains uw: Example: u = 00 w=101, The rest of the tape is blank. The output is u. q 1 1 _ _ _ ... Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses C1 yields C2 if C2 can be “reached” from C1 by the  function. u v a b c qi d _ C1: u v b a c qj d _ C2: Computation & Complexity/Y. Moses

Special Case: left-hand end Right transition (qi,b)= (qj,c,R): qibv yields cqjv Left transition (qi,b)= (qj,c,L): qibv yields qjcv Computation & Complexity/Y. Moses

A Configuration Sequence For a given TM M we denote by C1* Cn the existence of a set of configurations. Where Ci yields Ci+1 for i=1,…,n Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses M accept w: If a sequence of configurations C1, C2,…,Cn exists where: 1. C1 is a start configuration with w. 2. Each Ci yields Ci+1 3. Cn is an accepting configuration. 1-2: C1  * Cn Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses M reject w: If a sequence of configurations C1, C2,…,Cn exists where: 1. C1 is a start configuration on input w. 2. Each Ci yields Ci+1 3. Cn is a rejecting configuration. 1-2: C1  * Cn Computation & Complexity/Y. Moses

Three possible outcomes of a TM Accept. Reject. Loop. not necessarily repeating the same steps. Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses M decides L: If M accepts all wL and M rejects all wL. That is: For every wL M accept w. For every wL M reject w. M is a Decider TM: If M Halts on all inputs. (never loop) Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses The Language of TM M L(M) = the collections of strings that M accepts. Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses Example The following TM M decides the language M=“on input string w 1. From left to right: cross off every other 0. 2. If in stage 1 a single 0 left: accept. an odd number of 0’s” reject. An even number: go to 1.” Computation & Complexity/Y. Moses

Example: B={w#w|w{0,1}*} M1=“On input string w: Scan and check that the input contains a single #. If not reject. Zig-zag to check whether corresponding positions on either sides of # contain the same symbol. If not, reject. Cross off the checked symbols. When all symbols to the left of # are crossed, check for remaining symbols to the right of #. If any symbol, reject. Otherwise, accept. Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses B={w#w|w{0,1}*} How are 0’s and 1’s decoded? Where are the reject states? Computation & Complexity/Y. Moses

TM for Deciding the Language C={aibjck|i x j=k and i,j,k>0} M3 on input w: 1. Scan to the right to check whether w{a* b* c*} if not, reject. 2. Return head to the left hand side. 3. Cross: one a and the same num. of b and c. 4. Restore the crossed b and return to 3. accept if all a’s and c’s are crossed. Computation & Complexity/Y. Moses

The Element Distinctness Problem E={#x1#x2#…#xn| xi{0,1}* and xixj ij} M4 is a TM that accept E: it compares each pair of xi and xj. At each “round” it marks a pair of the symbols # in an order that covers all possible pairs. It compares the two strings that follow the marked symbols #. Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses Alphabet Duplication How can we mark cells on the tape without changing their values? Duplicate the alphabet of  such that for each  there is another symbol ’ . . Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses B1={w1#w2|wi{0,1}* & w1 w2} What do we have to change? B={w#w|w{0,1}*} Computation & Complexity/Y. Moses

Turing-decidable Languages: B={w#w|w{0,1}*} C={aibjck|i x j=k and i,j,k>0} E={#x1#x2#…#xn| xi{0,1}* and xixi ij} Computation & Complexity/Y. Moses

Using a TM to Compute a Function. M is a TM that computes a (partial) function fM:*  * if there exist , * and qacceptQ s.t. q0w  *  qaccept. In this case fM(w)=. Computation & Complexity/Y. Moses

A Function With a Number of Arguments Use a special symbol on the tape to separate between the arguments. w1&w2&…wn where &. Examples of functions: add(w1,w2) mult(w1,w2) max(w1,w2) Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses Can we distinguish a machine that is looping from one that is merely taking a long time? Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses M recognize L: If M accepts all wL That is: For every wL M accept w. For every wL M reject w or M does not halt. Computation & Complexity/Y. Moses

Turing-Recognizable Language A language L is Turing recognizable if there exists a TM M that recognizes it. That is L(M) for some TM M. Also named recursively-enumerable Computation & Complexity/Y. Moses

Turing-Recognizable Languages: B={w#w|w{0,1}*} C={aibjck|i x j=k and i,j,k>0} E={#x1#x2#…#xn| xi{0,1}* and xixi ij} Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses Turing-recognizable Turing-decidable  Turing-decidable Turing-recognizable Computation & Complexity/Y. Moses

Computation & Complexity/Y. Moses Up to Here Definition of a TM. Configurations: initial, final, general, transitions . Coding S (stay) transition. Remember symbols by states. Mark symbols. Computing a function: input & output values. Recognizing/deciding a Language. Computation & Complexity/Y. Moses