({{, (RefLink[Multinomial, paclet:ref/Multinomial])[(Subscript[n, 1]),(Subscript[n, 2]),…]
gives the multinomial coefficient ((Subscript[n, 1])+(Subscript[n, 2])+…)!/((Subscript[n, 1])! (Subscript[n, 2])! …). }})

OpenersNotesSection(Spacer1)Details

Integer mathematical function, suitable for both symbolic and numerical manipulation.

The multinomial coefficient (RefLink[Multinomial, paclet:ref/Multinomial])[(Subscript[n, 1]),(Subscript[n, 2]),…], denoted (N;(Subscript[n, 1]),(Subscript[n, 2]),…,(Subscript[n, m])), gives the number of ways of partitioning N distinct objects into m sets, each of size (Subscript[n, i]) (with N=(∑_(i=1)^m)(Subscript[n, i])).

(RefLink[Multinomial, paclet:ref/Multinomial]) automatically threads over lists.

OpenersPrimaryExamplesSection(Spacer1)Examples  (34)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Compute a multinomial:

Multinomial[1,2,1]

The 1, 2, 1 multinomial coefficient appears as the coefficient of x (y^2) z:

Expand[(x+y+z)^4]

Coefficient[%,x y^2 z]

OpenersExampleSection1(Spacer1)Scope  (18)

OpenersExampleSubsection0(Spacer1)Numerical Evaluation  (4)

Evaluate numerically:

Multinomial[2,.2,5]

N[Multinomial[1/3,1/7,1/5,1/6]]

Evaluate to high precision:

N[Multinomial[1/3,1/11,1/5,1/6],50]

The precision of the output tracks the precision of the input:

Multinomial[2,.22222222222222222222222,5]

Complex number input:

Multinomial[1+I,.2,4]

Evaluate efficiently at high precision:

Multinomial[1,1/7,5`100]//Timing

Multinomial[2,1/7,1/6`1000];//Timing

OpenersExampleSubsection1(Spacer1)Specific Values   (4)

Values of (RefLink[Multinomial, paclet:ref/Multinomial]) at fixed points:

Table[Multinomial[n,2,3],{n,1,5}]

(RefLink[Multinomial, paclet:ref/Multinomial]) for symbolic n:

Multinomial[n,1,2]

Multinomial[1,2,3,n]

Values at zero:

Multinomial[0,0,1]

Multinomial[0,0,0]

Find a value of n for which (RefLink[Multinomial, paclet:ref/Multinomial])[n,1,1]=15:

nval=n/.FindRoot[Multinomial[ n ,1,1]== 15,{n,5}]

Plot[Multinomial[n,1,1],{n,0,5},Epilog->{PointSize[Large],Red,Point[{nval,Multinomial[nval,1,1]}]}]

OpenersExampleSubsection2(Spacer1)Visualization  (2)

Plot the (RefLink[Multinomial, paclet:ref/Multinomial]) as a function of its parameter:

Plot[{Multinomial[n,1,1],Multinomial[n,1,2],Multinomial[n,1,3],Multinomial[n,1,4]},{n,-2,4}]

Plot the real part of 6 (Binomial[x+i y+6, x+i y]):

ContourPlot[Re[Multinomial[5,x+I y,1]],{x,-1,1},{y,-2,2},Contours->20]

Plot the imaginary part of 6 (Binomial[x+i y+6, x+i y]):

ContourPlot[Im[Multinomial[5,x+I y,1]],{x,-1,1},{y,-2,2},Contours->24]

OpenersExampleSubsection3(Spacer1)Function Properties  (4)

The real domain of (RefLink[Multinomial, paclet:ref/Multinomial]) as a function of its last parameter n:

FunctionDomain[Multinomial[2,2,n],n]

The complex domain:

FunctionDomain[Multinomial[z,1,2,2],z,Complexes]

Approximate function range of (RefLink[Multinomial, paclet:ref/Multinomial]):

FunctionRange[Multinomial[x,1,2,2],x,y]

