Skip to content

Beta ​

Euler's beta function B(a,b)=Γ(a)Γ(b)/Γ(a+b)B(a, b) = \Gamma(a)\Gamma(b)/\Gamma(a+b), a bridge between Gamma and Binomial and the normalizing constant behind the beta distribution.

✓ checked against that system · ! checked, with disagreements (hover a chip)WikipediaBeta functionMathWorldBetaFunctionWikidataQ468881Encyclopedia of MathematicsBeta-functionBritannicascience/Euler-beta-functionDLMF5.12.E1FungrimBetaFunction✓Fungrim entryWolfram LanguageBeta✓
Beta(a, b)the Euler beta function B(a,b)B(a, b).
SageMathbeta(a, b)SymPybeta(a, b)mpmathbeta(a, b)Juliaenumeratio_ball((a, b) -> gamma(a) * gamma(b) * rgamma(a + b), a, b)Rustbeta(a, b)
Typed signatures
TypePackageApplies
(complex | infinity, complex | infinity) -> numbercompute-enginealways
(number, number, number?, number?) -> numberanalyticreplaces compute-enginealways

Domain: Special functions

Details
  • Defined via Gamma: B(a,b)=Γ(a) Γ(b)Γ(a+b)B(a, b) = \dfrac{\Gamma(a)\,\Gamma(b)}{\Gamma(a+b)}.
  • Symmetric: B(a,b)=B(b,a)B(a, b) = B(b, a).
  • Integral form: B(a,b)=∫01ta−1(1−t)b−1 dtB(a, b) = \int_0^1 t^{a-1}(1-t)^{b-1}\,dt.
  • Ties to Binomial: B(k+1,n−k+1)=1(n+1)(nk)B(k+1, n-k+1) = \dfrac{1}{(n+1)\binom{n}{k}}.
  • compute-engine evaluates Beta exactly for positive-integer a and b (an exact rational result) and detects the poles at nonpositive integers, returning ComplexInfinity.

Plot

Examples

2 more kept as data, checked against the oracles
Basic #
live ↗
InB(2,3)\mathrm{B}(2, 3)Out112\frac{1}{12}

The unit square case: ∫011 dt=1\int_0^1 1\,dt = 1

live ↗
InB(1,1)\mathrm{B}(1, 1)Out11
live ↗
InB(3,3)\mathrm{B}(3, 3)Out130\frac{1}{30}

Threads element-wise over a list argument

live ↗
InB([1,2],2)\mathrm{B}(\bigl\lbrack1, 2\bigr\rbrack, 2)Out[12,16]\bigl\lbrack\frac{1}{2}, \frac{1}{6}\bigr\rbrack

B(5,4)=4! 3!8!=1280B(5, 4) = \frac{4!\,3!}{8!} = \frac{1}{280}

live ↗
InB(5,4)\mathrm{B}(5, 4)Out1280\frac{1}{280}

Machine-precision arguments

live ↗
InB(2.3,3.2)\mathrm{B}(2.3, 3.2)Out0.054 029 791 748 357 237 815 40.054\,029\,791\,748\,357\,237\,815\,4

Half-integer arguments evaluate exactly through Γ(m+12)=(2m)!4mm!π\Gamma(m + \tfrac12) = \frac{(2m)!}{4^m m!}\sqrt{\pi}. Compare Binomial at half-integers

live ↗
InB(92,72)\mathrm{B}(\frac{9}{2}, \frac{7}{2})Out5π2 048\frac{5π}{2\,048}

B(5/2,7/2)=3π256B(5/2, 7/2) = \frac{3\pi}{256} from the half-integer gammas

live ↗
InB(52,72)\mathrm{B}(\frac{5}{2}, \frac{7}{2})Out3π256\frac{3π}{256}

Inexact complex arguments evaluate numerically, through ln⁡Γ\ln\Gamma

live ↗
InB(2.5+i,1−i)\mathrm{B}(2.5+i, 1-i)Out0.083 107 783 669 911 63+0.142 163 944 255 870 34i0.083\,107\,783\,669\,911\,63+0.142\,163\,944\,255\,870\,34i

Three arguments: the incomplete beta Bz(a,b)=∫0zta−1(1−t)b−1 dtB_z(a, b) = \int_0^z t^{a-1}(1-t)^{b-1}\,dt, here B1/2(2,3)=11/192B_{1/2}(2, 3) = 11/192

live ↗
InB(12,2,3)\mathrm{B}(\frac{1}{2}, 2, 3)Out11192\frac{11}{192}

Four arguments: the generalized incomplete beta Bz1(a,b)−Bz0(a,b)B_{z_1}(a, b) - B_{z_0}(a, b), here ∫1/41/2t(1−t)2 dt=109/3072\int_{1/4}^{1/2} t(1-t)^2\,dt = 109/3072

