Proposed in Turing’s 1936 paper

Slides:



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

Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
CS 461 – Nov. 9 Chomsky hierarchy of language classes –Review –Let’s find a language outside the TM world! –Hints: languages and TM are countable, but.
Rice ’ s Theorem. Def: A property of the Turing-recognizable languages is simply a subset of all Turing- recognizable languages.
Turing -Recognizable vs. -Decidable
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
1 COMP 382: Reasoning about algorithms Unit 9: Undecidability [Slides adapted from Amos Israeli’s]
Computability and Complexity 4-1 Existence of Undecidable Problems Computability and Complexity Andrei Bulatov.
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.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
CS 302: Discrete Math II A Review. An alphabet Σ is a finite set (e.g., Σ = {0,1}) A string over Σ is a finite-length sequence of elements of Σ For x.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
Courtesy Costas Busch - RPI1 Reducibility. Courtesy Costas Busch - RPI2 Problem is reduced to problem If we can solve problem then we can solve problem.
Lecture 27UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 27.
CS21 Decidability and Tractability
Prof. Busch - LSU1 Reductions. Prof. Busch - LSU2 Problem is reduced to problem If we can solve problem then we can solve problem.
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
Chapter 4: A Universal Program 1. Coding programs Example : For our programs P we have variables that are arranged in a certain order: Y 1 X 1 Z 1 X 2.
Lecture 18 Various TMs. Allow the head not move Theorem. If the head is allowed to stay at the cell in each move, then every function computed by the.
1 Undecidability Reading: Chapter 8 & 9. 2 Decidability vs. Undecidability There are two types of TMs (based on halting): (Recursive) TMs that always.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
A Universal Turing Machine
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)
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 7 Undecidability cont. Jan Maluszynski, IDA, 2007
Lecture 21 Reducibility. Many-one reducibility For two sets A c Σ* and B c Γ*, A ≤ m B if there exists a Turing-computable function f: Σ* → Γ* such that.
Recursively Enumerable and Recursive Languages
1 Recursively Enumerable and Recursive Languages.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Decidability.
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.
Decidability and Undecidability Proofs
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
The Acceptance Problem for TMs
A Universal Turing Machine
Recursively Enumerable and Recursive Languages
Automata, Grammars and Languages
Busch Complexity Lectures: Reductions
Linear Bounded Automata LBAs
Reductions.
Lecture12 The Halting Problem
Reductions Costas Busch - LSU.
Automata, Grammars and Languages
Homework: Friday Read Section 4.1. In particular, you must understand the proofs of Theorems 4.1, 4.2, 4.3, and 4.4, so you can do this homework. Exercises.
CS154, Lecture 10: Rice’s Theorem, Oracle Machines
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
CS154, Lecture 8: Undecidability, Mapping Reductions
CSCE 411 Design and Analysis of Algorithms
CS154, Lecture 10: Rice’s Theorem, Oracle Machines
CS154, Lecture 8: Undecidability, Mapping Reductions
CSCI 2670 Introduction to Theory of Computing
Decidable Languages Costas Busch - LSU.
Decidability and Undecidability
Undecidable problems:
Formal Languages, Automata and Models of Computation
CS21 Decidability and Tractability
Instructor: Aaron Roth
Cpt S 317: Spring 2009 Reading: Chapter 8 & 9
Instructor: Aaron Roth
Instructor: Aaron Roth
CS6382 Theory of Computation
Automata, Grammars and Languages
More Undecidable Problems
Presentation transcript:

Proposed in Turing’s 1936 paper Lecture 1-3 Universal TM Proposed in Turing’s 1936 paper

Code of a DTM Consider a one-tape DTM M = (Q, Σ, Γ, δ, s). It can be encoded as follows: First, encode each state, each direction, and each symbol into a natural number (code(B) = 1, code(R) =2, code(L) = 3, code(s)=4, code(h)=5, ... ). Then encode each transition δ(q, a) = (p, b, D) into a string 0 10 10 10 10 q a p b D

The code of M is obtained by combining all codes codei of transitions together: 111code111code211∙∙∙11codem111. Remark: Each TM has many codes. All codes of TMs form a Turing-decidable language.

Universal TM Input tape (read only) <x,code(M)> 2nd tape Code(M) 3rd tape x (simulate M)

