Quant Memo
Advanced

The Gamma and Beta Functions

Two special functions that extend factorials to non-integer numbers and describe areas under flexible, bounded shapes — the quiet machinery behind the t, chi-squared, F, and beta distributions used throughout statistics.

Factorials like 5!=5×4×3×2×15! = 5\times4\times3\times2\times1 only make sense for whole numbers — there's no obvious way to compute "3.5 factorial" by repeated multiplication. The gamma function, Γ(n)=0xn1exdx\Gamma(n) = \int_0^\infty x^{n-1} e^{-x}\, dx, fixes this by defining a smooth curve that agrees with (n1)!(n-1)! at every whole number (Γ(n)=(n1)!\Gamma(n) = (n-1)! for integers) but is also defined everywhere in between and for most other real and complex numbers. In plain English: it's the natural, unique way to "connect the dots" between factorial values with a smooth curve, and it shows up automatically in the formulas for the chi-squared, t, gamma, and Dirichlet distributions precisely because those distributions are built from sums and ratios of things that behave like factorials.

The beta function, B(a,b)=01xa1(1x)b1dxB(a,b) = \int_0^1 x^{a-1}(1-x)^{b-1}\, dx, is a close cousin that measures area under a flexible bump shape confined to the interval [0,1][0,1], and it relates back to gamma through B(a,b)=Γ(a)Γ(b)Γ(a+b)B(a,b) = \frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}. In plain English: any time you're working with a quantity naturally bounded between 0 and 1 — a probability, a proportion, a win rate — the beta function is what normalizes the shape of the beta distribution used to model it, which is why it's the standard Bayesian prior for a probability parameter.

A quant rarely computes either integral by hand; the value comes from recognizing them by sight inside a distribution's formula, since both are the normalizing constants that make a probability density integrate to exactly one.

The gamma function extends factorials to non-integer inputs, and the beta function measures area under bump shapes on [0,1][0,1] using a ratio of gamma functions — together they are the normalizing machinery behind nearly every classical statistical distribution used in inference.

Related concepts

Practice in interviews

Further reading

  • Casella & Berger, Statistical Inference, ch. 3
ShareTwitterLinkedIn