live ↗
InB(14,12,2,3)\mathrm{B}(\frac{1}{4}, \frac{1}{2}, 2, 3)Out1093 072\frac{109}{3\,072}

To 30 significant digits, every one correctly rounded

live ↗
InN(B(13,14),30)N(\mathrm{B}(\frac{1}{3}, \frac{1}{4}), 30)Out6.353 586 485 553 421 530 528 788 972 026.353\,586\,485\,553\,421\,530\,528\,788\,972\,02

B(1/2,1/2)=πB(1/2, 1/2) = \pi underlies the arcsine distribution's normalizing constant

live ↗
InB(0.5,0.5)\mathrm{B}(0.5, 0.5)Out3.141 592 653 589 793 238 463.141\,592\,653\,589\,793\,238\,46

Symmetric: B(a,b)=B(b,a)B(a, b) = B(b, a)

live ↗
InB(2,5)=B(5,2)\mathrm{B}(2, 5)=\mathrm{B}(5, 2)OutTrue\mathrm{True}

Ties to Binomial: B(k+1,n−k+1)=1(n+1)(nk)B(k+1, n-k+1) = \frac{1}{(n+1)\binom{n}{k}}, here at n=8,k=3n=8, k=3. See Binomial

live ↗
In9B(4,6)(83)=19\mathrm{B}(4, 6)\binom{8}{3}=1OutTrue\mathrm{True}

B(a,1)=1/aB(a, 1) = 1/a for symbolic aa

live ↗
InB(a,1)\mathrm{B}(a, 1)Out1a\frac{1}{a}

B(2,b)=1b(b+1)B(2, b) = \frac{1}{b(b+1)}; Wolfram leaves this to FunctionExpand

live ↗
InB(2,b)\mathrm{B}(2, b)Out1b×(b+1)\frac{1}{b×(b+1)}

∂aB(a,b)=B(a,b) (ψ(a)−ψ(a+b))\partial_a B(a, b) = B(a, b)\,(\psi(a) - \psi(a+b))

live ↗
IndB(a,b)da\frac{\mathrm{d}\mathrm{B}(a, b)}{\mathrm{d}a}Out(Digamma(a)−Digamma(a+b))B(a,b)(\mathrm{Digamma}(a)-\mathrm{Digamma}(a+b))\mathrm{B}(a, b)

A nonpositive-integer argument is a pole of the underlying Gamma functions, so compute-engine returns ComplexInfinity rather than leaving it unevaluated. See Gamma

live ↗
InB(−1,2)\mathrm{B}(-1, 2)Out∞~\tilde∞
Properties #
live ↗
InB(12,12)B(1,12)\mathrm{B}(\frac{1}{2}, \frac{1}{2})\mathrm{B}(1, \frac{1}{2})Out2π2π

Known value · Wolfram MathematicalFunctionData, Beta, FunctionalEquations

live ↗
InB(12,12)B(1,2)\mathrm{B}(\frac{1}{2}, \frac{1}{2})\mathrm{B}(1, 2)Outπ2\frac{π}{2}

Known value · Wolfram MathematicalFunctionData, Beta, FunctionalEquations

Possible issues #

B(∞,0)=Γ(∞)Γ(0)/Γ(∞)B(\infty, 0) = \Gamma(\infty)\Gamma(0)/\Gamma(\infty) — the Γ(a)\Gamma(a) cancels identically for any finite aa and stays cancelled as a→∞a\to\infty (Γ smooth and nonzero out there), leaving the lone Γ(0)\Gamma(0): a simple pole, ComplexInfinity, not a double one

live ↗
InB(∞,0)\mathrm{B}(∞, 0)Out∞~\tilde∞
About
Examples24
Checked againstWolfram Language 23 agreeSageMath 18 agree1 differ2 errorSymPy 19 agree2 differmpmath 19 agree2 differJulia 19 agree2 errorRust 14 agree2 error
CrosswalkWikipediaMathWorldWikidataEncyclopedia of MathematicsBritannicaDLMFFungrimFungrim entry ×11Wolfram LanguageSageMathSymPympmath ×3Julia ×3Rust

Implementation

mappedsympypackages/oracle/src/mappings.ts
mappedmpmathpackages/oracle/src/mappings.ts
mappedmpmathpackages/oracle/src/mappings.ts

Incomplete beta B(z; a, b), the integral from 0 to z.

mappedmpmathpackages/oracle/src/mappings.ts

Generalized incomplete beta, the integral from z0 to z1.

mappedsagepackages/oracle/src/mappings.ts
mappedjuliapackages/oracle/src/mappings.ts
mappedjuliapackages/oracle/src/mappings.ts
mappedjuliapackages/oracle/src/mappings.ts
mappedrustpackages/oracle/src/mappings.ts

a, b > 0 only.

See also: Gamma, Binomial, BetaRegularized