Is it possible to solve every problem (solvable with turing machine) with only recursion ? If yes, which principles or theories assure this ? Thanks
2 Answers
Can you define what it means to solve a problem "only" with recursion?
Would your definition allow an algorithm like this:
int foo(int n) {
if (n==1) return 1;
while(someCondition) {
do something
foo(n-1);
}
}
If your definition would wllow this, then it would be easy to transform every algorithm in such a recursive form (you could do all your calculations in the outermost function call and do nothing in the recursive calls).
- 101
- 6
A set $A$ is computable (like in Turing machines) iff its characteristic function $$\chi_A(x) = \begin{cases}1, & x \in A\\ 0, & x \notin A\end{cases}$$ is recursive. The class of recursive functions (sometimes referred to as $\mu$-recursive functions) is the smallest class that contains all constant functions, successor function, projection, and is closed under substitution, primitive recursion and minimization.
So yes, every computable function is recursive w.r.t. to the definition above.
- 2,034
- 10
- 19