MA/CSSE 474 Theory of Computation Enumerability Reduction.

Slides:



Advertisements
Similar presentations
Variants of Turing machines
Advertisements

The Recursion Theorem Sipser – pages Self replication Living things are machines Living things can self-reproduce Machines cannot self reproduce.
Turing -Recognizable vs. -Decidable
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Comparing Sets Size without Counting 2 sets A and B have the same size if there is a function f: A  B such that: For every x  A there is one and only.
The Big Picture Chapter 3. We want to examine a given computational problem and see how difficult it is. Then we need to compare problems Problems appear.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
More Turing Machines Sipser 3.2 (pages ). CS 311 Fall Multitape Turing Machines Formally, we need only change the transition function to.
More Turing Machines Sipser 3.2 (pages ).
1 Introduction to Computability Theory Lecture13: Mapping Reductions Prof. Amos Israeli.
Fall 2004COMP 3351 Undecidable problems for Recursively enumerable languages continued…
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
Lecture 8 Recursively enumerable (r.e.) languages
Recursively Enumerable and Recursive Languages
Decidable and undecidable problems deciding regular languages and CFL’s Undecidable problems.
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.
Courtesy Costas Busch - RPI1 Reducibility. Courtesy Costas Busch - RPI2 Problem is reduced to problem If we can solve problem then we can solve problem.
Theory of Computing Lecture 20 MAS 714 Hartmut Klauck.
MA/CSSE 474 Theory of Computation
CS21 Decidability and Tractability
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
MA/CSSE 474 Theory of Computation The Halting Problem.
CMPS 3223 Theory of Computation Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided.
Review Byron Gao. Overview Theory of computation: central areas: Automata, Computability, Complexity Computability: Is the problem solvable? –solvable.
TM Design Universal TM MA/CSSE 474 Theory of Computation.
MA/CSSE 474 Theory of Computation More Reduction Examples Non-SD Reductions.
1 Undecidability Reading: Chapter 8 & 9. 2 Decidability vs. Undecidability There are two types of TMs (based on halting): (Recursive) TMs that always.
MA/CSSE 474 Theory of Computation Decision Problems DFSMs.
CS 3813: Introduction to Formal Languages and Automata Chapter 12 Limits of Algorithmic Computation These class notes are based on material from our textbook,
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.
Turing -Recognizable vs. -Decidable
Decidability and Undecidability Proofs Sections 21.1 – 21.3.
Lecture 17 Undecidability Topics:  TM variations  Undecidability June 25, 2015 CSCE 355 Foundations of Computation.
Recursively Enumerable and Recursive Languages
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
Decidability Decidable/Undecidable problems. Jaruloj Chongstitvatana Decidability2 Accepting: Definition Let T = (Q, , , , s) be a TM. T accepts.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
Unrestricted Grammars
1 Chapter 9 Undecidability  Turing Machines Coded as Binary Strings  Universal Turing machine  Diagonalizing over Turing Machines  Problems as Languages.
Turing Machines Sections 17.6 – The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC
The Church-Turing Thesis Chapter Are We Done? FSM  PDA  Turing machine Is this the end of the line? There are still problems we cannot solve:
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY * Read chapter 4 of the book for next time * Lecture9x.ppt.
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis (Winter 2016, these slides were also used for Day 33)
Universal Turing Machine
MA/CSSE 474 Theory of Computation Decision Problems, Continued DFSMs.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
MA/CSSE 474 Theory of Computation Reduction and Undecidabiluity.
Decidability and Undecidability Proofs
MA/CSSE 474 Decision Problems Languages, Machines, Computation
(Universal Turing Machine)
MCC 2093 Advanced Theoretical Computer Science
MA/CSSE 474 Theory of Computation
CSE 105 theory of computation
Decidable Languages Costas Busch - LSU.
MA/CSSE 474 Theory of Computation
MA/CSSE 474 Theory of Computation
MA/CSSE 474 Theory of Computation
CS21 Decidability and Tractability
CSE 105 theory of computation
Instructor: Aaron Roth
MA/CSSE 474 Theory of Computation
Turing -Recognizable vs. -Decidable
MA/CSSE 474 Theory of Computation
MA/CSSE 474 Theory of Computation
CSE 105 theory of computation
Presentation transcript:

MA/CSSE 474 Theory of Computation Enumerability Reduction

Your Questions? Previous class days' material Reading Assignments HW 14 problems Tomorrow's exam Anything else

