Talk:McCarthy 91 function
Why is this interesting? I accept that it is an example of a recursive function, but I don't see why is deserves an article. And why is it restricted to positive integers? --Henrygb 12:30, 10 Aug 2004 (UTC)
It's interesting because it is. Also, because this function is hilarious.
Here's a function that Henrygb might find interesting. It returns 91 for all input, not just positive integers:
D(x) = 91
What was McCarthy's original motivation for this function? A simple illustration of recursion? --Bubba73 14:18, 27 May 2005 (UTC)
I just had to refactor the awkward Java implementation of McCarthy's function. Java is not suited to functional programming at all. -- Matthias
It is true that java is not well suited for showing recursive functions, but it is good to have its implementation because far more people can read java than lisp. It is a good example of recursion.
As for the lisp implementation, I just couldn't resist adding a nice clean lisp implementation of the same function. :) --pi 17:37, 15 July 2005 (UTC)
An algorithm does seldom correspondend one-on-one with its implementation in a relatively low level language such as java. We should keep the iterative version in java to show that you sometimes have to obfuscate your ideas to make your computer run them. -- Matthias
Shouldn't the M(n-10) in the beginning sentence just say n-10?