Recursion-theoretic if-statements

  • Thread starter Thread starter kanima
  • Start date Start date
kanima
Messages
6
Reaction score
0
Hi, there, I was wondering if anyone knew a good way to implement if-statements in recursion-theoretic terms. Basically, I've come to the understanding that primitive recursion is analogous to a for-loop and mu-recursion to more general while-loops, but is there in general a simple analog of an if-statement in recursion theory?

For example, suppose that given partial recursive functions g and h I had the following algorithm which takes x as input.

if x < 50 then
return g(x)​
else
return h(x)​

How could I define a partial recursive function computing the above algorithm? What if the condition x < 50 were replaced by some more general recursive predicate R(x)?

I suspect this shouldn't be so difficult but I am quite new to this subject. If this is the case, I would be quite glad if someone would share their knowledge me.

Thanks!
 
Physics news on Phys.org
I don't know the answer to your question, but it prompted me to look up "partial recursive function". I notice there a considerable difference between how it is defined on the Wikipedia (http://en.wikipedia.org/wiki/Computable_function) versus Wolfram (http://mathworld.wolfram.com/RecursiveFunction.html).

If we use the Wolfram definition, your question could be interpreted as asking how to write a function who definition has an "if ... then " clause as a series of equations. However, I'm not sure that question is significant if we are allowed to use "function symbols" in the equations unless there is some restriction on what functions can be represented by "function symbol". Is there something that says a "function symbol" cannot stand for a function (say on the non-negative integers) which is the list of pairs (x, f(x)) = { (1,0),(2,0),(3,1),(4,1),... }, which amounts to f(k) = 0 if k < 3 and f(k) = 1 otherwise.
 
Last edited by a moderator:
Sorry, I should have been more specific, especially because of the many guises this same subject appears in.

My definition of partial recursive function is more in line with the one given in the following wikipedia article:
http://en.wikipedia.org/wiki/Μ-recursive_function.

Wikipedia calls them partial \mu-recursive functions, and the https://www.amazon.com/dp/044450205X/?tag=pfamazon01-20I am following simply calls them partial recursive functions.

The class of functions defined in this way is equivalent to the class of those defined in the Wolfram link. This class of functions is also equivalent to the class of Turing-computable functions: functions whose values can be computed by some Turing machine.

It shouldn't be very difficult to implement conditional if-statements on Turing machines (since they're pretty natural models of computation). However, I am interested in seeing how a function computed by an algorithm with an if-statement can be built up from definition given in the wikipedia page on \mu-recursive functions.
 
Last edited by a moderator:
Perhaps the place to start is to find a function T(x) that returns 1 if x < 50 and returns 0 otherwise. Then the function you asked about is defined by f(x) = T(x)g(x) + (1-T(x))h(x).

What is a "general recursive predicate"? Is there a definition or theorem that says its evaluation (as true or false , or 1 or 0) is computable.
 
Yes, I believe you're right, and looks like the answer was quite simple after all. By a recursive predicate I did just mean a recursive function that could only give the values 0 or 1. So I guess the function f in your example would be recursive if the predicate T expressing the condition was recursive.
 
Namaste & G'day Postulate: A strongly-knit team wins on average over a less knit one Fundamentals: - Two teams face off with 4 players each - A polo team consists of players that each have assigned to them a measure of their ability (called a "Handicap" - 10 is highest, -2 lowest) I attempted to measure close-knitness of a team in terms of standard deviation (SD) of handicaps of the players. Failure: It turns out that, more often than, a team with a higher SD wins. In my language, that...
Hi all, I've been a roulette player for more than 10 years (although I took time off here and there) and it's only now that I'm trying to understand the physics of the game. Basically my strategy in roulette is to divide the wheel roughly into two halves (let's call them A and B). My theory is that in roulette there will invariably be variance. In other words, if A comes up 5 times in a row, B will be due to come up soon. However I have been proven wrong many times, and I have seen some...

Similar threads

Replies
5
Views
3K
Replies
1
Views
5K
Replies
16
Views
2K
Replies
6
Views
2K
Replies
11
Views
4K
Replies
2
Views
2K
Back
Top