Universität Koblenz-Landau FB 4 Informatik
Prof. Dr. Viorica Sofronie-Stokkermans∗1 07.06.2021 M.Ed. Dennis Peuter∗2
Exercises for Advances in Theoretical Computer Science Exercise Sheet 8
Due at 15.06.2021, 10:00 s.t.
Remark:For the exercises where you have to define primitive recursive functions, you are allowed to use all functions that were proved to be primitive recursive in the lecture or in a previous exercise.
Exercise 8.1
Letf :N→Nbe defined as follows:
f(n) =
1 if n= 0
2 if n= 1
4 if n= 2
f(n−1) +f(n−2) +f(n−3) if n >2 Prove thatf is primitive recursive.
Exercise 8.2
Letf :N→Nbe defined as follows:
f(n) =
3 if n= 0
7 if n= 1
4 if n= 2
4 if n= 3
(2∗f(n−4))−f(n−2) + (4∗f(n−3)) + (3∗f(n−1)) if n >3 Prove thatf is primitive recursive.
Exercise 8.3
Letg:N→Nbe defined by:g(n) =f(n, n+ 1)−1, andf :N2→Nbe defined by:
f(n,0) = 0
f(n, k+ 1) = f(n, k) + (1−(k2−n))
a) Show that g is primitive recursive.
b) Computeg(5)and g(10).
c) Give a LOOP program which computes g.
d) Describe what mathematical function is computed by g.
e) Give a primitive recursive function which computes blog2(n)c. (Forn= 0, the value of the function should be0, not−∞.)
Hint: Modify the functionsg and f in a suitable way.
f) Prove that the function log : N2 → N defined by log(n, m) = blogn(m)c is primitive recursive.
Hint: Modify the functionsg and f in a suitable way.
Exercise 8.4
Show that there exists a functionf :N→Nwhich is not primitive recursive.
Exercise 8.5
Which functions are computed by:
I) f1(n, m) =µi<mi(n−i= 0)
II) f2(n1, n2, m) =µi<mi n1−(i+n2) = 0 III) f3(m) =µi<mi m−(i+i) = 0
IV) f4(m) =µi<mi (5−i)∗((m−1)−i) = 0
∗1
B 225 sofronie@uni-koblenz.de https://userpages.uni-koblenz.de/~sofronie/
∗2
B 223 dpeuter@uni-koblenz.de https://userpages.uni-koblenz.de/~dpeuter/
If you want to submit solutions, please do so until 15.06.2021, 10:00 s.t. via e-mail (with “Homework ACTCS” in the subject) todpeuter@uni-koblenz.de.