Universal DTM One can design a three-tape DTM M* which behaves as follows: On input <x, code(M)>, M* first decodes M on the second tape and then simulates M on the output tape. Clearly, L(M*) = { <x, code(M)> | x ε L(M)}. Thus, Theorem 1. { <x, code(M)> | x ε L(M)} is Turing-acceptable.

Universal DTM One can design a three-tape DTM M* which behaves as follows: On input <x, M>, M* first decodes M on the second tape and then simulates M on the output tape. Clearly, L(M*) = { <x, M> | x ε L(M)}. Thus, Theorem 1. { <x, M> | x ε L(M)} is Turing-acceptable.

Good Exercise Define a machine code for k-tape DTM. Construct a 3-tape universal TM working on input <x,M> where M can be k-tape DTM for any k (not fixed).

Next, we prove Theorem 2. { <x, M> | x ε L(M)} is not Turing-decidable. To do so, we consider A = { M | M accepts M} and prove Lemma. A isn't Turing-decidable.

Next, we prove Theorem 2. { <x, M> | x ε L(M)} is not Turing-decidable. To do so, we consider A = { code(M) | M accepts code(M)} and prove Lemma. A isn't Turing-decidable.

Barber cuts his own hair Class 1: {Barber | he can cut his own hair} Class 2: {Barber | he cannot cut own hair} Question: Is there a barber who cuts hair of everybody in class 2, but not cut hair of anybody in class 1. Answer: No!!! Proof. Suppose such a barber exists. If he cuts his own hair, then he is in class 1 and hence he cannot cut his own hair, a contradiction.

This argument is called diagonalization. If he cannot cut his own hair, then he belongs to class 2 and hence he can cut his own hair, a contradiction. This argument is called diagonalization. hair barber

translation Barber <==> TM Hair <==> code (TM) Such barber exists <==> there exists a TM accepts class 2 & rejects class 1 <==> this TM decides class 1

Proof. For contradiction, suppose that A is accepted by a one-tape DTM M’. We look at M’ on input M’. If M’ accepts M’, then M’ is in A, which means that M’ rejects M’, a contradiction. If M’ rejects M’, then M’ isn’t in A which means that M’ accepts M’, a contradiction.

Then this number is not rational. Good Exercise: Show, by diagonalization, that there exists an irrational number. Proof. Consider all rational numbers in (0,1). They are countable, a1, a2, …. Now, we construct a number such that its i-th digit is different from the i-th digit of ai. Then this number is not rational. digits a1 a2

Many-one reduction Consider two sets A c Σ* and B c Γ*. If there exists a Turing-computable total function f : Σ* → Γ* such that x ε A iff f(x) ε B, then we say that A is many-one reducible to B, and write A ≤m B.

A = { M | M accepts M} B = {<x,M> | M accepts x} Claim. A ≤m B. Proof. Define f(M) = <M,M>. M ε A iff M accepts M iff <M, M> ε B

Theorem. A ≤m B, B ≤m C imply A ≤m C. (This means that ≤m is a partial ordering.) Theorem. If A ≤m B and B is Turing-decidable, then A is Turing-decidable. By this theorem, {<x, M> | M accepts x} isn’t Turing-decidable.

Theorem 2. B={ <x, M> | x ε L(M)} is not Turing-decidable. To do so, we consider A = { M | M accepts M} and prove Lemma. A isn't Turing-decidable. Claim. A ≤m B. Thus, B is not Turing-decidable

Complete in r. e. A set A is complete in r. e. if (1) A is in r.e, and (2) for every r. e. set B, B ≤m A .

Halting problem Theorem. K = { <x, M> | M accepts x } is complete in r. e. . Proof. (1) K is a r. e. set. (2) For any r. e. set A, there exists a DTM MA such that A = L(MA). For every input x of MA, define f(x) = <x, MA>. Then x ε A iff f(x) ε K .

Nonempty Nonempty = {M | L(M) ≠ Φ } is complete in r. e. Proof. (1) Nonempty is a r. e. set. Construct a DTM M* as follows: For each M, we may try every input of M, one by one. If M accepts an input, then M is accepted by M*.

(2) K ≤m Nonempty. Suppose M’ is a DTM accepting every input. For each input <x, M> of K, we define f(<x, M>) = M<x,M> where M<x,M> is a DTM working as follows: on an input y, Step 1. M<x,M> simulates M on input x. If M accepts x, then go to Step 2. Step 2. M<x,M> simulates M’ on input y

