CS21 Decidability and Tractability

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

INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Lecture 3 Universal TM. Code of a DTM Consider a one-tape DTM M = (Q, Σ, Γ, δ, s). It can be encoded as follows: First, encode each state, each direction,
Variants of Turing machines
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.
Courtesy Costas Busch - RPI1 A Universal 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)
Decidable and undecidable problems deciding regular languages and CFL’s Undecidable problems.
Lecture 5 Turing Machines
CHAPTER 4 Decidability Contents Decidable Languages
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
CS 310 – Fall 2006 Pacific University CS310 The Halting Problem Section 4.2 November 15, 2006.
January 28, 2015CS21 Lecture 101 CS21 Decidability and Tractability Lecture 10 January 28, 2015.
CS21 Decidability and Tractability
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
The Halting Problem – Undecidable Languages Lecture 31 Section 4.2 Wed, Oct 31, 2007.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
A Universal Turing Machine
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.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
D E C I D A B I L I T Y 1. 2 Objectives To investigate the power of algorithms to solve problems. To explore the limits of algorithmic solvability. To.
Computability Universal Turing Machine. Countability. Halting Problem. Homework: Show that the integers have the same cardinality (size) as the natural.
Lecture 24UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24.
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.
The Acceptance Problem for TMs
A Universal Turing Machine
This statement is false.
Linear Bounded Automata LBAs
Lecture12 The Halting Problem
CSCI 2670 Introduction to Theory of Computing
Reductions Costas Busch - LSU.
CS21 Decidability and Tractability
Variants of Turing machines
Pumping Lemma Revisited
CSE 105 theory of computation
BCS 2143 Theory of Computer Science
CS154, Lecture 7: Turing Machines.
MCC 2093 Advanced Theoretical Computer Science
CSE 105 theory of computation
Turing Machines Acceptors; Enumerators
COSC 3340: Introduction to Theory of Computation
Summary.
Chapter 3: The CHURCH-Turing thesis
فصل سوم The Church-Turing Thesis
Intro to Theory of Computation
Decidable Languages Costas Busch - LSU.
CS21 Decidability and Tractability
MA/CSSE 474 Theory of Computation
CS154, Lecture 13: P vs NP.
Formal Languages, Automata and Models of Computation
Intro to Theory of Computation
CS21 Decidability and Tractability
Decidability and Tractability
CSCI 2670 Introduction to Theory of Computing
CS21 Decidability and Tractability
Instructor: Aaron Roth
CSE 105 theory of computation
CSCI 2670 Introduction to Theory of Computing
Variants of Turing machines
Instructor: Aaron Roth
MA/CSSE 474 Theory of Computation
Intro to Theory of Computation
Intro to Theory of Computation
CSE 105 theory of computation
Presentation transcript:

CS21 Decidability and Tractability Lecture 10 January 30, 2019 January 30, 2019 CS21 Lecture 10

Outline Turing Machines and variants Church-Turing Thesis multitape TMs nondeterministic TMs Church-Turing Thesis decidable, RE, co-RE languages the Halting Problem January 30, 2019 CS21 Lecture 10

(Q, Σ, Γ, δ, q0, qaccept, qreject) where: Nondeterministic TMs A important variant: nondeterministic TM informally, several possible next configurations at each step formally, a NTM is a 7-tuple (Q, Σ, Γ, δ, q0, qaccept, qreject) where: everything is the same as a TM except the transition function: δ:Q x Γ → P(Q x Γ x {L, R}) January 30, 2019 CS21 Lecture 10

NTM acceptance start configuration: q0w (w is input) accepting config.: any config.with state qaccept rejecting config.: any config. with state qreject NTM M accepts input w if there exist configurations C1, C2, …, Ck C1 is start configuration of M on input w Ci ⇒ Ci+1 for i = 1, 2, 3, …, k-1 Ck is an accepting configuration January 30, 2019 CS21 Lecture 10

Nondeterministic TMs Theorem: every NTM has an equivalent (deterministic) TM. Proof: Idea: simulate NTM with a deterministic TM January 30, 2019 CS21 Lecture 10

Nondeterministic TMs Simulating NTM M with a deterministic TM: Cstart computations of M are a tree nodes are configs fanout is b = maximum number of choices in transition function leaves are accept/reject configs. rej acc January 30, 2019 CS21 Lecture 10

Nondeterministic TMs Simulating NTM M with a deterministic TM: idea: breadth-first search of tree if M accepts: we will encounter accepting leaf and accept if M rejects: we will encounter all rejecting leaves, finish traversal of tree, and reject if M does not halt on some branch: we will not halt… January 30, 2019 CS21 Lecture 10

Nondeterministic TMs Simulating NTM M with a deterministic TM: use a 3 tape TM: tape 1: input tape (read-only) tape 2: simulation tape (copy of M’s tape at point corresponding to some node in the tree) tape 3: which node of the tree we are exploring (string in {1,2,…b}*) Initially, tape 1 has input, others blank STEP 1: copy tape 1 to tape 2 January 30, 2019 CS21 Lecture 10

