COT 6410
Fall 2010
Final Exam Sample Questions
1
. Let set
A
be recursive,
B
be re non-recursive and
C
be non-re. Choosing from among
(REC)
recursive
,
(RE)
re non-recursive
,
(NR)
non-re
, categorize the set
D
in each of a) through d) by
listing
all
possible categories. No justification is required.
a.) D = ~C
RE, NR
b.) D
⊆
(A
∪
C)
REC, RE, NR
c.) D = ~B
NR
d.) D = B
−
A
REC, RE
2.
Prove that the
Halting Problem
(the set
K
0
)
is not recursive (decidable) within any formal model of
computation. (Hint: A diagonalization proof is required here.)
Assume we can decide the halting problem.
Then there exists some total function Halt such
that
1
if [x] (y) is defined
Halt(x,y)
=
0
if [x] (y) is not defined
Here, we have numbered all programs and [x] refers to the x-th program in this ordering.
We
can view Halt as a mapping from
ℵ
into
ℵ
by treating its input as a single number
representing the pairing of two numbers via the one-one onto function
pair(x,y) = <x,y> = 2
x
(2y + 1) – 1
with inverses
<z>
1
= exp(z+1,1)
<z>
2
= ((( z + 1 ) // 2
<z>1
) – 1 ) // 2
Now if Halt exist, then so does Disagree, where
0
if Halt(x,x) = 0, i.e, if [x] (x) is not defined
Disagree(x) =
μ
y (y == y+1)
if Halt(x,x) = 1, i.e, if [x] (x) is defined
Since Disagree is a program from
ℵ
into
ℵ
, Disagree can be reasoned about by Halt.
Let d
be such that Disagree = [d], then
Disagree(d) is defined
⇔
Halt(d,d) = 0
⇔
[d](d) is undefined
⇔
Disagree(d) is undefined
But this means that Disagree contradicts its own existence.
Since every step we took was
constructive, except for the original assumption, we must presume that the original assumption
was in error.
Thus, the Halting Problem is not solvable.
3.
Using reduction from the known undecidable
HasZero, HZ = { f |
∃
x f(x) = 0 }
, show the non-
recursiveness (undecidability) of the problem to decide if an arbitrary primitive recursive function
g
has the property
IsZero, Z = { f |
∀
x f(x) = 0 }
.
HZ = { f |
∃
x
∃
t [ STP(x, f, t) & VALUE(x, f, t) == 0] }
Let f be the index of an arbitrary effective procedure.
Define g
f
(y) = 1 -
∃
x
∃
t [ STP(x, f, t) & VALUE(x, f, t) == 0]
If
∃
x f(x) = 0, we will find the x and the run-time t, and so we will return 0 (1 – 1)
If
∀
x f(x)
≠
0, then we will diverge in the search process and never return a value.