Multichoose

Author

Eric W. Weisstein
January 3, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Combinatorics/Multichoose.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Multichoose.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Code

Multisets[l_List,k_]:=Union[Sort/@Flatten[Outer[List,Sequence@@Table[l,{k}]],k-1]]
Multisets[n_,k_]:=Multisets[Range[n],k]

Special Cases

FullSimplify[FunctionExpand[Multinomial[m,n]]/.Gamma[x_]:>(x-1)!]

FunctionExpand[Binomial[m+n,n]]/.Gamma[x_]:>(x-1)!

FunctionExpand[Binomial[m+n,m]]/.Gamma[x_]:>(x-1)!

Examples

Multisets[{a,b,c},2]

Multinomial[3-1,2]

Tables

Table[Length[Multisets[n,k]],{k,5},{n,5}] //TableForm

Table[Binomial[n+k-1,k],{k,5},{n,5}] //TableForm

Table[Multinomial[n-1,k],{k,5},{n,5}] //TableForm