(RefLink[Multinomial, paclet:ref/Multinomial]) has the mirror property:

FullSimplify[Multinomial[Conjugate[z],2,2]==Conjugate[Multinomial[z,2,2]]]

(RefLink[TraditionalForm, paclet:ref/TraditionalForm]) formatting:

Multinomial[n,m,p]//TraditionalForm

OpenersExampleSubsection4(Spacer1)Differentiation  (2)

The first derivative with respect to (Subscript[n, 3]):

D[Multinomial[(Subscript[n, 1]),(Subscript[n, 2]),(Subscript[n, 3])],(Subscript[n, 3])]

Higher derivatives with respect to (Subscript[n, 3]):

Table[D[Multinomial[(Subscript[n, 1]),(Subscript[n, 2]),(Subscript[n, 3])],{(Subscript[n, 3]),k}],{k,1,3}]//FullSimplify

Plot the higher derivatives with respect to (Subscript[n, 3]) when (Subscript[n, 1])=(Subscript[n, 2])=3:

Plot[Evaluate[%/. {(Subscript[n, 1])-> 3,(Subscript[n, 2])-> 3}],{(Subscript[n, 3]),-7,7},PlotLegends->{"First Derivative","Second Derivative","Third Derivative"}]

OpenersExampleSubsection5(Spacer1)Series Expansions  (2)

Find the Taylor expansion using (RefLink[Series, paclet:ref/Series]):

Series[Multinomial[x,y,z],{x,0,3}]//Normal//FullSimplify

Plots of the first three approximations around x=0:

terms=Normal@Table[Series[Multinomial[x,2,1],{x,0,m}],{m,1,3}];
Plot[{terms},{x,-10,10},PlotLegends->"Expressions"]

The Taylor expansion at a generic point:

Series[Multinomial[x,y,z],{x,x0,2}]// FullSimplify

OpenersExampleSection2(Spacer1)Generalizations & Extensions  (1)

(RefLink[Multinomial, paclet:ref/Multinomial]) threads elementwise over lists:

Multinomial[{2,3,5,7,11}, 3,5]

OpenersExampleSection3(Spacer1)Applications  (4)

Illustrate the multinomial theorem:

sum=Sum[KroneckerDelta[4-(n1+n2+n3)]Multinomial[n1,n2,n3]x^n1 y^n2 z^n3 ,{n1,0,4},{n2,0,4},{n3,0,4}]

Factor[sum]

Plot isosurfaces of the number of ways to put (Subscript[n, 1])+(Subscript[n, 2])+(Subscript[n, 3]) elements in three boxes:

ContourPlot3D[Log[Multinomial[n1,n2,n3]] ,{n1,1,6},{n2,1,6},{n3,1,6}]

Multinomial probability distribution:

p[n_,ns_List, θs_List] :=Piecewise[{{(Multinomial@@ns)Apply[Times,θs^ns],Total[ns]==n && Apply[And,Thread[ns≥0]]}}]

ListPlot3D[ Flatten[Table[ {n1,n2,p[20,{n1,n2,20-n1-n2},{0.4,0.3,0.3}]},{n1,0,20},{n2,0,20}],1], PlotRange->All]

Volume of a hyper-super-ellipsoid (∑_(k=1)^d)((|(Subscript[x, k])|)^(Subscript[p, k]))<1 is (2^d)/((∑_(k=1)^d)(Subscript[p, k]^(-1));(Subscript[p, 1]^(-1)),…,(Subscript[p, d]^(-1))):

v1=2^4 /Multinomial[1/4,1/2,1/2,1/2]

Compare with direct integration:

v2=(∫_(-∞)^∞)(∫_(-∞)^∞)(∫_(-∞)^∞)(∫_(-∞)^∞)Boole[(x^4)+(y^2)+(z^2)+(w^2)<1]\[DifferentialD]w\[DifferentialD]z\[DifferentialD]y\[DifferentialD]x

FullSimplify[v1==v2]

