Binomial
The binomial coefficient , the number of k-element subsets of an n-element set.
Binomial coefficientMathWorldBinomialCoefficientWikidataQ209875Encyclopedia of MathematicsBinomial_coefficientsBritannicatopic/binomial-coefficientDLMF26.31.2.iFungrimBinomial✓Fungrim entryOEISA073354Wolfram LanguageBinomial!Binomial(n, k)the binomial coefficient .binomial(n, k)!SymPybinomial(n, k)Oscarbinomial(ZZ(n), ZZ(k))Juliabinomial(ZZ(n), ZZ(k))Rustbinomial(n, k)Typed signatures
| Type | Package | Applies |
|---|---|---|
(complex | infinity, complex | infinity) -> number | analyticreplaces compute-engine | always |
(complex | infinity, complex | infinity) -> number | compute-engine | always |
(complex | infinity, complex | infinity) -> number | number-theoryreplaces analytic | always |
Details
- The general definition runs through the Gamma function: .
- Symmetric in its arguments: .
- Pascal's rule builds each row from the last: .
- Row sums give .
- compute-engine evaluates only integer n and k: k outside gives 0 for nonnegative n, while a negative n switches to the generalized falling-factorial formula rather than the Gamma form.
- A Gaussian or otherwise complex n and/or k also evaluates, through the same Gamma-function identity: exact for an integer k, numeric otherwise.
Examples
15 more kept as data, checked against the oraclesScope #
Half-integer arguments evaluate exactly through the Gamma function: here , so the answer is just
live ↗Applications #
Properties #
Possible issues #
About
| Examples | 55 |
|---|---|
| Checked against | Wolfram Language 53 agree1 differSageMath 38 agree2 differ2 errorSymPy 47 agree5 differ2 unevaluatedmathlib4 14 agree18 errorOscar 26 agree2 differ8 errorJulia 17 agree3 differ7 errorRust 16 agree13 differ7 error |
| Crosswalk | WikipediaMathWorldWikidataEncyclopedia of MathematicsBritannicaDLMF ×2FungrimFungrim entry ×23OEISWolfram LanguageSageMathSymPyOscarJuliaRust |
Implementation
wolframpackages/oracle/src/mappings.tsWolfram's (and compute-engine's) Binomial extends to negative n and k via the reflection identities in its docs (e.g. Binomial[5,-2] = 0, Binomial[-7,2] = 28, Binomial[-5,-7] = 15); the crates behind sage/oscar/julia/rust bottom out at unsigned or non-negative-only integer types and diverge there — a convention gap, not a bug on either side. Verified against wolframscript.
sympypackages/oracle/src/mappings.tsWolfram's (and compute-engine's) Binomial extends to negative n and k via the reflection identities in its docs (e.g. Binomial[5,-2] = 0, Binomial[-7,2] = 28, Binomial[-5,-7] = 15); the crates behind sage/oscar/julia/rust bottom out at unsigned or non-negative-only integer types and diverge there — a convention gap, not a bug on either side. Verified against wolframscript.
sagepackages/oracle/src/mappings.tsWolfram's (and compute-engine's) Binomial extends to negative n and k via the reflection identities in its docs (e.g. Binomial[5,-2] = 0, Binomial[-7,2] = 28, Binomial[-5,-7] = 15); the crates behind sage/oscar/julia/rust bottom out at unsigned or non-negative-only integer types and diverge there — a convention gap, not a bug on either side. Verified against wolframscript.
oscarpackages/oracle/src/mappings.tsWolfram's (and compute-engine's) Binomial extends to negative n and k via the reflection identities in its docs (e.g. Binomial[5,-2] = 0, Binomial[-7,2] = 28, Binomial[-5,-7] = 15); the crates behind sage/oscar/julia/rust bottom out at unsigned or non-negative-only integer types and diverge there — a convention gap, not a bug on either side. Verified against wolframscript.
juliapackages/oracle/src/mappings.tsWolfram's (and compute-engine's) Binomial extends to negative n and k via the reflection identities in its docs (e.g. Binomial[5,-2] = 0, Binomial[-7,2] = 28, Binomial[-5,-7] = 15); the crates behind sage/oscar/julia/rust bottom out at unsigned or non-negative-only integer types and diverge there — a convention gap, not a bug on either side. Verified against wolframscript.
mathlib4packages/oracle/src/mappings.tsWolfram's (and compute-engine's) Binomial extends to negative n and k via the reflection identities in its docs (e.g. Binomial[5,-2] = 0, Binomial[-7,2] = 28, Binomial[-5,-7] = 15); the crates behind sage/oscar/julia/rust bottom out at unsigned or non-negative-only integer types and diverge there — a convention gap, not a bug on either side. Verified against wolframscript.
rustpackages/oracle/src/mappings.tsWolfram's (and compute-engine's) Binomial extends to negative n and k via the reflection identities in its docs (e.g. Binomial[5,-2] = 0, Binomial[-7,2] = 28, Binomial[-5,-7] = 15); the crates behind sage/oscar/julia/rust bottom out at unsigned or non-negative-only integer types and diverge there — a convention gap, not a bug on either side. Verified against wolframscript.
See also: Factorial, Multinomial, Pochhammer