Diagonalization and Reducibility

Slides:



Advertisements
Similar presentations
October 13, 2009Theory of Computation Lecture 11: A Universal Program III 1 Coding Programs by Numbers Gödel numbers are usually very large, even for small.
Advertisements

Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
Induction and recursion
Decidable A problem P is decidable if it can be solved by a Turing machine T that always halt. (We say that P has an effective algorithm.) Note that the.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Recursively Enumerable and Recursive Languages
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
October 27, 2009Theory of Computation Lecture 12: A Universal Program IV 1Universality Then we append the following instruction: [C]IF K = Lt(Z) + 1 
November 10, 2009Theory of Computation Lecture 16: Computation on Strings I 1Diagonalization Another example: Let TOT be the set of all numbers p such.
December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 1 Turing Machines Theorem 1.1: Any partial function that can be computed by a Post-
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
1 Introduction to Computability Theory Lecture11: The Halting Problem Prof. Amos Israeli.
November 3, 2009Theory of Computation Lecture 14: A Universal Program VI 1 Recursively Enumerable Sets Definition: We write: W n = {x  N |  (x, n) 
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.
Applied Discrete Mathematics Week 9: Relations
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
A Universal Turing Machine
December 1, 2009Theory of Computation Lecture 21: Turing Machines II 1 Simulation of L n in T We will now construct a Post-Turing program Q that simulates.
Cardinality with Applications to Computability Lecture 33 Section 7.5 Wed, Apr 12, 2006.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Great Theoretical Ideas in Computer Science.
September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 1 Some Primitive Recursive Functions Example 3: h(x) = x! Here are.
November 12, 2009Theory of Computation Lecture 17: Calculations on Strings II 1 Numerical Representation of Strings First, we define two primitive recursive.
Recursively Enumerable and Recursive Languages
1 Recursively Enumerable and Recursive Languages.
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.
Fall 2002CMSC Discrete Structures1 Chapter 3 Sequences Mathematical Induction Recursion Recursion.
October 4, 2016Theory of Computation Lecture 9: A Universal Program I 1Minimalization Example 15: R(x, y) R(x, y) is the remainder when x is divided by.
(Proof By) Induction Recursion
Great Theoretical Ideas In Computer Science
The Acceptance Problem for TMs
A Universal Turing Machine
Another Word on PRC Classes
Theory of Computation Lecture 10: A Universal Program I
Recursively Enumerable and Recursive Languages
Theory of Computation Lecture 12: A Universal Program III
Induction and recursion
Diagonalization and Reducibility
Theory of Computation Lecture 23: Turing Machines IV
Theory of Computation Lecture 14: A Universal Program V
Recursively Enumerable Sets
Numerical Representation of Strings
Cardinality of Sets Section 2.5.
Theory of Computation Lecture 22: Turing Machines III
Mathematical Induction Recursion
Theory of Computation Lecture 16: A Universal Program VII
Induction and recursion
Decidable Languages Costas Busch - LSU.
Theory Of Computer Science
Applied Discrete Mathematics Week 9: Integer Properties
Formal Languages, Automata and Models of Computation
CS21 Decidability and Tractability
Theory of Computation Lecture 21: Turing Machines II
Numerical Representation of Strings
Recursively Enumerable Sets
Primitive Recursive Predicates
Numerical Representation of Strings
Numerical Representation of Strings
Numerical Representation of Strings
Theory of Computation Lecture 9: A Universal Program I
Theory of Computation Lecture 6: Primitive Recursive Functions I
Some Primitive Recursive Functions
Theory of Computation Lecture 13: A Universal Program V
Recursively Enumerable Sets
Theory of Computation Lecture 17: Calculations on Strings II
Theory of Computation Lecture 11: A Universal Program III
Turing Machines Everything is an Integer
Theory of Computation Lecture 23: Turing Machines III
Presentation transcript:

Diagonalization and Reducibility We will now look at two techniques for proving that a set is not recursive or not even r.e. These techniques are called diagonalization and reducibility. The idea behind diagonalization is to conduct a proof by contradiction. First, we make the assumption that a certain set A can be enumerated in a suitable fashion. Second, we show that, with the help of the enumeration, we can define an object b with b  A. April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Diagonalization and Reducibility For example, we proved Theorem 2.1 using a diagonalization argument to show that HALT(x, y) or {(x, y)  N2 | HALT(x, y)} is not computable. Here, the set A is the class of unary partially computable functions. Assertion 1 (A can be enumerated) follows from the fact that L programs can be enumerated. For each n, let Pn be the program with number n. Then all unary partially computable functions are in the following list: (1)P0, (1)P1, (1)P2, … April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Diagonalization and Reducibility We first assumed that HALT(x, y) were computable and performed a proof by contradiction. Then we wrote a program P that computes (1)P which involved the (assumedly computable) predicate HALT(x, y). Finally, we showed that (1)P does not appear in the list (1)P0, (1)P1, (1)P2, … From this contradiction we concluded that HALT(x, y) cannot be computable. April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Diagonalization and Reducibility The idea was to write P such that for every x, (1)P(x) if and only if (1)Px(x). In other words, HALT(x, #(P ))  HALT(x, x) This means that (1)P(x) differs from each function (1)P0, (1)P1, (1)P2, … on at least one input value. (1)P cannot be (1)Pn, because (1)P (n) if and only if (1)Pn (n). April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Diagonalization and Reducibility So (1)P does not appear in the list (1)P0, (1)P1, (1)P2, …, which satisfies Assertion 2 (there is a b  A). By this contradiction we can conclude that HALT(x, y) is not computable. The term diagonalization is derived from the visualization of this proof technique. April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Theory of Computation Lecture 16: Calculations on Strings I Diagonalization (1)P0 (0) (1)P0 (1) (1)P0 (2) … (1)P1 (0) (1)P1 (1) (1)P1 (2) … (1)P2 (0) (1)P2 (1) (1)P2 (2) … … … … … The elements on the diagonal make it impossible for (1)P to be any of the (1)Pn. April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Theory of Computation Lecture 16: Calculations on Strings I Diagonalization Another example: Let TOT be the set of all numbers p such that p is the number of a program that computes a total function f(x) of one variable: TOT = {z  N | (x) (x, z)} Since (x, z)  x  Wz, TOT is simply the set of numbers z such that Wz is the set of all nonnegative integers. Theorem 6.1: TOT is not recursively enumerable. April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Theory of Computation Lecture 16: Calculations on Strings I Diagonalization Proof: Suppose that TOT were r.e. Since TOT   (we know that there are total unary functions), by Theorem 4.9 there is a computable function g(x) such that TOT = {g(0), g(1), g(2), …}. Let h(x) = (x, g(x)) + 1. Since any g(x) is the number of a program that computes a total function, (x, g(x)) is defined for all x, and h(x) is a computable function. Let h(x) be computed by a program with number p. Then p  TOT, which means that p = g(i) for some i. Then h(i) = (i, g(i)) + 1 by definition of h = (i, p) + 1 since p = g(i) = h(i) + 1 since h is computed by p. Contradiction! April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Theory of Computation Lecture 16: Calculations on Strings I Diagonalization (0, g(0)) (1, g(0)) (2, g(0)) … (0, g(1)) (1, g(1)) (2, g(1)) … (0, g(2)) (1, g(2)) (2, g(2)) … … … … … The elements on the diagonal make it impossible for the function h to be computed by any of the programs g(x). April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Theory of Computation Lecture 16: Calculations on Strings I Diagonalization Theorem 6.1 gives a reason why we base our studies of computability on partial rather than total functions: By Church’s Thesis, Theorem 6.1 shows that there is no algorithm to determine whether an L program computes a total function. April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Theory of Computation Lecture 16: Calculations on Strings I Reducibility Another important technique for determining nonrecursive sets is the reducibility method. Once some set (such as the set K) has been shown to be nonrecursive, we can use that set to give other examples of nonrecursive sets. April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Theory of Computation Lecture 16: Calculations on Strings I Reducibility Definition: Let A, B be sets. Then A is many-one reducible to B, written A m B, if there is a computable function f such that A = {x  N | f(x)  B}. In other words, x  A if and only if f(x)  B. “Many-one” means that f does not have to be one-one. If A m B, then testing membership in A is “no harder than” testing membership in B. To test whether x  A we can compute f(x) and then test whether f(x)  B. April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Theory of Computation Lecture 16: Calculations on Strings I Reducibility Theorem 6.2: Suppose A m B. If B is recursive, then A is recursive. If B is r.e., then A is r.e. Proof: Let A = {x  N | f(x)  B}, where f is computable, and let PB(x) be the characteristic function of B. Then A = {x  N | PB(f(x))}. If B is recursive, then PB(f(x)), the characteristic function of A, is computable, so A is recursive. If B is r.e., then B = {x  N | g(x)} for some partially computable function g. Then A = {x  N | g(f(x))}, and since g(f(x)) is partially computable, A is r.e. April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Theory of Computation Lecture 16: Calculations on Strings I Reducibility We will often use Theorem 6.2 in the following form: If A is not recursive (r.e.), then B is not recursive (r.e.). Example: K0 = {z  N | r(z)(l(z))} = {x, y | y(x)} Obviously, K0 is r.e. However, we can show that K0 is not recursive by reducing K to K0. K = {n  N | n  Wn}. Now x  K if and only if x, x  K0, and the function f(x) = x, x is computable. Therefore, K m K0, and K0 is not recursive. April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Numerical Representation of Strings So far, our programs in the language L have been using natural numbers as their inputs and output. For many applications, however, we would prefer to perform computations on strings on some alphabet instead. You remember that we introduced a numbering of L programs so that L programs could be used as input and output of another (or the same) L program. With regard to strings, we will use the same approach: We will associate numbers with strings on A in a one-one manner. April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Numerical Representation of Strings We will use a system that is very similar to our everyday one-one mapping of natural numbers to strings of digits. There we have a set D of digits, and we define an order s0, …, s9 on these digits: D = {s0, …, s9} = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}. There are n = 10 elements in our set of digits. Then any string w of digits can be written as w = sik sik-1 … si1 si0 , where 0  im  n - 1 and k = |w| - 1. April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Numerical Representation of Strings For example, if we have the string w = 372, then k = 2, i2 = 3, i1 = 7, i0 = 2. To find the number associated with this string, we use exactly the following formula: x = iknk + ik-1nk-1 + … + i1n1 + i0n0 x = 3102 + 7101 + 2 = 372. If w = 372 is an octal representation of an integer, then we would have n = 8 and therefore: x = 382 + 781 + 2 = 192 + 56 + 2 = 250 April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Numerical Representation of Strings Now let us develop such a method for strings on an alphabet A. Remember that the set of all strings on an alphabet A, including the empty string, is called A*. Again, let us assume that there is a particular order of symbols in A. We write A = {s1, …, sn} and define that the sequence s1, …, sn corresponds to this order of symbols. Then any string w on A can be written as w = sik sik-1 … si1 , si0 , where 1  im  n and k = |w| - 1. The empty string is indicated by w = 0. April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I

Numerical Representation of Strings Then we use exactly the same formula as before to associate w with an integer x: x = iknk + ik-1nk-1 + … + i1n1 + i0n0 . With w = 0 we associate the number x = 0. For example, consider the alphabet A = {a, b, c} and the string w = caba. Then x = 333 + 132 + 231 + 1 = 81 + 9 + 6 + 1= 97. Now why is this representation unique? We can prove this by showing how to retrieve the subscripts i0, i1, …, ik from x for any x > 0. April 11, 2019 Theory of Computation Lecture 16: Calculations on Strings I