If M is a finite multiset, then a multiset permutation is an ordered arrangement of elements of M in which each element appears a number of times equal exactly to its multiplicity in M. An anagram of a word having some repeated letters is an example of a multiset permutation. If the multiplicities of the elements of M (taken in some order) are m1,m2,...,ml and their sum (that is, the size of M) is n, then the number of multiset permutations of M is given by the multinomial coefficient,
(m1,m2,…,mln)=m1!m2!⋯ml!n!=∏i=1lmi!(∑i=1lmi)!.
In our case, the number of ternary strings of length 15 are there containing exactly four 0s, five 1s, and six 2s is
4!5!6!15!=(2⋅3⋅4)(2⋅3⋅4⋅5)15⋅14⋅13⋅12⋅11⋅10⋅9⋅8⋅7=630,630
Comments