Γ函数:修订间差异

求闻百科,共笔求闻
添加的内容 删除的内容
(机器人:清理不当的来源、移除无用的模板参数)
(机器人:清理不当的来源、移除无用的模板参数)
 

(未显示同一用户的2个中间版本)

第5行: 第5行:
|2=zh-hans:函数; zh-hant:函數;
|2=zh-hans:函数; zh-hant:函數;
}}
}}
[[File:Gamma_plot zh.svg|缩略图|200px|Γ函數在實軸上的函數圖形]]
[[File:Gamma_plot zh.svg|thumb|200px|Γ函數在實軸上的函數圖形]]
{{微積分學}}
{{微積分學}}
在[[數學]]中,<math>\Gamma \,</math>'''函数'''('''伽瑪函數''';Gamma函数),是[[階乘]]函數在[[實數]]與[[复数 (数学)|複數]]域上的擴展。如果<math>n</math>為[[正整數]],則:
在[[數學]]中,<math>\Gamma \,</math>'''函数'''('''伽瑪函數''';Gamma函数),是[[階乘]]函數在[[實數]]與[[复数数学|複數]]域上的擴展。如果<math>n</math>為[[自然数|正整數]],則:
:<math> \Gamma(n) = (n-1)!</math>
:<math> \Gamma(n) = (n-1)!</math>


對於實數部份為正的[[复数 (数学)|複數]]<math>z</math>,伽瑪函數定義為:
對於實數部份為正的[[复数数学|複數]]<math>z</math>,伽瑪函數定義為:
:<math> \Gamma(z)=\int_{0}^{\infty}t^{z-1}\mathrm{e}^{-t}\rm{d}t</math>
:<math> \Gamma(z)=\int_{0}^{\infty}t^{z-1}\mathrm{e}^{-t}\rm{d}t</math>
此定義可以用[[解析延拓]]原理,拓展到除去[[非正整數]]的整個[[复数 (数学)|複數]]域上。
此定義可以用[[解析延拓]]原理,拓展到除去[[非正整數]]的整個[[复数数学|複數]]域上。


因為 Γ函數 沒有零點,所以倒數Γ函數是一個整函數,也就是在整個複數上都是有定義的函數。
因為 Γ函數 沒有零點,所以倒數Γ函數是一個整函數,也就是在整個複數上都是有定義的函數。
第32行: 第32行:
<math>\Gamma \,</math>函數可以通过[[尤拉]](Euler)第二类积分定義:
<math>\Gamma \,</math>函數可以通过[[尤拉]](Euler)第二类积分定義:
:<math>\Gamma(z)=\int_{0}^{\infty}t^{z-1}\mathrm{e}^{-t}\rm{d}t</math>
:<math>\Gamma(z)=\int_{0}^{\infty}t^{z-1}\mathrm{e}^{-t}\rm{d}t</math>
对[[复数 (数学)|复数]]<math>z\,</math>,我们要求<math>\mathrm{Re}(z) > 0</math>。
对[[复数数学|复数]]<math>z\,</math>,我们要求<math>\mathrm{Re}(z) > 0</math>。


<math>\Gamma</math>函數还可以通过对<math>\mathrm{e}^{-t}\,</math>做[[泰勒展开]],[[解析延拓]]到整个[[复平面]]:
<math>\Gamma</math>函數还可以通过对<math>\mathrm{e}^{-t}\,</math>做[[泰勒展开]],[[解析延拓]]到整个[[复平面]]:
第48行: 第48行:
:<math>\Gamma(z) = \lim_{n \to {\infty}} n! \; n^z\prod_{k=0}^{n} (z+k)^{-1}</math>
:<math>\Gamma(z) = \lim_{n \to {\infty}} n! \; n^z\prod_{k=0}^{n} (z+k)^{-1}</math>
:<math>\Gamma(z) = \frac{\mathrm{e}^{-\gamma z}}{z} \prod_{n=1}^{\infty} \left(1 + \frac{z}{n}\right)^{-1} \mathrm{e}^{\frac{z}{n}}</math>
:<math>\Gamma(z) = \frac{\mathrm{e}^{-\gamma z}}{z} \prod_{n=1}^{\infty} \left(1 + \frac{z}{n}\right)^{-1} \mathrm{e}^{\frac{z}{n}}</math>
其中<math>\gamma\,</math>是[[欧拉-马歇罗尼常数]]。
其中<math>\gamma\,</math>是[[欧拉-马斯刻若尼常数|欧拉-马歇罗尼常数]]。


