How many ways can I arrange 5 As, 6 Bs, and 3 Cs

1.2k Views Asked by At

With requirement that $A$ precedes the first $B$ which precedes the first $C$.
Example: $AABABCBBAACBCB$ is correct and $BAAACBAACBCBBBB$ is incorrect.

I am thinking of using permutation, get the total number of ways of arranging them and divide the repeat.

There are $14$ spaces, $5$ ways of placing the first one ($5As$), $10$ ways of placing the second one $4As + 6Bs$, but how many ways to place $3rd$, $4th$ and the rest?

1

There are 1 best solutions below

0
On BEST ANSWER

We first ignore the $A$'s and build the rest of the string. How many ways can we make a string of $6$ $B$'s and $3$ $C$'s such that the first $B$ comes before the first $C$? Well, the first letter has to be a $B$, and then anything goes after that; this gives $\binom{8}{5}$ such strings ($8$ remaining letters to place, $5$ of which are $B$'s and $3$ of which are $C$'s).

Now we want to add $A$'s into this string. Note that the first letter has to be an $A$, and then the other $4$ $A$'s can be placed anywhere in our existing string. If we treat the $B$'s and $C$'s (which we've already fixed) as dividers, we see that this is really a stars-and-bars problem with $6+3+1$ categories (there are $9$ $B$'s and $C$'s, so $10$ "spots" to put $A$'s, including before/after all of them). So the number of ways to put $A$'s into the string is $\binom{9 + 4}{4}$.

Putting these together, the total number of such strings is $\binom{8}{5} \binom{13}{4} = 40040$.