Combinatorics & Counting


Shared context
A multiset is unordered; repetitions are allowed, and its size counts repetitions. Elements are chosen from n distinct types.
Answer & solution
Answer: n·C(n−1,2)+C(n,2)=n(n−1)²/2. (no official key was published)
1. The only multiplicity partitions of 4 containing a part equal to 2 are 2+1+1 and 2+2. The patterns 4, 3+1 and 1+1+1+1 do not qualify.
2. For 2+1+1 choose the repeated type in n ways and the two distinct singleton types in C(n−1,2) ways. The singleton order is irrelevant.
3. For 2+2 choose the two doubled types as an unordered pair: C(n,2). Do not designate one as the repeated type, which would double-count this case.
4. Add the disjoint cases to obtain n(n−1)(n−2)/2+n(n−1)/2=n(n−1)²/2. This is zero for n=1 and equals one for n=2, as direct enumeration confirms.