== <math>\Gamma</math>積分 ==
== <math>\Gamma</math>積分 ==
第63行: 第63行:
<math> \Gamma(x+1)=x\Gamma(x)</math>,
<math> \Gamma(x+1)=x\Gamma(x)</math>,


对于[[正整数]]<math>n\,</math>,有
对于[[自然数|正整数]]<math>n\,</math>,有
:<math> \Gamma(n+1)=n!</math>,
:<math> \Gamma(n+1)=n!</math>,
可以说<math> \Gamma \,</math>函数是[[階乘]]的推廣。
可以说<math> \Gamma \,</math>函数是[[階乘]]的推廣。
第75行: 第75行:
<math>\int_0^\infty \mathrm{e}^{-x} x ^n \mathrm{d}x = \left[\frac{-x^n}{\mathrm{e}^x}\right]_0^\infty + n \int_0^\infty \mathrm{e}^{-x} x ^{n - 1} {\rm{d}} x</math>
<math>\int_0^\infty \mathrm{e}^{-x} x ^n \mathrm{d}x = \left[\frac{-x^n}{\mathrm{e}^x}\right]_0^\infty + n \int_0^\infty \mathrm{e}^{-x} x ^{n - 1} {\rm{d}} x</math>


当<math>x=0 \,</math>时,<math>\tfrac{-0^n}{\mathrm{e}^0} = \tfrac{0}{1} = 0</math>。当<math>x \,</math>趋于[[无穷大]]时,根据[[洛必达法则]],有:
当<math>x=0 \,</math>时,<math>\tfrac{-0^n}{\mathrm{e}^0} = \tfrac{0}{1} = 0</math>。当<math>x \,</math>趋于[[无穷|无穷大]]时,根据[[洛必达法则]],有:


<math>\lim_{x \rightarrow \infty} \frac{-x^n}{\mathrm{e}^x} = \lim_{x \rightarrow \infty} \frac{-n! \cdot 0}{\mathrm{e}^x} = 0</math>。
<math>\lim_{x \rightarrow \infty} \frac{-x^n}{\mathrm{e}^x} = \lim_{x \rightarrow \infty} \frac{-n! \cdot 0}{\mathrm{e}^x} = 0</math>。
第83行: 第83行:
<math>\Gamma(n + 1) = n \int_0^\infty \frac{x ^{n - 1}}{\mathrm{e}^x} {\rm{d}}x</math>
<math>\Gamma(n + 1) = n \int_0^\infty \frac{x ^{n - 1}}{\mathrm{e}^x} {\rm{d}}x</math>


等式的右面正好是<math>n \Gamma(n)\,</math>。因此,[[递推公式]]为:
等式的右面正好是<math>n \Gamma(n)\,</math>。因此,[[递推关系式|递推公式]]为:


