Title: Homework: Friday
1Homework 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 4.2, 4.7 (countable or
Turing-enumerable are the same) - Problem 4.10, 4.12, 4.16 (Hint think about the
Pumping lemma for regular languages)
2Undecidability(Chapter 4)
Héctor Muñoz-Avila
3A Bit of History
4A bit of History Axioms
- An axiom is an statement that is assumed to be
true - Given a theory ?T, an axiomatization of T is a
collection of statements, A, in T such that - Every statement in A is an axiom
- Every truth statement in T follows from A
In computer science think of rule-based systems
or programs in Prolog
Axioms
5A bit of History Axiomatization of The
Arithmetic
- We all agree that for any numbers A and B the
following holds - A B B A
- An open problem for a long time was to obtain
an axiomatization A for the Arithmetic
- All attempts failed. Either
- A was incomplete, or
- A was not sound, or
- both!
6Gödel Incompleteness Theorem Such an
Axiomatization is not possible
Theorem. If a proof system for arithmetic is
sound then there must be a true formula that is
not provable.
The proof is by contradiction and a crucial
construction of the proof, the Gödel numberings,
is used to proof that some problems are not
decidable
7Enumerability and Turing Machines
Definition A language L is Turing-enumerable if
there is a Turing machine that enumerates all
words in L in its tape (may run forever)
?w1? w2? w3?
- Our book does not define Turing-enumerability
- Rather it says that there is an Enumerator
Turing machine that enumerates all words in L in
Chapter 3 - And defines countable sets (Definition 4.14) as
those having the same size as the natural numbers - These three notions are equivalent
8The collection of All Turing Machines Are
Enumerable
- Idea For every Turing machine T (S, ?, ?, s,
H), we will assign a unique binary number ltTgt,
called the encoding of T
- If we can make this assignment, then we have an
enumeration. Let T be the set of all Turing
machines and N be the set of all natural numbers
- Do we have an enumeration of all Turing machines?
Yes!
9Encoding a Turing Machine in a unique Binary
We are given a Turing machine T (Q, ?, ?, s, h).
- Assumptions
- States
- For all Turing machines the initial state will be
q1, - Thus,
- For all Turing machines the halting set will be
q2 - Thus,
- All states for all Turing machines are taken from
Q q1, ,q10, - Thus,
- Symbols
- a1 represents ?, a2 represents ?, a3 and a4
represents ? and ? - All symbols that in ? are taken from A a1,
,a10, - a3, a4 - Thus,
s q1
h q2
S q1, ,qn, for some n
? is a finite subset of A that contains a1 and a2
10Encoding a Turing Machine in a unique Binary (II)
We are given a Turing machine T (Q, ?, ?, s, h).
- Take a transition t ((q23,a42),(q77,a3,a3))
will be translated as, (and denoted as lttgt)
02310421077103103
- If ? t1, t2, , tm
- will be translated as
11lt t1gt11lt t2gt11lt tmgt11
- We define ltTgt 11lt t1gt11lt t2gt11lt tmgt11
- Note that given ltTgt, we can easily reconstruct T
11Example of ltTgt
If ? t1, t2, , tm are the transitions of a
Turing machine T, then we define ltTgt 11lt
t1gt11lt t2gt11lt tmgt11
Question Obtain Turing machine T number
722827740192965100
(or something like that! ?)
12Proofs of Undecidability for Some Problems
- We are going to make 2 proofs
- An existence proof
- We show that a problem P must exist that cannot
be solved with Turing machines without actually
showing P - A constructive proof
- We show that the halting is not decidable
(halting is Turing-recognizable) - We show that haltingC is not even
Turing-recognizable
13The Existence Proof
Let F be set of all functions f N ? N
- Theorem. F is not enumerable
Proof. Another (Cantor) diagonal argument
similar to the one we did to proof that the set
of the real numbers is not enumerable
Corollary. There must exist a function f in F
that is not Turing computable (i.e., you cant
write a program in C/Java/Prolog/etc. that
computes f)
14The Constructive Proof
- We are going to show that there is no Turing
machine that decides the following language - The proof if by contradiction assuming that such
a Turing machine exists and yielding a
contradiction - For doing this, we need to construct a Turing
machine that can simulate other Turing machines
Halting M(w) M is a Turing machine that
halts on w
15The Universal Turing Machine
- The Universal Turing Machine is a 3-tape Turing
machine that runs any Turing machine T. It
maintains the current word w in the tape of T and
the current state qk
Tape 1 ?ltTgt Tape 2 ?ltwgt Tape 3 ?ltqkgt
16Idea of the Concrete Proof
- We will construct a double-contradiction such as
- In the town of Neverland, there is a shaver
called Bob, who only shaves anyone who doesnt
shave himself. - Question Does Bob shaves himself?
17Halting is Not Decidable
Proof by contradiction suppose that Halting
T(w) T is a Turing machine that halts on
ltwgt is decidable.
Because we can use the same Turing machine
deciding Halting to decide if T(ltTgt) halts or not
18Halting is Not Decidable
We assume that H0 T T is a Turing machine
that halts on T(T) is decidable.
Then, H0C is also decidable.
H0C T T(ltTgt)?
Since H0C is decidable, then H0C is also
Turing-recognizable.
Let MC the Turing machine that recognizes H0C
MC(ltTgt) halts if T is in H0C MC(ltTgt)? if T is not
in H0 C
MC
Question Does is in H0C?
A contradiction is easily reached for a Yes and a
No answer
19Halting is Not Decidable (2)
If MC is in H0C
Then MC(ltMCgt) ? (by definition of H0C) However,
MC is the machine that recognizes H0C Thus, if
MC(ltTgt)?, then T is not in H0C, so MC cannot be
in H0C
If MC is not in H0C
Then MC(ltMCgt) halts (by definition of
H0) However, MC is the machine that recognizes
H0C Thus, if MC(ltTgt) halts, T is in H0C, so MC
must be in H0C
So we have a contradiction H0C is not even
Turing-recognizable and Halting is not decidable