透過 MCP 連接 →

輸入計算

數學公式

廣告

結果

Gamma 函數值
3.32335097044784
Γ(a) for a = 3.5
參數 a 3.5
Γ(a) 3.32335097044784
計算方法 Lanczos 近似法(g = 7)

什麼是 Gamma 函數?

Gamma 函數寫作 \(\Gamma(a)\),是階乘在實數(乃至複數)上的連續延伸。對於正整數 n,它滿足 \(\Gamma(n) = (n-1)!\),因此 \(\Gamma(5) = 4! = 24\)。當實數參數 a 的實部為正時,它由瑕積分定義:$$\Gamma\!\left(a\right) = \int_{0}^{\infty} t^{\,a - 1}\, e^{-t}\, dt$$本計算機可回傳您輸入的任意實數 a 所對應的 \(\Gamma(a)\) 值。

Smooth curve of the Gamma function plotted against the argument a, showing factorial-like growth and poles at non-positive integers
The Gamma function Γ(a) extends the factorial to non-integer arguments, with poles at 0 and negative integers.

如何使用本計算機

在「變數 a」欄位輸入實數參數 a,並選擇要顯示的小數位數。被積函數 \(t^{a-1}e^{-t}\) 以及 0 到無限大的積分上下限都由定義固定,因此您只需提供 a 即可。計算機會回傳 \(\Gamma(a)\)。若您輸入 a = 0 或負整數,結果會顯示「未定義」,因為 Gamma 函數在這些點上有極點。

公式解析

計算機並非每次都進行數值積分,而是採用 Lanczos 近似法(g = 7,九個係數),可將積分值重現到約 15 位有效數字。當 \(a \le 0.5\) 時,會先套用反射公式 \(\Gamma(a)\cdot\Gamma(1-a) = \pi/\sin(\pi a)\),將參數映射到數值穩定的區間,並能算出非整數負參數處的有限值(有時為負值)。

Shaded area under the curve of the integrand t to the power a minus 1 times e to the minus t from zero to infinity
Γ(a) equals the area under the integrand tᵃ⁻¹e⁻ᵗ from 0 to infinity.

範例演算

以 a = 3.5 為例。利用遞迴關係式 \(\Gamma(a) = (a-1)\cdot\Gamma(a-1)\):$$\Gamma(3.5) = 2.5 \cdot 1.5 \cdot 0.5 \cdot \Gamma(0.5) = 1.875 \cdot \sqrt{\pi} = 1.875 \cdot 1.7724538509 \approx 3.3233509704$$計算機會回傳相同的結果。

常見問題

為什麼 \(\Gamma(0)\) 是未定義的?該積分發散,且函數在 0 以及每一個負整數處都有一個簡單極點,因此其值為無限大。

\(\Gamma(0.5)\) 是多少?恰好等於 \(\sqrt{\pi} \approx 1.7724538509\),這是與高斯積分相關的著名結果。

計算結果有多精確?對於一般參數而言,Lanczos 近似法可達約 15 位數字的精度,對幾乎所有應用來說都綽綽有餘。

最後更新: