Answer to Question #284825 in Discrete Mathematics for deerendra

Question #284825

show that factorial function is promitive recursive


1
Expert's answer
2022-01-05T11:31:38-0500

The factorial function defined as fac:NNfac:\N\to \N

Such that fac(n)=n!fac(n)=n!

From the definition of the factorial, we have that:

fac(n)=n!={1                                    if n=0mult(n,fac(n1))   if n>0fac(n)= n!=\begin{cases} 1~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \text{if } n=0\\ mult(n,fac(n-1))~~~\text{if } n>0\end{cases}

Thus fac is obtained by primitive recursion from the constant 1 and the primitive recursive function mult.


Hence fac is primitive recursive.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment