Title: Quiz
1Quiz 1. What is Totality problem? 2. What is
ji(x)? 3. What is F (e,x1,xn)? 4. Write a
language which is r.e. but not recursive. 5.
Write a language which is not r.e.
2About the final examination You can bring memo
one sheet (one-side/both sides), in A4,
written by hand Hand in your memo (counted
as one exercise).
About the exercises You do not have to write on
blackboard. Write on paper and hand in (by the
day of the final exam).
3Check list for the final examination Definitions
and explanations of partial functions, (total)
functions, partially computable functions,
(total) computable functions, decision
problems, unsolvable problems, recursive
functions, recursive sets/languages, r.e.
sets/languages, languages which are not r.e.
ji(x), F (e,x1,xn), Halting problem, Totality
problem, Equivalence problem, Chomsky
Hierarchy classes of regular languages,
context-free languages, context-sensitive
languages, recursive languages, recursive
enumerable languages (r.e.). (with examples
and computational models) Solving... Computing
XXY, XY, XXY only with succ, pred, 0,
while.
4Recursive r.e.
Border of computability
recursive
L is recursive r.e. (not rec.) not r.e.
Enumeration function L, S-L Only of L No
Decidable? Yes. Semi- decidable -
Example All while programs (CFL) i ji(i)? i ji total
r.e.
Leave them to mathematicians!
Such rules on strings cannot be defined by
any algorithm.
The next topic.
5a m b m c m d m .
(also CSL !)
REG
a m b n .
CFL
CSL
???
a m b m .
r.e.
recursive
a m b m c m .
6Diagonalization and non-context-sensitive language
I. Gödelization enumerate all CSGs. G0, G1,
G2, II. Diagonalization L a n a n ?L(Gn)
a0 a1 a2 a3 ------------------
------------------------ L(G0) Y N N
Y L(G1) N Y N N L(G2) Y
N N N L(G3) N Y Y Y
(Y an ?L(G i )) L
N N Y N ? ?i?N, L ? L( G i ) ? L
is not a CSL.
7Diagonalization and non-context-sensitive language
III. L is recursive 1) For any i?N, G i is
computable (Gi is a grammar with
finite length ! ) 2) a n ?L(Gn) is
computable (omit) ? L is recursive but
not a CSL.
Def. A language L is recursive if there
is a total computable function f
s.t. L f(n) n?N That means, the
elements of L is enumerable by for i 0
to 8 output f(n)
8REG
a m b n .
CFL
CSL
a m b m .
r.e.
recursive
a m b m c m .
L a n a n ?L(Gn)
9Languages Automata Grammars
Regular Finite Automata Regular Grammars
Context-free Push down Automata Context-free Grammars
Context- Sensitive Linear Bounded Automata Context-Sensitive Grammars
Recursive Enumerable Turing Machines (Unrestricted) Grammars
computational models
while programs C ?-calculus
10am am?L(Gm) (Gm the m-th CSG)
Complete the figure !!
REG
a m b n .
i ji(i)?
CFL
CSL
a m b m .
r.e.
recursive
a m b m c m .
i ji total
Note REG application pattern matching CFL
application parser of formal languages,
compilers CSL minor recursive defined by
programs halt for any input, but cannot be
enumerated (listed) by programs. r.e. the
largest class of languages (rules) defined by
programs, but semidecidable. not r.e.
cannot be defined by any programs.
Homework translate it into Chinese
11(No Transcript)
12Theorem Universal function theorem Let j0j,
j1j, ... , jmj,... be all j-variable partially
computable functions. Given j? 1, there is a
program which computes the universal function
FNj1 ? N such that F(e,a1,...,aj)
je(a1,...,aj) for any number of program e and
input (a1,...,aj) ? Nj . (Note) The program
computes all j-variable partially computable
functions. Input is a program number e and its
input. For each step, read an instruction of
the input program, compute step by step. It
halts when the input program halts.
Its proof omitted.
13 Theorem Totality problem is unsolvable TOT(i)
1, ji is a total function 0, otherwise is
not computable.
14- Lemma
- i) There exists a total function f N ? N which
is not computable. - ii) The set of all total computable function is
not r.e. - (proof)
- Let e0,e1,e2,
- be an enumeration of all program numbers that
compute total functions. - Note that the enumeration need not to be r.e.
- (To tell the truth, we can enumerate them but
they are not r.e.) - Let f N ? N be
- f(i) jei (i) 1.
- Assume that f is a total computable function.
- Then there is a number j s.t. f jej.
- Therefore, jej(j) jej (j) 1.
- It is contradiction. f is not computable.
15(ii) Assume that e0,e1,e2, is r.e. Then there
exists an (total) computable function g s.t.
g(i)ei. Let f N ? N be f(i) jei (i) 1.
computed by begin X1 F (g(X1),X1) X1
succ(X1) end Similarly to (ii), it is
contradiction.
16 Theorem Totality problem is unsolvable TOT(i)
1, ji is a total function 0, otherwise.
(proof) All while programs are r.e. If TOT is
computable, the set of all (total) computable
function is r.e. But it is false and
contradiction.
17 Theorem Smn theorem There is a (total)
computable function SnmNn1?N s.t. jen
(z1,,zn) jimn (y1,, ym, z1,,zn) e Snm
(i, y1,, ym)
A kind of program conversion function (Pi to
Pe).
X1y1, , Xmym
Pi
Pi
Pe
Its proof omitted.
18What computers cannot do
Computers cannot solve these problems.
Equivalence problem
Program P
Yes if programs P Q work in the
same way
algorithm
No otherwise
Program Q
impossible
Homework writing a program
P3
Ans.
P1
algorithm
teacher
P2
Y/N
Pi
I dont want to work
students
19What computers cannot do
Computers cannot solve these problems.
Equivalence problem
Program P
Yes if programs P Q work in the
same way
algorithm
No otherwise
Program Q
impossible
Finding a virus
Sample virus
algorithm
Y/N
Unknown file
They work in the same way?
20 Theorem Equivalence problem is unsolvable
Equiv(i,j) 1, ji jj 0, otherwise is not
computable. Def. Id(x) x. Lemma EqId(i)
1, ji Id 0, otherwise is not
computable.
A special case of the theorem
21 Lemma EqId(i) 1, ji Id 0, otherwise
is not computable. (proof) Let program Pg(i)
be begin X2 F(i, X1) end // X1 has no change,
output X1. jg(i) (j) j , ji(j)? ?, otherwis
e // F(i, X1) ? Thus a) jg(i) Id ? b) ji
total.
j
Pi
Pg(i)
g
a) EqId(g(i)) 1, jg(i) Id 0, otherwise
b) EqId(g(i)) 1, ji total 0, otherwise
TOT(i) is not computable
Program conversion function g is computable.
Therefore, EqId is not computable.
22 Theorem Equivalence problem is unsolvable
Equiv(i,j) 1, ji jj 0, otherwise is not
computable. (proof) If Equiv is computable,
EqId(i) is computable. However, EqId is not
computable.
23Additional part
24Turing completeness and equivalence Related
area Numbers?
25Languages Automata Grammars
Regular Finite Automata Regular Grammars
Context-free Push down Automata Context-free Grammars
Context- Sensitive Linear Bounded Automata Context-Sensitive Grammars
Recursive Enumerable Turing Machines (Unrestricted) Grammars
computational models
while programs C ?-calculus
Can they do the same things?
26Turing completeness
Ex. All while programs
Def. A computational system S is Turing complete
if the partial functions computed by
all Turing machines are computed by S.
In other words, Turing complete system can
emulate all Turing machines (including the
universal Turing machine). Note. Turing
complete system S can be stronger than Turing
machines (Nobody knows stronger system even now!)
27Turing equivalence
Ex. All while programs, TM,
Def. Two Turing complete systems S and S are
Turing equivalent if the sets of
partial functions computed by S and S are
same.
In other words, S and S can emulate each other.
Note. All known Turing complete systems are
Turing equivalent (now). Turing equivalent
systems Turing machines, while programs,
recursive functions, ?-calculus C, C,
PASCAL,?????
28Algorithm Church-Turing thesis
Partially computable functions functions
computed by Turing machines
Turing equivalent systems Turing machines,
while programs, recursive functions,
?-calculus C, C, PASCAL, What are
algorithms? ?difficult to define What is
computation? Many people defined various models
of computation, but they can compute the same
functions as Turing machines Usually we call
them just algorithms.
29Turing completeness and equivalence Related
area Numbers?
Turing equivalent systems Turing machines, while
programs, recursive functions,
?-calculus C, C, PASCAL,
30Computer science ?Computation? Mathematics
Theory of computation and foundations of
mathematics
Foundations of mathematics (it doesnt mean basic
mathematics!!) mathematical logic, axiomatic set
theory, proof theory, model theory, and
recursion theory (computability theory)
Computation and the foundations of mathematics
have strong relationships.
31Foundations of mathematics (it doesnt mean basic
mathematics!!) mathematical logic, axiomatic set
theory, proof theory, model theory, and
recursion theory (computability theory)
Major results of recursion theory (end of 19c
-20c) Recursive call of functions no
problem (A function can call itself) Self-mult
iplication algorithm (algorithm copying
itself) - possible (Virus!) -it seems easy
but make it in while program. it is difficult
(Easy in C!)
32Theory of computation and logic
Anyway, the common basis of computation and logic
is formal definitions and computation
!! formal? We can find the answer without
thinking meanings. (That is, machines can find
answers they do not know meanings. )
A great result of logic - Gödel's first
incompleteness theorem has a very similar proof
as halting problem. - logic and computation
have strong relationships.
33Turing completeness and equivalence Related
area Numbers?
34Recursive languages
N we can generate with algorithms X0 and
succ (1) Z use pairing function. lt1,xgt (x),
lt0,xgt (-x) (x?N) Q m/n m,n ?Z, use
pairing function R We cannot generate all
numbers of R with algorithms
x?R, ex. x32413232.452436454265344653448327939
Even if a program runs forever and output
infinitely many numbers some real number
cannot be generated.
35Now we allow while programs to use
output Xi (while programs can output any
times!)
Diagonalization and real numbers
Even in 0,1?R, there is some number cannot be
generated by algorithms. Diagonalization
0 . y1 y2 y3 y4 y5 y6
(digits) -----------------------------------------
- P0 0. 2 3 7 5 8 4
P1 0. 4 0 1 2 4 1 P2
0. 8 1 9 7 3 1 P3 0.
6 4 5 8 9 5
? 0. 3 1 0 9 .
(r) ?R ? ?i?N, r cannot be generated by Pi ?
There exists some real number cannot be
generated by algorithms.
All while programs
36Computability theory 2008 - end