Primitive recursivness of a function. How does the function work?

71 Views Asked by At

So, I need some help with an homework assignment.

Firstly: understanding the following function:
$h(x) = \prod_{m=0}^{f(x)} m*f(m)$

From my limited knowledge of the product of sequences my guess is that it works this way(output wise) ( $'$ is the successor function):

$h(x) = \prod_{m=0}^{f(x)} m*f(m) = (m * f(m)) * (m' * f(m'))...(m^x * f(m^x))$

where $x$ in $m^x$ is the result of $f(x)$, i.e. if $x = 2$ we will have $m'$ and $m''$.

Secondly: Showing that the function is primitive recursive. This is my first try at defining the function with recursion and im pretty unsure if I did succeed:

$h(x,0) = f(x,g(0))$
$h(x,y') = h(x,g(y)) * f(x,g(y'))$

A pointer or two would be appriciated. Best regards.

EDIT:
$h(0) = k(f(0))$
$h(x') = h(x) * k(f(x'))$