I don't know why I am having so much trouble with this, but I can't figure it out. I need to determine the number of combinations of a set where the order matters, but the original set has some (not unlimited) repeated elements.
Example: I have a box with 2 yellow, 3 green, 1 red, and 2 blue balls. I want to know how many unique selection orders there are when selecting all 8. So, here are a few choices:
YYGGGRBB YYGGGBRB YYGGGBBR YYGGRGBB ...
The key is that the balls of the same color are not unique, so BRB is the same regardless of which blue ball is taken first, but BBR is different.
Is there a formula for this? I know it's not simply n! or nCr.