:<math>{\Gamma(n + 1) = n \Gamma(n)} \,</math>。
:<math>{\Gamma(n + 1) = n \Gamma(n)} \,</math>。
第108行: 第108行:
<ref>{{cite web |url= https://github.com/discoleo/R/blob/master/Math/Integrals.Gamma.R|title= Relations of the Gamma function|last= Mada|first= L.|date= 2020-04-24|website= R code on Github|publisher= Code publicly available on Github [Personal Research]|access-date= 2020-04-24|quote=Relations of the Gamma function}}</ref>
<ref>{{cite web |url= https://github.com/discoleo/R/blob/master/Math/Integrals.Gamma.R|title= Relations of the Gamma function|last= Mada|first= L.|date= 2020-04-24|website= R code on Github|publisher= Code publicly available on Github [Personal Research]|access-date= 2020-04-24|quote=Relations of the Gamma function}}</ref>


此式可用來協助計算[[t分布]]機率密度函數、[[卡方分布]]機率密度函數、[[F分布]]機率密度函數等的累計機率。
此式可用來協助計算[[t分布]]機率密度函數、[[卡方分佈|卡方分布]]機率密度函數、[[F分布]]機率密度函數等的累計機率。
* 極限性質
* 極限性質
對任何實數α
對任何實數α
第114行: 第114行:


=== 斯特靈公式 ===
=== 斯特靈公式 ===
{{函數圖形|title=Γ函數與斯特靈公式|width=200|height=100|number class=複數|nonreal is nan=1|round number=8
|start=-0.815513|end=2.85236|min=0|max=5|sampling=200
|1 = gamma(x+1) | 1 name=gamma(z+1)
|2 = sqrt(2*pi*x)*(x/e)^x | 2 name=√(2πx)(x/e)^x
|caption=<math>\Gamma(z+1)</math>(藍色)、<math>\sqrt{2\pi z}\left(\frac{z}{e}\right)^z</math>(橘色),數字越大<math>\sqrt{2\pi z}\left(\frac{z}{e}\right)^z,</math>會越趨近<math>\Gamma(z+1)</math>。但<math>\sqrt{2\pi z}\left(\frac{z}{e}\right)^z</math>會在負值則會因為出現虛數而無法使用。}}
{{main|斯特靈公式}}
{{main|斯特靈公式}}
[[斯特靈公式]]能用以估計<math>\Gamma(z)</math>函数的增長速度。公式為:
[[斯特靈公式]]能用以估計<math>\Gamma(z)</math>函数的增長速度。公式為:
第139行: 第134行:


== 导数 ==
== 导数 ==
對任何[[复数数学|複數]]''z'',滿足 ''Re(z) > 0'',有
{{函數圖形
| title = Γ函數的微分
| start = -2
| end = 5
| sampling = 500
| width = 200
| height = 100
| min = -20
| max = 50|gamma(x)|gamma(x)
| calc diff 2 = 1
| caption = Γ函數(藍色)、Γ函數的微分(橘色),其中,大於50與小於-20的部分被截掉。
}}
對任何[[复数 (数学)|複數]]''z'',滿足 ''Re(z) > 0'',有


:<math>\frac{{\rm d}^n}{{\rm d}z^n}\,\Gamma(z) = \int_0^\infty t^{z-1} e^{-t} (\ln t)^{n} dt </math>
:<math>\frac{{\rm d}^n}{{\rm d}z^n}\,\Gamma(z) = \int_0^\infty t^{z-1} e^{-t} (\ln t)^{n} dt </math>
第165行: 第148行:


== 解析延拓 ==
== 解析延拓 ==
[[File:Gamma abs.png|缩略图|250px|Γ函數的絕對值函數圖形]]
[[File:Gamma abs.png|thumb|250px|Γ函數的絕對值函數圖形]]
注意到在<math>\Gamma</math>函數的積分定義中若取<math>z \,</math>為實部大於零之[[复数 (数学)|複數]]、則積分存在,而且在右半複平面上定義一個[[全純函數]]。利用函數方程
注意到在<math>\Gamma</math>函數的積分定義中若取<math>z \,</math>為實部大於零之[[复数数学|複數]]、則積分存在,而且在右半複平面上定義一個[[全純函數]]。利用函數方程
: <math>\Gamma(z)\Gamma(1-z)=\frac{\pi}{\sin{\pi z}} \quad (0 < \mathrm{Re}(z) < 1) </math>
: <math>\Gamma(z)\Gamma(1-z)=\frac{\pi}{\sin{\pi z}} \quad (0 < \mathrm{Re}(z) < 1) </math>
並注意到函數<math>\sin (\pi z) \,</math>在整個複平面上有解析延拓,我們可以在<math>\mathrm{Re}(z)<1</math>時設
並注意到函數<math>\sin (\pi z) \,</math>在整個複平面上有解析延拓,我們可以在<math>\mathrm{Re}(z)<1</math>時設
: <math> \Gamma(z) = \dfrac{\pi}{\Gamma(1-z) \sin{\pi z}}</math>
: <math> \Gamma(z) = \dfrac{\pi}{\Gamma(1-z) \sin{\pi z}}</math>
從而將<math>\Gamma \,</math>函數延拓為整個複平面上的[[亞純函數]],它在<math>z=0,-1,-2,-3\cdots</math>有單[[极点 (复分析)|極點]],留數為
從而將<math>\Gamma \,</math>函數延拓為整個複平面上的[[亞純函數]],它在<math>z=0,-1,-2,-3\cdots</math>有單[[极点复分析|極點]],留數為
: <math>\mathrm{Res}(\Gamma, -n) = \dfrac{(-1)^n}{n!} </math>
: <math>\mathrm{Res}(\Gamma, -n) = \dfrac{(-1)^n}{n!} </math>


第176行: 第159行:
許多程式語言或試算表軟體有提供Γ函数或對數的Γ函数,例如EXCEL。而對數的Γ函数還要再取一次自然指數才能獲得Γ函数值。例如在EXCEL中,可使用GAMMALN函数,再用<code><nowiki>EXP[GAMMALN(X)]</nowiki></code>,即可求得任意實数的伽玛函数的值。
許多程式語言或試算表軟體有提供Γ函数或對數的Γ函数,例如EXCEL。而對數的Γ函数還要再取一次自然指數才能獲得Γ函数值。例如在EXCEL中,可使用GAMMALN函数,再用<code><nowiki>EXP[GAMMALN(X)]</nowiki></code>,即可求得任意實数的伽玛函数的值。
* 例如在EXCEL中:<code><nowiki>EXP[GAMMALN(4/3)]</nowiki></code>={{複變運算|gamma(4/3)}}
* 例如在EXCEL中:<code><nowiki>EXP[GAMMALN(4/3)]</nowiki></code>={{複變運算|gamma(4/3)}}
而在沒有提供Γ函数的程式環境中,也能夠過泰勒級數或斯特靈公式等方式來近似,例如Robert H. Windschitl在2002年提出的方法,其在十進制可獲得有效數-{}-字八位數的精確度<ref>{{Cite web |url=http://www.rskey.org/gamma.htm |title=Toth, V. T. ''Programmable Calculators: Calculators and the Gamma Function'' (2006) |accessdate=2018-11-18 |||}}</ref>,已足以填滿[[單精度浮點數]]的二進制有效數-{}-字24位:
而在沒有提供Γ函数的程式環境中,也能夠過泰勒級數或斯特靈公式等方式來近似,例如Robert H. Windschitl在2002年提出的方法,其在十進制可獲得有效數-{}-字八位數的精確度<ref>{{Cite web |url=http://www.rskey.org/gamma.htm |title=Toth, V. T. ''Programmable Calculators: Calculators and the Gamma Function'' (2006) |accessdate=2018-11-18 }}</ref>,已足以填滿[[單精度浮點數]]的二進制有效數-{}-字24位:
:<math>\Gamma(z) \approx \sqrt{\frac{2 \pi}{z} } \left( \frac{z}{e} \sqrt{ z \sinh \frac{1}{z} + \frac{1}{810z^6} } \right)^{z}</math>
:<math>\Gamma(z) \approx \sqrt{\frac{2 \pi}{z} } \left( \frac{z}{e} \sqrt{ z \sinh \frac{1}{z} + \frac{1}{810z^6} } \right)^{z}</math>