wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> general problem-solving / chatting / whatever >> what is google calculator doing?
(Message started by: BenVitale on Jul 24th, 2009, 11:32am)

Title: what is google calculator doing?
Post by BenVitale on Jul 24th, 2009, 11:32am
What I know is we cannot use the factorial function onto non-whole, negative or complex numbers.

Google calculator gave me this:

4 ! = 24
5 ! = 120

4.5 ! = 52.3427778 (http://www.google.ca/search?hl=en&q=4.5%21+%3D+&btnG=Google+Search&meta=&aq=f&oq=)

4.85 ! = 93.0961354

(-3.5) ! = -0.94530872

(-4.5) ! = 0.270088206

(2 + (4 * i)) ! = 0.00522553847 - 0.172547079 i (http://www.google.ca/search?hl=en&q=%282+%2B+4i%29%21+%3D+&btnG=Google+Search&meta=&aq=f&oq=)


What are these? What is google calculator doing?

I read that some mathematicians decided they wanted to interpolate the factorial function to find "what values would be" between the integers...  and "extrapolate" for negatives as well.

They found that there are several functions that can do that but these functions do not always agree at the exact values for interpolated and extrapolated inputs.

The most popular function is the Gamma Function (http://en.wikipedia.org/wiki/Gamma_function)

Is the gamma function the proper function to extrapolate negative whole numbers but not the proper function to interpolate non-integers?

Title: Re: what is google calculator doing?
Post by Obob on Jul 24th, 2009, 4:21pm
Google calculator is writing

x! = Gamma(x+1)

and using this for calculating non-integer values.  The gamma function satisfies the recurrence relation Gamma(x+1) = x * Gamma(x), which is reminiscent of the factorial's recurrence relation.  This, however, is not enough to specify what Gamma is.  We would like the extension of factorial to be what is called "analytic," though, which basically means the function is given by a power series (locally, anyways).  Unfortunately, this still doesn't specify what Gamma has to be.  You can further require Gamma to be logarithmically convex, and that will be enough to specify Gamma uniquely.

For negative integer values, Gamma has a pole (i.e. it is infinite).  Interestingly, google calculator doesn't like (-3)!, and does a google search instead.

In many senses, Gamma is the best way to interpolate other values of the factorial.  However, I wouldn't go so far as to say 4.5! = 52.34...;  I would merely say that a reasonable interpretation of 4.5! is Gamma(5.5), which equals 52.34....

Title: Re: what is google calculator doing?
Post by BenVitale on Jul 24th, 2009, 5:02pm
Okay. So,

gamma(n+1) = n! for non-negative n

How do you define (1/2)! ?

(I'm getting a weird result)


Title: Re: what is google calculator doing?
Post by Obob on Jul 24th, 2009, 5:25pm
For z with positive real part, Gamma(z) =  http://www.ocf.berkeley.edu/~wwu/YaBBImages/symbols/int.gif0http://www.ocf.berkeley.edu/~wwu/YaBBImages/symbols/infty.gif tz-1e-t dt, and (1/2)! should be interrpreted as Gamma(3/2).  The integral evaluates to http://www.ocf.berkeley.edu/~wwu/YaBBImages/symbols/surd.gif(http://www.ocf.berkeley.edu/~wwu/YaBBImages/symbols/pi.gif)/ 2.

Title: Re: what is google calculator doing?
Post by BenVitale on Jul 24th, 2009, 11:07pm

on 07/24/09 at 17:25:36, Obob wrote:
For z with positive real part, Gamma(z) =  http://www.ocf.berkeley.edu/~wwu/YaBBImages/symbols/int.gif0http://www.ocf.berkeley.edu/~wwu/YaBBImages/symbols/infty.gif tz-1e-t dt, and (1/2)! should be interrpreted as Gamma(3/2).  The integral evaluates to http://www.ocf.berkeley.edu/~wwu/YaBBImages/symbols/surd.gif(http://www.ocf.berkeley.edu/~wwu/YaBBImages/symbols/pi.gif)/ 2.


Thanks, Obob .... It's clear now ... I should have checked my calculus book.

This wiki document discusses, too, and in particular

(n + 1/2)! = (http://en.wikipedia.org/wiki/Factorial#The_gamma_function)

and, The Gamma function is in fact defined for all complex numbers z except for the nonpositive integers

Title: Re: what is google calculator doing?
Post by Obob on Jul 25th, 2009, 1:09pm
Gamma is defined for all complex numbers except the nonpositive integers.  However, the formula I gave is not the correct definition if z has negative real part; the integral doesn't converge then.  For negative z, Gamma is defined by analytic continuation.

Here's another definition of Gamma which is valid for all z where it is defined:

Gamma(z) = limit as n->infty of n! nz/(z(z+1)(z+2)...(z+n)).



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board