Therefore, <x, M> ε K => M accepts x => M<x,M> accepts every input y => f(<x, M>) = M<x,M> ε Nonempty <x, M> not in K => M doesn’t halt on x => M<x,M> doesn’t halt on y => L(M<x,M>) = Φ => f(<x, M>) not in Nonempty

r. e. –hard A set B is r. e.-hard if for every r. e. set A, A ≤m B Remark Every complete set is r. e.-hard. However, not every r. e.-hard set is complete. Every r. e.-hard set is not recursive.

Empty = {M | M accepts nothing} Empty is not r. e. Empty is not complete. Empty is r.e.-hard. ??? (see proof of Rice Theorem)

r. e. property A subset P of TM codes is called a r. e. property if M ε P and L(M’) = L(M) imply M’ ε P. e.g., Nonempty, Empty, All are r. e. properties. Question: Give an example which is a subsets of TM codes, but not a r. e. property.

Nontrivial A r. e. property is trivial if either it is empty or it contains all r. e. set.

Rice Theorem 1 Every nontrivial r. e. property is not recursive.

Proof Let P be a nontrivial r. e. property. For contradiction. Suppose P is a recursive set. So is its complement. Note that either P or its complement P does not contains the empty set. Without loss of generality, assume that P does not contains the empty set.

Since P is nontrivial, P contains a nonempty r. e. set A. Let Ma be a TM accepting A, i.e., A=L(Ma). We want to prove K ≤m P. For each input <x,M> of K, we define f(<x, M>) = M<x,M> where M<x,M> is a DTM working as follows. For each input y of M<x,M>, it first goes to Step 1.

Step 1. M<x,M> simulates M on input x of M Step 1. M<x,M> simulates M on input x of M. If M accepts x, then go to Step 2. Step 2. M<x,M> simulates Ma on y. If Ma accepts y, then M<x,M> accepts y. Therefore, if <x, M> ε K then L(M<x,M>) = L(Ma) = A ε P, and if <x, M> not in K, then L(M<x,M>) = Φ not in P

Since K is not recursive and K ≤m P, we obtain a contradiction. ******************************************** Recursive = {M | L(M) is recursive} is not recursive. RE = {M | L(M) is r. e.} is trivial.

Empty = {M | M accepts nothing} Empty is not deciable (by 1st Rice Thm) Empty is not r. e. (since Nonempty is r.e.) Empty is not complete. Empty is r.e.-hard. (need a proof!)

All = {M | M accepts all inputs} All is not decidable. All is not r. e. All is not complete. All is r. e. hard. (need a proof!)

Question: Is K an r. e. property? Is every r. e. property complete? Is it true that for any r. e. property, either it or its complement is complete?

Rice Theorem 2 A r. e. property P is r. e. iff the following three conditions hold: If A ε P and A c B for some r. e. set B, then B ε P. (2) If A is an infinite set in P, then A has a finite subset in P. (3) The set of finite languages in P is enumerable, in the sense that there is a TM that generates the (possibly) infinite string code1#code2# …, where codei is a code for the ith finite languages in P.

The code for the finite language {w1, w2, …, wn} is [w1,w2,…,wn]. In other words, there exists an r. e. set B that is a subset of codes of finite languages in P such that for every finite language F in P, B contains at least one code of F.

Examples All is not r. e. because All does not satisfy condition (2). The complement of ALL is not r. e. because it does not satisfy condition (1). Empty is not r. e. because it does not satisfy (1) Nonempty is r. e. because it satisfies (1), (2) and (3).

Undecidable Problems

Given TMs M and M’, is it true that L(M)=L(M’)? This problem is undecidable, i.e., A = {<M,M’> | L(M) = L(M’)} is not recursive. Proof. Empty ≤m A. Let Mo be a fixed TM such that L(Mo) = Φ. Define f(M) =<M, Mo>. Then, M ε Empty iff <M, Mo> ε A.

Let A and B be two nonempty proper subsets of Σ Let A and B be two nonempty proper subsets of Σ*. If A B and B A are recursive, then A ≤m B. Proof. Let y ε B and z ε B. Define y if x ε A B f(x) = z if x ε B A x, otherwise

Research Problem For a DFA M=(Q, Σ, δ, s, F), L(M) = L(M*) where M* = (Q, Σ, δ, s, Q-F). Given a DTM M, could we have an algorithm to compute a DTM M* such that L(M*) = L(M) when L(M) is regular, and M* will not halt when L(M) is not regular?