Learn / Library / Combinatorics
Capped letter multisets
Build a multiset of size from letter types, using each type at most times. Letters of the same type are identical. How many different multisets are there?
Checking an answer needs JavaScript. The hint and the solution open without it.
Hint
Count all multisets, then remove those where some type appears too often.
Solution
- Without any cap there are multisets.
- A bad multiset has some type used at least times; set those aside, leaving letters to place among types.
- That gives bad multisets per type, so types give .
- No types can both be bad, since that needs letters.
- Subtract: .
Answer: