140 likes | 170 Views
Giorgi Japaridze Theory of Computability. Decidability. Episode 2. 2.1.a. Giorgi Japaridze Theory of Computability. Decidable: {1,3,5} {x | x is even} {x | x is a perfect square} {x | x 2 -10x = 0} {x | x=y * z for some integers y,z>1 (i.e. x is not prime)}
E N D
Giorgi Japaridze Theory of Computability Decidability Episode 2
2.1.a Giorgi JaparidzeTheory of Computability • Decidable: • {1,3,5} • • {x | x is even} • {x | x is a perfect square} • {x | x2-10x = 0} • {x | x=y*z for some integers y,z>1 (i.e. x is not prime)} • {x | x is a prime (i.e. x is not divisible by anything except 1 and • itself)} • {<G> | G is a connected graph} • {<P> | P is a one-variable polynomial expression with an integral root} Examples of decidable problems (sets) • Undecidable: • {<P> | P is a two-variable polynomial expression with an integral root}
2.2.a Giorgi JaparidzeTheory of Computability The universal Turing machine Let ATM = {<M,w> | M is a TM and M accepts string w} We call the above set the acceptance problem. Theorem 2.1:ATM is recognizable. Proof idea. The following TM U, called the universal TM, recognizes ATM: U = “On input <M,w>, where M is a TM and w is a string: 1. Simulate M on input w. 2. If M ever enters its accept state, accept; if M ever enters its reject state, reject.” Does U also decide ATM? No!
2.2.b Giorgi JaparidzeTheory of Computability ATM is undecidable Theorem 2.2:ATM is undecidable. Proof idea. Suppose, for a contradiction, that ATM is decidable. That is, there is a TM H that decides ATM. Thus, that machine H behaves as follows: accept if M accepts w reject if M does not accept w H(<M,w>) = Using H as a subroutine, we can construct the following TM D: D = “On input <M>, where M is a TM: 1. Run H on input <M,<M>>. 2. Do the opposite of what H does. That is, if H accepts, reject, and if H rejects, accept.” accept if M does not accept <M> reject if M accepts <M> Thus, D(<M>) =
2.2.b Giorgi JaparidzeTheory of Computability ATM is undecidable Theorem 2.2:ATM is undecidable. Proof idea. Suppose, for a contradiction, that ATM is decidable. That is, there is a TM H that decides ATM. Thus, that machine H behaves as follows: accept if M accepts w reject if M does not accept w H(<M,w>) = Using H as a subroutine, we can construct the following TM D: D = “On input <M>, where M is a TM: 1. Run H on input <M,<M>>. 2. Do the opposite of what H does. That is, if H accepts, reject, and if H rejects, accept.” accept if D does not accept <D> reject if D accepts <D> Thus, D(<D>) = Contradiction!
2.2.c Giorgi JaparidzeTheory of Computability ATM = {<M,w> | M is a TM and M accepts string w} ATM = {<M,w> | M is a TM and M does not accept string w} A Turing-unrecognizable problem Theorem 2.3:ATM is unrecognizable. Proof idea. Suppose, for a contradiction, that ATM is recognizable. That is, there is a TM U that recognizes ATM. • U recognizes ATM (slide 2.2.a) • U recognizes ATM Thus, Let K = “On input <M,w>: 1. Run both U and U on input <M,w> in parallel; 2. If U accepts, accept; if U accepts, reject.” It can bee seen that K decides ATM, which contradicts Theorem 2.2.
2.2.d Giorgi JaparidzeTheory of Computability There are uncountably many problems Set of even numbers Empty set Set of prime numbers Set of all numbers …
2.2.d Giorgi JaparidzeTheory of Computability There are uncountably many problems Set of even numbers Empty set Set of prime numbers Set of all numbers … Reverse the diagonal
2.2.d Giorgi JaparidzeTheory of Computability There are uncountably many problems Set of even numbers Empty set Set of prime numbers Set of all numbers … Reverse the diagonal
2.2.d Giorgi JaparidzeTheory of Computability There are uncountably many problems Set of even numbers Empty set Set of prime numbers Set of all numbers … Reverse the diagonal
2.2.d Giorgi JaparidzeTheory of Computability There are uncountably many problems Set of even numbers Empty set Set of prime numbers Set of all numbers … Reverse the diagonal
2.2.d Giorgi JaparidzeTheory of Computability There are uncountably many problems Set of even numbers Empty set Set of prime numbers Set of all numbers … Reverse the diagonal
2.2.d Giorgi JaparidzeTheory of Computability There are uncountably many problems Set of even numbers Empty set Set of prime numbers Set of all numbers … Reverse the diagonal
2.2.d Giorgi JaparidzeTheory of Computability There are uncountably many problems Set of even numbers Empty set Set of prime numbers Set of all numbers … Every set of numbers can be represented as an infinite bit string. However, as we see, not all such strings can be listed (the new diagonal string is not on the list!). On the other hand, all TMs can be encoded as bit strings and hence listed. To summarize, the set of TMs is countable (可数的) but the set of problems is not (there are more problems than TMs). So, some problems have no TMs.