Home
Evaluations
Tags
Lectures
Sandbox
About
Contribute
Evaluations
Tags
Lectures
About
Back
Question:
2017 Fall Midterm - 12
Author: Michiel Smid
The functions $f : \mathbb{N}^2 \rightarrow \mathbb{N}$ and $g : \mathbb{N} \rightarrow \mathbb{N}$ are recursively defined as follows:
$f(m, 0)$
$= m\ \;$
$\mathrm{if}\ m \geq 0,$
$f(m, n)$
$= 1 + f(m, n - 1)\ \;$
$\mathrm{if}\ m \geq 0$ $\mathrm{and}\ n \geq 1,$
$g(0)$
$= 1,$
$g(n)$
$= 5 \cdot g(n - 1)\ \;$
$\mathrm{if}\ n \geq 1.$
For any integer $n \geq 0$, what is $f(g(n), g(n))$?
(a)
$(5^{n-1})^{2}$
(b)
$(5^{n})^{2}$
(c)
$2 \cdot 5^{n}$
(d)
$2 \cdot 5^{n-1}$
COMP 2804: Discrete Structures II
COMP 2804 Midterm
Recursive Functions (4.1)