• Keine Ergebnisse gefunden

(3∗f(n−1)) if n >3 Prove thatf is primitive recursive

N/A
N/A
Protected

Academic year: 2022

Aktie "(3∗f(n−1)) if n >3 Prove thatf is primitive recursive"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Universität Koblenz-Landau FB 4 Informatik

Prof. Dr. Viorica Sofronie-Stokkermans1 12.12.2019

M.Ed. Dennis Peuter2

Exercises for Advances in Theoretical Computer Science Exercise Sheet 8

Due at 16.12.2019, 10:00 s.t.

Remark: For the exercises where you have to dene 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 dened 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 dened 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 dened by:g(n) =f(n, n+ 1)−1, andf :N2→Nbe dened 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.

(2)

e) Give a primitive recursive function which computes blog2(n)c. (Forn= 0, the value of the function should be0, not−∞.)

Hint: Modify the functions g and f in a suitable way.

f) Prove that the function log : N2 → N dened by log(n, m) = blogn(m)c is primitive recursive.

Hint: Modify the functions g 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 16.12.2019, 10:00 s.t. via the cardboard box in the shelf in room B 222 or via e-mail (with Homework ACTCS in the subject) to dpeuter@uni-koblenz.de.

Referenzen

ÄHNLICHE DOKUMENTE

via the cardboard box in the shelf in room B 222 or via e-mail (with Homework ACTCS in the subject)

via the cardboard box in the shelf in room B 222 or via e-mail (with Homework ACTCS in the subject)

Remark: For the exercises where you have to dene primitive recursive functions, you are allowed to use all functions that were proved to be primitive recursice in the lecture or in

Remark: For writing pseudocode, use the language that is dened at the home page of the exercise.. via the cardboard box in the shelf in room B 222 or via e-mail (with Homework ACTCS

via the cardboard box in the shelf in room B 222 or via e-mail (with Homework ACTCS in the subject)

via e-mail (with “Homework ACTCS” in the subject)

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

He was a postdoctoral research associate at the Institute for Studies in Theoretical Physics and Mathematics (IPM) in Tehran.. He is now an assistant professor in the Department