Nondeterministic TMs Simulating NTM M with a deterministic TM: STEP 2: simulate M using string on tape 3 to determine which choice to take at each step if encounter blank, or a # larger than the number of choices available at this step, abort, go to STEP 3 if get to a rejecting configuration: DONE = 0, go to STEP 3 if get to an accepting configuration, ACCEPT STEP 3: replace tape 3 with lexicographically next string and go to STEP 2 if string lengthened and DONE = 1 REJECT; else DONE = 1 January 30, 2019 CS21 Lecture 10

Examples of basic operations Convince yourself that the following types of operations are easy to implement as part of TM “program” (but perhaps tedious to write out…) copying moving incrementing/decrementing arithmetic operations +, -, *, / January 30, 2019 CS21 Lecture 10

Universal TMs and encoding the input to a TM is always a string in Σ* often we want to interpret the input as representing another object examples: tuple of strings (x, y, z) 0/1 matrix graph in adjacency-list format Context-Free Grammar January 30, 2019 CS21 Lecture 10

Universal TMs and encoding the input to a TM is always a string in Σ* we must encode our input as such a string examples: tuples separated by #: #x#y#z 0/1 matrix given by: #n#x# where x ∈ {0,1}n2 any reasonable encoding is OK emphasize “encoding of X” by writing <X> January 30, 2019 CS21 Lecture 10

Universal TMs and encoding some strings not valid encodings and these are not in the language invalid L “yes” “no” ∑* make sure TM can recognize invalid encodings and reject them January 30, 2019 CS21 Lecture 10

Universal TMs and encoding We can easily construct a Universal TM that recognizes the language: ATM = {<M, w> : M is a TM and M accepts w} how? this is a remarkable feature of TMs (not possessed by FA or NPDAs…) means there is a general purpose TM whose input can be a “program” to run January 30, 2019 CS21 Lecture 10

Church-Turing Thesis many other models of computation we saw multitape TM, nondeterministic TM others don’t resemble TM at all common features: unrestricted access to unlimited memory finite amount of work in a single step every single one can be simulated by TM many are equivalent to a TM problems that can be solved by computer does not depend on details of model! January 30, 2019 CS21 Lecture 10

Church-Turing Thesis the belief that TMs formalize our intuitive notion of an algorithm is: Note: this is a belief, not a theorem. The Church-Turing Thesis everything we can compute on a physical computer can be computed on a Turing Machine January 30, 2019 CS21 Lecture 10

Recursive Enumerability Why is “Turing-recognizable” called RE? Definition: a language L ⊆ Σ* is recursively enumerable if there is exists a TM (an “enumerator”) that writes on its output tape #x1#x2#x3#... and L = {x1, x2, x3, …}. The output may be infinite January 30, 2019 CS21 Lecture 10

Recursive Enumerability Theorem: A language is Turing-recog-nizable iff some enumerator enumerates it. Proof: (⇐) Let E be the enumerator. On input w: Simulate E. Compare each string it outputs with w. If w matches a string output by E, accept. January 30, 2019 CS21 Lecture 10

Recursive Enumerability Theorem: A language is Turing-recog-nizable iff some enumerator enumerates it. Proof: (⇒) Let M recognize language L ⊆ Σ*. let s1, s2, s3, … be enumeration of Σ* in lexicographic order. for i = 1,2,3,4,… simulate M for i steps on s1, s2, s3, …, si if any simulation accepts, print out that sj January 30, 2019 CS21 Lecture 10

Undecidability decidable ⊆ RE ⊆ all languages regular languages context free languages RE decidable ⊆ RE ⊆ all languages our goal: prove these containments proper January 30, 2019 CS21 Lecture 10

Countable and Uncountable Sets the natural numbers N = {1,2,3,…} are countable Definition: a set S is countable if it is finite, or it is infinite and there is a bijection f: N → S January 30, 2019 CS21 Lecture 10

Countable and Uncountable Sets Theorem: the positive rational numbers Q = {m/n : m, n ∈ N } are countable. Proof: … 1/1 1/2 1/3 1/4 1/5 1/6 … 2/1 2/2 2/3 2/4 2/5 2/6 … 3/1 3/2 3/3 3/4 3/5 3/6 … 4/1 4/2 4/3 4/4 4/5 4/6 … 5/1 … January 30, 2019 CS21 Lecture 10

Countable and Uncountable Sets Theorem: the real numbers R are NOT countable (they are “uncountable”). How do you prove such a statement? assume countable (so there exists bijection f) derive contradiction (some element not mapped to by f) technique is called diagonalization (Cantor) January 30, 2019 CS21 Lecture 10

Countable and Uncountable Sets Proof: suppose R is countable list R according to the bijection f: n f(n) _ 1 3.14159… 2 5.55555… 3 0.12345… 4 0.50000… … January 30, 2019 CS21 Lecture 10

Countable and Uncountable Sets Proof: suppose R is countable list R according to the bijection f: n f(n) _ 1 3.14159… 2 5.55555… 3 0.12345… 4 0.50000… … set x = 0.a1a2a3a4… where digit ai ≠ ith digit after decimal point of f(i) (not 0, 9) e.g. x = 0.2312… x cannot be in the list! January 30, 2019 CS21 Lecture 10