you could have 12 marbles of all the same colour
12
or 2 colours, 11 of 1 colour and 1 of the other, 10 of 1 colour and 2 of the other..
11 : 1
10 : 2
9 : 3
8 : 4
7 : 5
6 : 6
5 : 7
4 : 8
3 : 9
2 : 10
1 : 11
Now we move on to 3 colours
10 : 1 : 1
9 : 1 : 2
9 : 2 : 1
8 : 1 : 3
8 : 3 : 1
7 : 1 : 4
7 : 4 : 1
6 : 1 : 5
6 : 5 : 1
5 : 1 : 6
5 : 6 : 1
4 : 7 : 1
4 : 1 : 7
3 : 1 : 8
3 : 8 : 1
2 : 9 : 1
2 : 1 : 9
1 : 1 : 10
1 : 10 : 1
4 colours...
9 : 1 : 1 : 1
8 : 1 : 1 : 2
8 : 1 : 2 : 1
8 : 2 : 1 : 1
7 : 1 : 1 : 3
7 : 1 : 3 : 1
7 : 3 : 1 : 1
6 : 1 : 1 : 4
6 : 1 : 4 : 1
6 : 4 : 1 : 1
5 : 1 : 1 : 5
5 : 1 : 5 : 1
5 : 5 : 1 : 1
4 : 1 : 1 : 6
4 : 1 : 6 : 1
4 : 6 : 1 : 1
3 : 1 : 1 : 7
3 : 1 : 7 : 1
3 : 7 : 1 : 1
2 : 1 : 1 : 8
2 : 1 : 8 : 1
2 : 8 : 1 : 1
1 : 1 : 1 : 9
1 : 1 : 9 : 1
1 : 9 : 1 : 1
We could continue in this way but if we look, we can see that with just one colour we have just the one combination, two colours has 12 combinations, three has 19 combinations and if we counted the rest we would see a pattern emerge. From this we can say that;
n = (c - 1) * (12 - c) + 1
where c is the number of different colours and n is the number of combinations. Thus;
if we have just one colour
n = (1 - 1) * (12 - 1) + 1
n = 0 * 11 + 1
n = 1
two colours
n = (2 - 1) * (12 - 1) + 1
n = 1 * 11 + 1
n = 12
three colours
n = (3 - 1) * (12 - 3) + 1
n = 19
four colours
n = (4 - 1) * (12 - 4) + 1
n = 25