OpenersExampleSection4(Spacer1)Properties & Relations  (4)

With two arguments, (RefLink[Multinomial, paclet:ref/Multinomial]) gives binomial coefficients:

Binomial[10,3]

Multinomial[7,3]

Use (RefLink[FullSimplify, paclet:ref/FullSimplify]) to simplify expressions involving multinomial coefficients:

FullSimplify[Multinomial[n1,n2,n3]/Multinomial[n2-1,n1+1,n3]]

Use (RefLink[FunctionExpand, paclet:ref/FunctionExpand]) to expand into (RefLink[Gamma, paclet:ref/Gamma]) functions:

FunctionExpand[Multinomial[n1,n2,n3, n4]]

(RefLink[Multinomial, paclet:ref/Multinomial]) is (RefLink[Orderless, paclet:ref/Orderless]):

Multinomial[b,a,c,d]

OpenersExampleSection5(Spacer1)Possible Issues  (3)

Large arguments can give results too large to be computed explicitly:

Multinomial[10.^16,10.^16,10.^16]

Machine-number inputs can give high-precision results:

Multinomial[10.^6,10.^5,10.^4]

MachineNumberQ[%]

As a multivariate function, (RefLink[Multinomial, paclet:ref/Multinomial]) is not continuous in all variables at negative integers:

Multinomial[-5,3]

Table[Multinomial[-5. + s1 (10^(-12)),3. + s2 (10^(-12))],{s1,{-1,-1/2,1/2,1}},{s2,{-1,-1/2,1/2,1}}]

MatrixPlot[%,ImageSize->Small]

OpenersExampleSection6(Spacer1)Neat Examples  (3)

Trinomials mod 2:

m=Table[Mod[Multinomial[i,j,k],2],{i,0,30},{j,0,30},{k,0,30}];
Graphics3D[Cuboid/@Position[m,1]]

m=Table[Mod[Multinomial[30-i,30-j,30-k],2],{i,0,30},{j,0,30},{k,0,30}];
Graphics3D[Cuboid/@Position[m,1]]

Modulo 3:

m=Table[Mod[Multinomial[i,j,k],3],{i,0,30},{j,0,30},{k,0,30}];
Graphics3D[Cuboid/@Position[m,1]]

Nested multinomials over the complex plane:

DensityPlot[Arg[Nest[Multinomial[#,#]&,x+I y,3]],{x,1/2,5/2},{y,-3/2,3/2},WorkingPrecision->20,PlotPoints->80]

Plot (RefLink[Multinomial, paclet:ref/Multinomial]) for complex arguments:

DensityPlot[Arg[Multinomial[4.1 Exp[I ϕ1],2.2 Exp[I ϕ2]]],{ϕ1,-Pi,Pi},{ϕ2,-Pi,Pi}]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Binomial, paclet:ref/Binomial])  ▪  (RefLink[Factorial, paclet:ref/Factorial])  ▪  (RefLink[Beta, paclet:ref/Beta])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Combinatorial Functions, paclet:tutorial/CombinatorialFunctions])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Combinatorial Functions, paclet:guide/CombinatorialFunctions])}, {▪(RefLinkPlain[Functions Used in Statistics, paclet:guide/FunctionsUsedInStatistics])}, {▪(RefLinkPlain[Integer Functions, paclet:guide/IntegerFunctions])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-MathWorld.png(Spacer1)MathWorld, http://mathworld.wolfram.com/MultinomialCoefficient.html])}, {(WebLink[DocumentationFooterIconsRelatedLinks-Functions.png(Spacer1)The Wolfram Functions Site, http://functions.wolfram.com/GammaBetaErf/Multinomial/])}, {(WebLink[DocumentationFooterIconsRelatedLinks-NKS.png(Spacer1)NKS|Online, http://www.wolframscience.com/nksonline/index/search.cgi?SearchIndex=Multinomial]) ((WebLink[A New Kind of Science, http://www.wolframscience.com/nksonline/]))}})}})