Special Functions
The gamma function, beta function, and why they appear everywhere in probability.
Certain functions appear repeatedly in probability and statistics because they arise naturally from integration and combinatorics. The most important is the gamma function, which extends the factorial to non-integers.
The Gamma Function
You know that . But what is ? The gamma function gives us an answer.
Gamma Function
The gamma function is defined for by:
Key Property: Factorial Extension
The gamma function has a remarkable property:
Read: “Gamma of n equals n-minus-one factorial”
For positive integers, gamma gives the factorial shifted by one
This means:
Why the Shift?
The definition uses rather than so that. This is a historical choice that turns out to simplify many formulas. Just remember: gamma of n gives (n-1) factorial.
The Recurrence Relation
The gamma function satisfies a key identity that mirrors the factorial:
Read: “Gamma of x plus one equals x times gamma of x”
Just like (n+1)! = (n+1) × n!, gamma has the same pattern
Using the Recurrence
To find :
Since (a famous result), we can compute .
Special Values
A few gamma function values appear frequently:
| Value | Result | Approximate |
|---|---|---|
| 1.7725 | ||
| 1 | ||
| 0.8862 | ||
| 1 | ||
| 1.3293 |
Why √π?
The value comes from the famous Gaussian integral:
This connects the gamma function to the normal distribution, which is why appears in so many probability formulas.
Explore: The Gamma Function
Visualize how the gamma function extends the factorial to all positive real numbers. Notice how it passes through (n, (n-1)!) for positive integers.
Gamma function value
Γ(3.50) = 3.3234
Nearest factorial
Γ(4) = 3! = 6
Special Values
Γ(1/2)
= √π ≈ 1.7725
Γ(1)
= 0! = 1
Γ(3/2)
= √π/2 ≈ 0.886
Γ(2)
= 1! = 1
The Factorial Connection
The green dots show that Γ(n) = (n-1)! for positive integers. Between the dots, the gamma function smoothly interpolates, giving us a way to compute "factorials" of non-integers like 2.5! = Γ(3.5) ≈ 3.323.
Where Does Gamma Appear?
The gamma function is ubiquitous in probability and statistics because it arises from normalization constants — the factors that make PDFs integrate to 1.
Gamma Distribution
The gamma distribution's PDF contains in the normalization:
Student's t-Distribution
The t-distribution with degrees of freedom:
Beta Distribution
The beta distribution uses the ratio of gamma functions:
Reading Distribution Formulas
When you see in a PDF formula, it's usually there to ensure the density integrates to 1. You rarely need to compute it by hand — statistical software handles it. What matters is recognizing that gamma extends factorial to non-integers.
The Beta Function
Closely related to gamma is the beta function, which appears in the beta distribution and Bayesian statistics.
Beta Function
The beta function is defined as:
The beautiful identity connecting beta and gamma functions lets us convert between them easily. This is why beta distribution formulas contain gamma functions.
Explore: The Beta Function
Visualize B(α, β) as the area under the curve and see how it connects to the beta distribution.
Beta Function Value
B(2.0, 3.0) = 0.08333
= Γ(2.0)·Γ(3.0) / Γ(5.0)
Beta Distribution
Mean: 0.4000= α/(α+β)
Variance: 0.04000
Mode: 0.3333
Shape: Left-skewed (mass toward 0)
Shape Behavior
α < 1: Goes to ∞ as t → 0⁺
α = 1: Finite value at t = 0
α > 1: Goes to 0 as t → 0⁺
β < 1: Goes to ∞ as t → 1⁻
β = 1: Finite value at t = 1
β > 1: Goes to 0 as t → 1⁻
The Beta-Gamma Connection
The beautiful identity B(α, β) = Γ(α)Γ(β)/Γ(α+β) connects the beta function to factorials. The beta distribution (normalized by B(α, β)) is the conjugate prior for Bernoulli/binomial likelihoods in Bayesian statistics.
Key Takeaways
- The gamma function extends factorial to non-integers:
- Key recurrence:
- Special value:
- Gamma appears in normalization constants of many distributions (t, gamma, beta)
- You don't need to compute gamma by hand — just recognize its role in formulas