Using letters $(a,b,c,d,e)$ how many distinct $n$ length words can be formed ? Note that every word can contain same letter $m$ times at most.
For: $n=3, m=2 $ $$Answer=5∗5∗5−5=120$$ (all combinations except $aaa,bbb,ccc,ddd,eee$).
Using letters $(a,b,c,d,e)$ how many distinct $n$ length words can be formed ? Note that every word can contain same letter $m$ times at most.
For: $n=3, m=2 $ $$Answer=5∗5∗5−5=120$$ (all combinations except $aaa,bbb,ccc,ddd,eee$).
This is equivalent to asking about the number of partitions of $\{1,\dots,n\}$ to at most $5$ parts (assuming your alphabet is of size $5$), where each size is of size at most $m$. See here: