|Re: HP-15C Mini-challenge: My solutions & Comments|
Message #33 Posted by Crawl on 26 Sept 2006, 5:18 p.m.,
in response to message #30 by e.young
"Gamma" is not a natural function. The factorial is the natural function. Don't ask me why "Gamma" has become so widespread as compared to factorial. Historically, the factorial function was used by Gauss and Reimann, but Gamma was used by Legedre. It's not clear what advantages Legedre thought shifting the argument to get Gamma had (except that the first singularity is at zero rather than -1), but the result is that virtually every time you'd use it, you'll have to shift the argument again to get back to the factorial.
Now, when we're talking about calculators, some require factorial to be integers, in which case the factorial function could be defined as
(n)! = 1 * 2 * 3 * ... * (n-1) * n
(1)! = 1
(n)! = n * (n-1)!
Calculators that do this for factorial will not allow the factorial function of a noninteger to be calculated. It seems the 42s uses the integer definition for factorial, but the more general defintion of gamma. Other calculators do different things.
For instance, the 49G+ lets you take the factorial of any real number, but not of complex numbers. But for some reason, Gamma works on real and complex numbers. Who knows why.
There are various ways of generalizing the factorial function to nonintegers (but all ways will give the same function! For example, (2)! will always be 2, regardless of the exact generalizing method, (1/2)! will always be sqrt(pi)/2, etc.)
One illuminating way is
(s)! = infinite product of terms (1+1/n)^s / (1 + s/n), as n goes from 1 to infinity.
Now imagine we multiply (s)! by (-s)!. In that case, the numerator of those terms goes away! We're left with a product of terms of the form
1/(1 - (s/n)^2), as n goes from 1 to infinity.
Now, the function sin(pi*x)/(pi*x) has roots at x = +/- 1, +/- 2, +/-3, +/-4, .... It also has a value of 1 when x = 0
So, if (as was Euler's idea) we would factor it like a polynomial, we'd get
sin(pi*x)/(pi*x) = (1-x)*(1+x)*(1-x/2)*(1+x/2)*...
Which is a polynomial which equals 1 when x = 0, and is zero if x = +/- 1, +/- 2, etc.
And this is exactly the same as the reciprocal of what we found for (x)!*(-x)! above!