Function Combination on Computer Science

130 Views Asked by At

I read some material on Computational Function, every one could describe the result of following combination?

suppose $g_1(x)=3x$, $g_2(x)=4x$, $f(x,y)=x+y$, how we compute combination of $f$ with $g_1$ and $g_2$?

i means the answer is :

h(x)=12x or h(x,y)=3x+4y or h(x)=7x or h(x,y)=12x^2 or sth else?

1

There are 1 best solutions below

0
On

In Computability Theory, a very important class of fucntions is the class of Primitive recursive function.

This class is defined starting form some initial (very "simple") functions and using few methods to build up new functions from already existing ones.

One of the methods allowed is that of composition [not "combination"] :

Given $f$, a $k$-ary primitive recursive function, and $k$ $m$-ary primitive recursive functions $g_1, \ldots ,g_k$, the composition of $f$ with $g_1, \ldots ,g_k$, i.e. the $m$-ary function

$h(x_1, \ldots , x_m) = f(g_1(x_1, \ldots , x_m), \ldots g_k(x_1, \ldots , x_m))$

is primitive recursive.

In your example, we have $k=m=2$; $f(x,y)=x+y$ (the "sum" function) is primitive recursive; $g_1(x)=3x$, $g_2(x)=4x$ are p.r.

Thus, the composition of $f$ with $g_1$ and $g_2$ is :

$h(x,y)=f(g_1(x),g_2(y))=f(3x,4y)=3x+4y$.