Skip to content

Multinomial ​

The multinomial coefficient (k1+k2+⋯ )!k1! k2!⋯\frac{(k_1 + k_2 + \cdots)!}{k_1!\,k_2!\cdots} generalises Binomial to more than two parts.

✓ checked against that system · ! checked, with disagreements (hover a chip)WikipediaMultinomial theoremMultinomial coefficientMathWorldMultinomialCoefficientWikidataQ20820114Britannicatopic/multinomial-coefficientWolfram LanguageMultinomial!SageMathmultinomial($*,)Juliaenumeratio_multinomial($*,)
Multinomial(k_1, k_2, ...)the multinomial coefficient for parts k1,k2,…k_1, k_2, \ldots
Multinomial(k_1, k_2, …)The multinomial coefficient (k1+k2+⋯ )!k1! k2!⋯\frac{(k_1 + k_2 + \cdots)!}{k_1!\,k_2!\cdots} generalises Binomial to more than two parts.
Typed signatures
TypePackageApplies
(integer+) -> integeranalyticreplaces compute-engineon Around, CenteredInterval, Interval
(integer+) -> integercompute-enginealways
(any*) -> anynumber-theoryreplaces analyticalways

Domain: Combinatorics

Details
  • Counts the ways to split k1+k2+⋯k_1 + k_2 + \cdots labeled items into groups of the given sizes.
  • With two arguments it reduces to Binomial: (k1+k2k1)\binom{k_1+k_2}{k_1}.
  • Orderless: permuting the arguments doesn't change the value.
  • All-zero arguments and a single argument both reduce to the empty product, 1.
  • compute-engine requires all-integer arguments; a list argument is threaded over element-wise, as Wolfram's Listable heads do.

Examples

1 more kept as data, checked against the oracles
Basic #
live ↗
InMultinomial(1,2,1)\mathrm{Multinomial}(1, 2, 1)Out1212
live ↗
InMultinomial(2,3,4)\mathrm{Multinomial}(2, 3, 4)Out1 2601\,260
Scope #

Threads element-wise over a list, as Wolfram's Listable heads do

live ↗
InMultinomial([2,3,5],3)\mathrm{Multinomial}(\bigl\lbrack2, 3, 5\bigr\rbrack, 3)Out[10,20,56]\bigl\lbrack10, 20, 56\bigr\rbrack

Zero parts contribute 0!=10! = 1

live ↗
InMultinomial(0,0,1)\mathrm{Multinomial}(0, 0, 1)Out11

Real arguments evaluate via the Gamma function, Γ(8.2)2! Γ(1.2) 5!\frac{\Gamma(8.2)}{2!\,\Gamma(1.2)\,5!}

live ↗
InMultinomial(2,0.2,5)\mathrm{Multinomial}(2, 0.2, 5)Out34.317 803 519 999 9534.317\,803\,519\,999\,95

Complex arguments evaluate via the Gamma function too

live ↗
InMultinomial(1+i,0.2,4)\mathrm{Multinomial}(1+i, 0.2, 4)Out2.894 060 302 449 624+9.104 625 875 691 285i2.894\,060\,302\,449\,624+9.104\,625\,875\,691\,285i

An Around argument propagates its uncertainty through the head as one function: (a+2)(a+1)2\frac{(a+2)(a+1)}{2} at a=2±0.01a = 2 \pm 0.01 is 6±0.0356 \pm 0.035

live ↗
InMultinomial(Around(2,0.01),2)\mathrm{Multinomial}(\mathrm{Around}(2, 0.01), 2)OutAround(6,0.035)\mathrm{Around}(6, 0.035)
Applications #

The number of distinct letter arrangements of MISSISSIPPI: 1 M, 4 I's, 4 S's, 2 P's

live ↗
InMultinomial(1,4,4,2)\mathrm{Multinomial}(1, 4, 4, 2)Out34 65034\,650

The coefficient of a2b3ca^2 b^3 c in (a+b+c)6(a+b+c)^6

live ↗
InMultinomial(2,3,1)\mathrm{Multinomial}(2, 3, 1)Out6060
Properties #

With two arguments it reduces to Binomial: (n1+n2n1)\binom{n_1+n_2}{n_1}

live ↗
InMultinomial(7,3)=(103)\mathrm{Multinomial}(7, 3)=\binom{10}{3}OutTrue\mathrm{True}

Orderless: permuting the arguments doesn't change the value

live ↗
InMultinomial(1,2,3)=Multinomial(3,1,2)\mathrm{Multinomial}(1, 2, 3)=\mathrm{Multinomial}(3, 1, 2)OutTrue\mathrm{True}

The factorial form (k1+k2+k3)!k1! k2! k3!\frac{(k_1+k_2+k_3)!}{k_1!\,k_2!\,k_3!}. See Factorial

live ↗
InMultinomial(3,4,5)=12!3!×4!×5!\mathrm{Multinomial}(3, 4, 5)=\frac{12!}{3!×4!×5!}OutTrue\mathrm{True}

All-ones parts give n!n!: every part is a single labelled item

live ↗
InMultinomial(1,1,1,1)\mathrm{Multinomial}(1, 1, 1, 1)Out2424
Possible issues #

All-zero arguments still give the empty product, 1

live ↗
InMultinomial(0,0,0)\mathrm{Multinomial}(0, 0, 0)Out11

A single argument is always 1: there's only one way to split n items into one group

live ↗
InMultinomial(5)\mathrm{Multinomial}(5)Out11

With no arguments it is the empty product, 1

live ↗
InMultinomial()\mathrm{Multinomial}()Out11
About
Examples17
Checked againstWolfram Language 16 agree1 differSageMath 13 agree3 errormathlib4 12 agree2 errorJulia 14 agree1 error
CrosswalkWikipedia ×2MathWorldWikidataBritannicaWolfram LanguageSageMathJulia

Implementation

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

Nat.multinomial over the indices of the argument list, so the empty call is 1; natural arguments only.

See also: Binomial, Factorial