Docsity

Homework Assignments for Math 558: Primitive Recursive Functions, Assignments of Mathematics

Toggle sidebar
bg1
Math 558 Homework # 1
Due: Friday, 1-28
1. Show that the following functions and relations are primitive recursive:
(a) π(n) = the number of primes less than or equal to n
(b) Q(n)≡nis even
(c) For each k≥1, the function mink(x1, . . . , xk) which outputs the least
number among {x1, . . . , xk}.
2. Define a binary function fon Nas follows: For n∈Nwrite the decimal
expansion of √nas √n=a0.a1a2a3···
where a0is a natural number and for i≥1 we have 0 ≤ai≤9 (if √nis an
integer, then ai= 0 for all i≥1). Let f(n, i) = ai, so that fcomputes the
digits of the decimal expansion of √n. Show that fis primitive recursive.
3. (Simultaneous recursion) Suppose the functions g1and g2are k−ary prim-
itive recursive functions and h1and h2are (k+3)-ary primitive recursive
functions. Define functions f1and f2by
f1(0, x1, . . . xk) = g1(x1, . . . , xk)
f2(0, x1, . . . xk) = g2(x1, . . . , xk)
f1(y+ 1, x1, . . . xk) = h1(y, f1(y, x1, . . . , xk), f2(y , x1, . . . , xk), x1, . . . , xk)
f2(y+ 1, x1, . . . xk) = h2(y, f1(y, x1, . . . , xk), f2(y , x1, . . . , xk), x1, . . . , xk)
Show that f1and f2are primitive recursive.
4. Define the Fibonacci function F(n) by
F(0) = 0
F(1) = 1
F(n+ 2) = F(n) + F(n+ 1)
Show that Fis primitive recursive.
5. Show that the following functions and relations are primitive recursive.
[Hint: You may want to code the sequence of previous values, keeping in
mind that if scodes a sequence hn0, . . . , nki, then each ni< s.]
(a) Seq(s)≡scodes a sequence
(b) Length(s) = (k+ 1 if s=hn0,. . . , nki
0 otherwise
(c) R(s) = (nkif s=hn0, . . . , nki
0 otherwise
pf2

Partial preview of the text

Download Homework Assignments for Math 558: Primitive Recursive Functions and more Assignments Mathematics in PDF only on Docsity!

Math 558 Homework # 1

Due: Friday, 1-

  1. Show that the following functions and relations are primitive recursive:

(a) π(n) = the number of primes less than or equal to n (b) Q(n) ≡ n is even (c) For each k ≥ 1, the function mink(x 1 ,... , xk) which outputs the least number among {x 1 ,... , xk}.

  1. Define a binary function f on N as follows: For n ∈ N write the decimal expansion of

n as (^) √ n = a 0 .a 1 a 2 a 3 · · · where a 0 is a natural number and for i ≥ 1 we have 0 ≤ ai ≤ 9 (if

n is an integer, then ai = 0 for all i ≥ 1). Let f (n, i) = ai, so that f computes the digits of the decimal expansion of

n. Show that f is primitive recursive.

  1. (Simultaneous recursion) Suppose the functions g 1 and g 2 are k−ary prim- itive recursive functions and h 1 and h 2 are (k + 3)-ary primitive recursive functions. Define functions f 1 and f 2 by

f 1 (0, x 1 ,... xk) = g 1 (x 1 ,... , xk) f 2 (0, x 1 ,... xk) = g 2 (x 1 ,... , xk) f 1 (y + 1, x 1 ,... xk) = h 1 (y, f 1 (y, x 1 ,... , xk), f 2 (y, x 1 ,... , xk), x 1 ,... , xk) f 2 (y + 1, x 1 ,... xk) = h 2 (y, f 1 (y, x 1 ,... , xk), f 2 (y, x 1 ,... , xk), x 1 ,... , xk)

Show that f 1 and f 2 are primitive recursive.

  1. Define the Fibonacci function F (n) by

F (0) = 0 F (1) = 1 F (n + 2) = F (n) + F (n + 1)

Show that F is primitive recursive.

  1. Show that the following functions and relations are primitive recursive.

[Hint: You may want to code the sequence of previous values, keeping in mind that if s codes a sequence 〈n 0 ,... , nk〉, then each ni < s.]

(a) Seq(s) ≡ s codes a sequence

(b) Length(s) =

k + 1 if s = 〈n 0 ,... , nk〉 0 otherwise

(c) R(s) =

nk if s = 〈n 0 ,... , nk〉 0 otherwise

(d) Inc(s) ≡ s is an increasing sequence, i.e. s = 〈n 0 ,... , nk〉 and n 0 < n 1 < · · · < nk.

  1. Prove the following properties of the Ackermann functions:

(1.) For all x, A( nx )(1) ≥ x + 1. (5.) For all x, An(2x) < An+2(x).