(Comp.sys.hp48) Item: 625 by edp@alien.enet.dec.com Author: [Eric Postpischil] Subj: The factorial (gamma) function Date: Fri Feb 14 1992 In article <1992Feb11.201938.11196@athena.cs.uga.edu>, rollie@marie.stat.uga.edu (Rollie Smith) writes... > The factorial function on the hp48 does something for non integers. Mathematicians have something called the gamma function, which is written with the capital Greek letter gamma. The definition is: gamma(x) = integral from 0 to infinity of e^(-t)*t^(x-1) dt. It so happens that gamma(x+1) = x! for integers x. Also, gamma(x+1) = x*gamma(x) even for non-integers. Anyway, when you use x! for non-integers, you get gamma(x+1). The gamma function turns up in the volume of a sphere in a general number of dimensions. The volume of a "sphere" with radius r in n dimensions is r^n*pi^(n/2) / gamma(n/2+1). If you evaluate that for n = 2 and 3, you will get the formulae for the area and volume of a circle and sphere, respectively. If you ever have a product such as 1*3*5*7*... or 2*5*8*11*... that you want to evaluate, the gamma function might be useful. Since x! = x*(x-1)!, (7/2)! = (7/2)*(5/2)*(3/2)*(1/2)*(-1/2)!, so 1*3*5*7 = 2^4 * (7/2)! / (-1/2)!. Similarly, 2*5*8*11*...*(3*i-1) = 3^i * ((3*i-1)/3)! / (-1/3)!. -- edp (Eric Postpischil) "Always mount a scratch monkey." edp@alien.enet.dec.com