.
The problem asks about the number of different color combinations.
It means that we distinct the balls only due to their colors -
- the balls with identical color are indistinguishable.
So, the math model is the set of all possible 3-letter words written
using the alphabet consisting of 3 letter
R (symbolizing red color),
Y ( yellow color) and
B ( blue color)
with the restriction that the letter B can be used not more than once in each word.
+---------------------------------------------------------------------+
| First consider the case when B is used exactly once in the words. |
+---------------------------------------------------------------------+
If the order of colors is important, then the number of such words
(different color combinations) with one B is 3*X*Z,
where X can be any of R or Y, without restrictions
and Z can be any of R or Y, without restrictions.
The factor 3 symbolize that "B" may stand in any of three position in the word.
So, the number of such words (different color combinations) with one B is 3*2*2 = 12,
if the order of colors is important.
If the order of colors is not important, then all possible color combinations with one B are
BRR, BRY, BYY, giving only 3 combinations.
+------------------------------------------------------------+
| Next consider the case when B is NOT used in the words. |
+------------------------------------------------------------+
Then, if the order of colors is important, we can have any of two remaining colors
in each position, giving 2*3 = 6 different color combinations.
If the order of colors is not important, then we have these combinations
RRR, RRY, RYY, YYY, giving 4 possible color combinations.
ANSWER. The number of all different color combinations is
12 + 6 = 18, if the order is important;
3 + 4 = 7, if the order is not important.
Solved.