Omnimaga

General Discussion => Other Discussions => Math and Science => Topic started by: Xeda112358 on May 17, 2013, 11:08:55 am

Title: Gamma!
Post by: Xeda112358 on May 17, 2013, 11:08:55 am
I wanted to show you one result from my work over the past two days, since it lead to some neat derivations. Essentially, it is an approximation that converges to the gamma function. I know, it isn't that awesome, but I had fun :)

Attached are some computation thingies, too, if you wanted to look at it.
Title: Re: Gamma!
Post by: ruler501 on May 17, 2013, 08:26:20 pm
I see how you prove it is a function that matches that f(x+1)=f(x)*(x+1) but how do you prove it is the gamma function? I thought you could have an infinite number of functions with this feature and the gamma was special in some way that made it a better approximation for most purposes.
Title: Re: Gamma!
Post by: Adriweb on May 17, 2013, 08:46:06 pm
Interesting read :)

I've worked with those functions for school for like 2 years now :P

I couldn't resist looking things up on Wolfram Alpha with what you said.

It turns out that :

(http://i.imgur.com/JzjmmWH.png)
( (http://i.imgur.com/LCO2fLj.gif) )

I wanted to graph the difference between the 2 things :
It's commonly known that gamma(x+1) == x!, so graphing what you say is (to see the difference) :
(http://i.imgur.com/RlBvDYD.png)
A bit weird (against your idea at least) since it doesn't look like it's converging as x gets bigger ?....


But then I saw that W|A actually give what you'd be looking for : the difference between the 2 expressions :
(http://i.imgur.com/RffpoHX.png)

But that's not really usable then ^^
(Well, Mathematice 9 doesn't get further, or at least not directly :
(http://i.imgur.com/gqzeD8Q.png) )
Title: Re: Gamma!
Post by: Xeda112358 on May 17, 2013, 09:03:15 pm
That is spectacular, thank you, Adriweb o.o
@ruler501: I believe that the defining characteristic of the Gamma function (the one that makes it unique) is that its concavity is always up. There are infinitely many functions that satisfy the other traits, but once you have a function that satisfies those and is concave up, it must be the Gamma function.

Evidently, I need to see where I have the difference of two ratios wrong D:

Again, thanks!
Title: Re: Gamma!
Post by: ruler501 on May 17, 2013, 11:48:47 pm
I would think that all factorial functions would be concave up as they are all increasing at ever faster rates

According to wikipedia the thing that makes it unique is that it is superconvex(the composition of it and the log function is concave up)
Title: Re: Gamma!
Post by: Xeda112358 on May 22, 2016, 12:49:16 pm
This time I bring a much better approximation to the Gamma function!
##\Gamma(x+1) \approx f(x)=C\sqrt{x}x^{x}e^{-x+\frac{1}{12x}-\frac{1}{360x^{3}}+\frac{1}{1260x^{5}}}, C\approx2.5066282745692##

The approximation gets better as x gets bigger, too! For example, ##\Gamma(1.5)=\frac{\sqrt{\pi}}{2}\approx.8862269255##.
However, ##f(.5)\approx.9008942683## which is terrible accuracy :( Instead we do ##\frac{f(9.5)}{9.5*8.5*7.5*...*1.5}\approx.8862269255## !

How did I derive this?

First I observed that ##ln(n!)=\sum_{k=1}^{n}{ln(k)}=\sum_{k=2}^{n}{ln(k)}##, and then I applied the Euler-Maclaurin formula to get:
##\sum_{k=2}^{n}{log(k)}=\int_{1}^{n}{log(x)dx}+\frac{log(n)-log(1)}{2}+\sum_{k=1}^{\infty}{\frac{B_{2k}(2k-2)!}{(2k)!}\left(n^{1-2k}-1\right)}##
##\sum_{k=2}^{n}{log(k)}=xlog(x)-x+1+\frac{log(n)}{2}+C+\sum_{k=1}^{\infty}{\frac{B_{2k}}{2k(2k-1)}n^{1-2k}}##
From there I tested a few values to approximate C, then I truncated the sum to three terms!


Also, the function ##f(1)=1, f(x)=x^{x}f(x-1)## can be approximated by:
##Cx^{x(x+1)/2}e^{ln(x)/12-x^{2}/4+\frac{1}{720x^{2}}-\frac{1}{5040x^{4}}+\frac{1}{10080x^{6}}}, C\approx1.282427129442##