[Math] How many words can we build using exactly 5 A’s, 5 B’s and 5 C’s

combinatorics

How many words can we build using exactly 5 A's, 5 B's and 5 C's if the first 5 letters cannot be A's, the second 5 letters cannot be B's and the third 5 letters cannot be C's?
Hint: Group the different ways according to the number of B's in the first group.

Best Answer

Split up in words $w_1$, $w_2$ and $w_3$ consisting each of $5$ letters. The final word of $15$ letters is concatenation $w_1w_2w_3$.

Let $k\in\{0,1,2,3,4,5\}$ denote the number of letters $B$ that are used in $w_1$. Then there are $5-k$ letters $C$ in $w_1$.

The remaining $k$ letters $C$ must be used in $w_2$. Next to them $5-k$ letters $A$ must be used in $w_2$.

Finally $5-k$ letters $B$ and $k$ letters $A$ remain to be used in $w_3$.

For $w_1$ (and also for $w_2$ and $w_3$) there are $\binom5{k}$ possibilities so for the whole word there are $\binom5{k}^3$ possibilities.

So the final answer is:$$\sum_{k=0}^5\binom5{k}^3$$