0,1 - Duke University

Download Report

Transcript 0,1 - Duke University

Computability and Complexity
4-1
Existence of Undecidable
Problems
Computability and Complexity
Andrei Bulatov
Computability and Complexity
4-2
Math Prerequisites
We can make a list of natural numbers: 1,2,3,4,5,…
integers:
0,1,-1,2,-2,…
even rationals:
These sets are countable
1
1
1
2
1
3

2
1
2
2
2
3

3
1
3
2
3
3





Computability and Complexity
Math Prerequisites
However, we cannot make a list of reals
Every real number can be thought to have an infinite decimal representation,
say,
=3.14159…
Suppose we get a list of all real numbers:
1. 0.a11a12 a13 
2. 0.a21a22 a23 
3. 0.a31a32 a33 

Then the number 0.b1b2b3  where bi  aii (modulo 10) is not in
the list.
The set of real numbers is uncountable
4-3
Computability and Complexity
Question
Is the set * countable?
uncountable?
4-4
Computability and Complexity
4-5
Coding up a TM
Any TM may be described by a finite string of 0’s and 1’s
Here is one way to do it:
• First we code the states:
Q  { q0 , q1 ,
0
00
q2 ,
q3 ,
q4 ,

000
0000
00000

• Then we code S as 0, L as 00, R as 000
• Then we code the alphabet:
  { s1 , s2 , s3 ,
s4 ,
s5 ,
0
00 000 0000
( is coded as an empty string of 0’s)
00000


Computability and Complexity
• Now we can code the elements of the transition function:
(q 0 , s 2 ), (q1 , s 3 , L)  01001001000100
(q 2 , ), (q3 , s 3 , S )  000110000100010
• Now we can code the whole machine by giving the whole
transition function:
10100100100
0100



10001100001

00010


( q0 ,s2 ),( q1 ,s3 , L )
( q2 , ),( q3 ,s3 ,S )
4-6
Computability and Complexity
Universal TM
Definition A “Universal Turing Machine” (UTM) is a TM, U, such
that, for any TM T and any input x
• U(T,x) is finite iff T(x) is finite; and
• the output of U(T,x) encodes the output of T(x)
Turing showed in his 1936 paper that UTMs exist
One form of UTM uses 3 tapes. To simulate the operation of T on
input x:
• Write the code for T on Tape 1 and the code for x on Tape 2
• Write the code for q0 on Tape 3
4-7
Computability and Complexity
Universal TM description
• Find the first symbol of the coded input on Tape 2;
• Search the list of transitions on Tape 1 for a transition from q0
that applies to this symbol;
• Simulate the effect of this transition on the coded input and the stored
state (Tapes 2 and 3);
• Search the list of transitions for one that applies in the new situation;
• Continue until a final state is reached.
(Marvin Minsky designed a UTM using only 7 states and 4 symbols in
1962. No one has yet designed a smaller one … )
4-8
Computability and Complexity
Unsolvable problem
Problems: functions from {0,1}* to {0,1}
(that is problems of recognizing 01-strings)
Theorem
There exists a problem that cannot be solved by any Turing Machine
4-9
Computability and Complexity
Lemma 1
There are countably many Turing Machines
Proof
Each TM can be represented as a binary string.
Therefore the set set all TMs can be thought as a subset of {0,1}*
Since {0,1}* is countable, the set of all TMs is also countable
4-10
Computability and Complexity
Lemma 2
The set of all problems is uncountable.
Proof
Each function {0,1}*  {0,1} can be represented as a binary string:
f(0) f(1) f(00) f(01) f(10) f(11) …
Suppose this set is countable. Then we are able to create a list of all
problems
1. a11a12 a13 
(This time aij  {0,1} )
2. a21a22 a23 
3. a31a32 a33 

The string b1b2b3  , where
0, if aii  1
bi  
1, if aii  0
4-11
Computability and Complexity
Lemmas 1 and 2 implies that there are a lot more problems than
Turing Machines. Therefore at least one of the problems cannot
be solved by a TM
QED
Note that this is an “existence argument”.
We cannot point out any particular undecidable problem
This is what we shall do in the next lecture
4-12