In general I think I understand permutations fairly well. A simple example of permutations is drawing balls from an urn. I have 3 colors of balls, blue, green, and red, and I have 5 balls of each.
How many color patterns of balls can be drawn from the urn ? In this case the order of the color matters, but all balls of a single color are the same.
Answer: Simple, this is 3 * 3 * 3 * 3 * 3 = 243
Now Here Is The Real Question
What happens if I have fewer balls of each color than I will be drawing. What if I have 3 balls of each color, and want to draw 5 balls ?
Clearly the answer is fewer than 243, because some of the previous options are not available. But what is the equation? And more importantly, can it be generalized to a larger problem so if I had 30 balls of each color, and wanted to draw 50 balls total, I wouldn't have to do something like calculate the full set of permutations, and the subtract out the permutations where I have 31 of a color, and 32 of a color, etc