Enumerate means "list, in such a way that for any element, it appears in the list within a finite amount of time." We say that Turing machine M enumerates the language L iff, for some fixed state p of M: L = {w : (s,  ) |- M * (p, w)}. "p" stands for "print" A language is Turing-enumerable iff there is a Turing machine that enumerates it. Another term that is often used is recursively enumerable. Enumeration

Let P be a Turing machine that enters state p and then halts: A Printing Subroutine

Let L = a *. Example of Enumeration Q11

Dovetailing Dovetailing: Run an infinite number of computations "in parallel". S[i, j] represents step j of computation i. S[1, 1] S[2, 1] S[1, 2] S[3, 1] S[2, 2] S[1, 3] S[4, 1] S[3, 2] S[2, 3] S[1, 4 ]... For every i and j, step S[i, j] will eventually happen.

Theorem: A language is SD iff it is Turing-enumerable. Proof that Turing-enumerable implies SD: Let M be the Turing machine that enumerates L. We convert M to a machine M' that semidecides L: 1. Save input w on another tape. 2. Begin enumerating L. Each time an element of L is enumerated, compare it to w. If they match, accept. SD and Turing Enumerable

Proof that SD implies Turing-enumerable: If L   * is in SD, then there is a Turing machine M that semidecides L. A procedure E to enumerate all elements of L: 1. Enumerate all w   * lexicographically. e.g., , a, b, aa, ab, ba, bb, … 2. As each is enumerated, use M to check it. w 3, w 2, w 1  L? yes w E M M' Problem? The Other Way

Proof that SD implies Turing-enumerable: If L   * is in SD, then there is a Turing machine M that semidecides L. A procedure to enumerate all elements of L: 1. Enumerate all w   * lexicographically. 2. As each string w i is enumerated: 1. Start up a copy of M with w i as its input. 2. Execute one step of each M i initiated so far, excluding those that have previously halted. 3. Whenever an M i accepts, output w i. The Other Way

M lexicographically enumerates L iff M enumerates the elements of L in lexicographic order. A language L is lexicographically Turing-enumerable iff there is a Turing machine that lexicographically enumerates it. Example: A n B n C n = { a n b n c n : n  0} Lexicographic enumeration: Lexicographic Enumeration

Theorem: A language is in D iff it is lexicographically Turing- enumerable. Proof that D implies lexicographically TE: Let M be a Turing machine that decides L. M' lexicographically generates the strings in  * and tests each using M. It outputs those that are accepted by M. Thus M' lexicographically enumerates L. Lexicographically Enumerable = D

Proof that lexicographically Turing Enumerable implies D: Let M be a Turing machine that lexicographically enumerates L. Then, on input w, M' starts up M and waits until: ● M generates w (so M' accepts), ● M generates a string that comes after w (so M' rejects), or ● M halts (so M' rejects). Thus M' decides L. Proof, Continued

INSDOUT Semideciding TM H Reduction Enumerable Unrestricted grammar D Deciding TM A n B n C n Diagonalize Lexic. enum Reduction L and  L in SD Context-Free CF grammar A n B n Pumping PDAClosure Closure Regular Regular Expression a * b *Pumping FSMClosure Language Summary

OVERVIEW OF REDUCTION

Reducing Decision Problem P 1 to another Decision Problem P 2 We say that P1 is reducible to P 2 (written P 1  P 2 ) if there is a Turing-computable function f that finds, for an arbitrary instance I of P 1, an instance f( I ) of P 2, and f is defined such that for every instance I of P 1, I is a yes-instance of P 1 if and only if f( I ) is a yes-instance of P 2. So P 1  P 2 means "if we have a TM that decides P 2, then there is a TM that decides P 1.

Example of Turing Reducibility Let P 1 (n) = "Is the decimal integer n divisible by 4?" P 2 (n) = "Is the decimal integer n divisible by 2?" f(n) = n/2 (integer division, which is clearly Turing computable) Then P 1 (n) is "yes" iff P 2 (n) is "yes" and P 2 (f(n)) is "yes". Thus P 1 is reducible to P 2, and we write P 1  P 2. P 2 is clearly decidable (is the last digit an element of {0, 2, 4, 6, 8} ?), so P 1 is decidable

Reducing Language L 1 to L 2 Language L 1 (over alphabet  1 ) is reducible to language L 2 (over alphabet  2 ) and we write L 1  L 2 if there is a Turing-computable function f :  1 *   2 * such that  x   1 *, x  L 1 if and only if f(x)  L 2

