General Discussion > Math and Science

Gamma!

<< < (2/2)

Xeda112358:
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##MathJax.Hub.Queue(["Typeset", MathJax.Hub, document.getElementById("bbclatex664c7ae1066ee")]);console.log("Queued!");

The approximation gets better as x gets bigger, too! For example, ##\Gamma(1.5)=\frac{\sqrt{\pi}}{2}\approx.8862269255##MathJax.Hub.Queue(["Typeset", MathJax.Hub, document.getElementById("bbclatex664c7ae1066fc")]);console.log("Queued!");.
However, ##f(.5)\approx.9008942683##MathJax.Hub.Queue(["Typeset", MathJax.Hub, document.getElementById("bbclatex664c7ae106705")]);console.log("Queued!"); which is terrible accuracy :( Instead we do ##\frac{f(9.5)}{9.5*8.5*7.5*...*1.5}\approx.8862269255##MathJax.Hub.Queue(["Typeset", MathJax.Hub, document.getElementById("bbclatex664c7ae10670d")]);console.log("Queued!"); !

How did I derive this?

First I observed that ##ln(n!)=\sum_{k=1}^{n}{ln(k)}=\sum_{k=2}^{n}{ln(k)}##MathJax.Hub.Queue(["Typeset", MathJax.Hub, document.getElementById("bbclatex664c7ae106714")]);console.log("Queued!");, 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)}##MathJax.Hub.Queue(["Typeset", MathJax.Hub, document.getElementById("bbclatex664c7ae10671b")]);console.log("Queued!");
##\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}}##MathJax.Hub.Queue(["Typeset", MathJax.Hub, document.getElementById("bbclatex664c7ae106723")]);console.log("Queued!");
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)##MathJax.Hub.Queue(["Typeset", MathJax.Hub, document.getElementById("bbclatex664c7ae10672a")]);console.log("Queued!"); 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##MathJax.Hub.Queue(["Typeset", MathJax.Hub, document.getElementById("bbclatex664c7ae106732")]);console.log("Queued!");

Navigation

[0] Message Index

[*] Previous page

Go to full version