I am trying to find the total number of signals that can be created from $3$ pink, $3$ white and $2$ black flags when arranged in a straight line. But, only $5$ flags are allowed in a signal.
I know how to find permutations in this situation when all are taken at a time i.e. a signal has $8$ flags, which would be $\frac{8!}{3! \cdot 3! \cdot 2!}$, but cannot see how to start solving a scenario where all are not taken at the same time.
Formula when all are taken at a time with some like objects
$$\frac{n!}{a! \cdot b! \cdot c! \cdot d!...}$$
Question
Is there a modified formula that will give permutations of $n$ objects taken $r$ at a time when some of these objects are alike and $r < n$?