Using reducibility If P 1 is reducible to P 2, then –If P 2 is decidable, so is P 1. –If P 1 is not decidable, neither is P 2. The second part is the one that we will use most.

Example of Reduction ● Computing a function (where x and y are unary representations of integers) multiply(x, y) = 1. answer := ε. 2. For i := 1 to |y| do: answer = concat (answer, x). 3. Return answer. So we reduce multiplication to addition. (concatenation)

At each turn, a player chooses one pile and removes some sticks from it. The player who takes the last stick wins. Problem: Is there a move that guarantees a win for the current player? Reduction example: Nim

Nim ● Obvious approach: search the space of possible moves. ● Reduction to an XOR computation problem: ● XOR them together: ♦ 0 + means state is losing for current player ♦ otherwise current player can win by making a move that makes the XOR 0.

Using Reduction for Undecidability Theorem: There exists no general procedure to solve the following problem: Given an angle A, divide A into sixths using only a straightedge and a compass. Proof: Suppose that there were such a procedure, which we’ll call sixth. Then we could trisect an arbitrary angle: trisect(a: angle) = 1. Divide a into six equal parts by invoking sixth(a). 2. Ignore every other line, thus dividing a into thirds. trisect(a) sixth(a) ignore lines sixth exists  trisect exists. But we know that trisect does not exist. So: *

Using Reduction for Undecidability A reduction R from language L 1 to language L 2 is one or more Turing machines such that: If there exists a Turing machine Oracle that decides (or semidecides) L 2, then the TMs in R can be composed with Oracle to build a deciding (or semideciding) TM for L 1. P  P means that P is reducible to P.

(R is a reduction from L 1 to L 2 )  (L 2 is in D)  (L 1 is in D) If (L 1 is in D) is false, then at least one of the two antecedents of that implication must be false. So: If (R is a reduction from L 1 to L 2 ) is true and (L1 is in D) is false, then (L 2 is in D) must be false. Application: If L1 is a language that is known to not be in D, and we can find a reduction from L1 to L2, then L2 is also not in D. Using Reduction for Undecidability

Showing that L 2 is not in D: L 1 (known not to be in D) L 1 in D But L 1 not in D R L 2 (a new language whose if L 2 in D So L 2 not in D decidability we are trying to determine) Using Reduction for Undecidability

1. Choose a language L 1 : ● that is already known not to be in D, and ● show that L 1 can be reduced to L Define the reduction R. 3. Describe the composition C of R with Oracle. 4. Show that C does correctly decide L 1 iff Oracle exists. We do this by showing: ● R can be implemented by Turing machines, ● C is correct: ● If x  L 1, then C(x) accepts, and ● If x  L 1, then C(x) rejects. To Use Reduction for Undecidability Follow this outline in proofs that you submit.. We will see many examples in the next few sessions. Example: H  = { : TM M halts on  }

Mapping Reductions L 1 is mapping reducible to L 2 (L 1  M L 2 ) iff there exists some computable function f such that:  x  * (x  L 1  f(x)  L 2 ). To decide whether x is in L 1, we transform it, using f, into a new object and ask whether that object is in L 2. Example: DecideNIM(x) = XOR-solve(transform(x))

1. H  is in SD. T semidecides it: T( ) = 1. Run M on . 2. Accept. T accepts iff M halts on , so T semidecides H . * Recall: "M halts on w" is a short way of saying "M, when started with input w, eventually halts" Hidden: show H  in SD but not in D

2. Theorem: H  = { : TM M halts on  } is not in D. Proof: by reduction from H: H = { : TM M halts on input string w} R (?Oracle) H  { : TM M halts on  } R is a mapping reduction from H to H  : R( ) = 1. Construct, where M#(x) operates as follows: 1.1. Erase the tape Write w on the tape and move the head to the left end Run M on w. 2. Return. Hidden: H  = { : TM M halts on  } * H  ≤ H is intuitive, the other way not so obvious.

R( ) = 1. Construct, where M#(x) operates as follows: 1.1. Erase the tape Write w on the tape and move the head to the left end Run M on w. 2. Return. If Oracle exists, C = Oracle(R( )) decides H: ● C is correct: M# ignores its own input. It halts on everything or nothing. So: ●  H: M halts on w, so M# halts on everything. In particular, it halts on . Oracle accepts. ●  H: M does not halt on w, so M# halts on nothing and thus not on . Oracle rejects. Hidden: Proof, Continued