Permutation/Combinations in bit Strings I have a bit string with 10 letters, which can be {a, b, c}. How many bit strings can be made that have exactly 3 a's, or exactly 4 b's?
I thought that it would be C(7,2) + C(6,2), but that's wrong (the answer is 24,600).

First note that
Number of ways of event $A$ or event $B = $ (Number of ways of event $A$) + (Number of ways of event $B$) - (Number of ways of event $A$ and $B$ occurring simultaneously)
In our problem, event $A$ is the number of strings containing exactly $3$ $a$'s and event $B$ is the number of strings containing exactly $4$ $b$'s
We are interested in the number of strings containing exactly $3$ $a$'s and in the number of strings containing exactly $4$ $b$'s.
Number of strings containing exactly $3$ $a$'s is obtained as follows. Of the $10$ letters in our string, if we want exactly $3$ $a$'s, each of the remaining $7$ has $2$ choices, namely, it should be either $b$ or $c$ and hence we have $2^7$ choices for the remaining $7$. Once we have this, we can now arrange them in $\frac{10!}{3! \times 7!}$ ways. Hence, number of ways of this event is $\frac{10!}{3! \times 7!} \times 2^7$.
Similarly, number of strings containing exactly $4$ $b$'s is obtained as follows. Of the $10$ letters in our string, if we want exactly $4$ $b$'s, each of the remaining $6$ has $2$ choices, namely, it should be either $a$ or $c$ and hence we have $2^6$ choices for the remaining $6$. Once we have this, we can now arrange them in $\frac{10!}{4! \times 6!}$ ways. Hence, number of ways of this event is $\frac{10!}{4! \times 6!} \times 2^6$.
Number of strings containing exactly $3$ $a$'s and $4$ $b$'s is $\frac{10!}{3! 4! 3 !}$.
Hence, the total number of strings containing exactly $3$ $a$'s or exactly $4$ $b$'s is $$\frac{10!}{3! \times 7!} \times 2^7 + \frac{10!}{4! \times 6!} \times 2^6 - \frac{10!}{3! 4! 3 !} = 24,600$$
