• Keine Ergebnisse gefunden

Exercise 6.1 Prove that the following functions are primitive recursive: 1

N/A
N/A
Protected

Academic year: 2022

Aktie "Exercise 6.1 Prove that the following functions are primitive recursive: 1"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Universität Koblenz-Landau FB 4 Informatik

Prof. Dr. Viorica Sofronie-Stokkermans1 29.11.2017

M.Ed. Dennis Peuter2

Exercises for Advances in Theoretical Computer Science Exercise Sheet 6

Due at 04.12.2017, 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 recursice in the lecture or in a previous exercise.

Exercise 6.1

Prove that the following functions are primitive recursive:

1. cks :Nk →N, wheres∈N, dened for every n∈Nk by:cks(n) =s. 2. fac:N→N, dened for every n∈Nby:fac(n) =n!.

3. exp:N×N→N, dened for every (n, m)∈N×Nby:exp(n, m) =nm. 4. eq:N×N→N, dened for every (n, m)∈N×Nby: eq(n, m) =

(1 if n=m

0 otherwise. Exercise 6.2

Consider the following primitive recursive functions:

I) f1 = +◦(− ◦(π21, c25),∗ ◦(π22, π22)) II) f2 =PR[(+1)◦0,∗ ◦((+1)◦π12, π22)]

III) f3 =PR[c11,∗ ◦(π13, π33)]◦((−1)◦π12, π22)

a) Which is the arity of f1, off2 and off3? (i.e. how many arguments does each of these functions have?)

b) What do these functions compute if all arguments are equal to 2?

c) What do these functions compute in general?

Exercise 6.3

Express in the formh(n) = 0 withh primitive recursive the following conditions:

I) nis greater than 20 and is a perfect square, i.e.

n≥20 and∃k≤n:k∗k=n.

II) All prime divisors of n1 are smaller thann2:

∀k≤n1 (prime(k) = 0or |(k, n1) = 0 or k≤n2). Note: primeand |are the function dened in the lecture with:

prime(k) = 1 ifk is a prime number and prime(k) = 0 if k is not a prime number;

|(k, n) = 1 if k divides n and|(k, n) = 0 if k does not divide n.

(2)

Exercise 6.4

Prove that the following functions are primitive recursive:

I) max:N2 →Ndened bymax(x, y) =

(x if x≥y y otherwise. II) div:N2→N dened bydiv(x, y) =

(x+ 1 if y= 0 bxyc otherwise. III) mod:N2→N dened bymod(x, y) =

(x if y= 0 x mod y otherwise.

Note: Here bxc is the largest integer which is smaller than or equal to x (oorx).

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 04.12.2017, 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

☛ As long as you are a minor (less than 18 years old) and have an Aufenthaltserlaubnis acording to the new residence right regulations (§ 25a Aufenthaltsgesetz), your parents and

Remark: In the lecture from 13.12.2017 we sketched a possibility of associating with every Turing Machine M a unique Gödel number hMi ∈ N such that the coding function and the

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

Remark: In the lecture from 12.12.2018 we sketched a possibility of associating with every Turing Machine M a unique Gödel number hMi ∈ N such that the coding function and the

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

Die Projekte treten auf unterschiedliche Weise in direkte Interaktion mit dem Besucher und betonen die Bedeutung von Kommunikation und Dialog im Museum.. Kunst und deren

In diesem gemeinsamen Projekt, das 2010 ursprünglich auf Einladung für eine Ausstellung der in Istanbul ansässigen Kunstinstitution ARTER entstand, machen Banu Cenneto?lu und

a certain graph, is shown, and he wants to understand what it means — this corre- sponds to reception, though it involves the understanding of a non-linguistic sign;