Fall 2010
Final Exam Sample Questions
1
.
Let set
A
be recursive,
B
be re nonrecursive and
C
be nonre. Choosing from among
(REC)
recursive
,
(RE)
re nonrecursive
,
(NR)
nonre
, 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 xth 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 oneone 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 
5
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 
2200
x f(x) = 0 }
.
HZ = { f 
5
x
5
Let f be the index of an arbitrary effective procedure.
Define g
f
(y) = 1 
5
x
5
If
5
x f(x) = 0, we will find the x and the runtime t, and so we will return 0 (1 – 1)
If
2200
x f(x)
≠
0, then we will diverge in the search process and never return a value.
Thus, f