FIRST TELL ME WHAT is wrong here?
C1 C2 C3 C4
7 0 0 0
0 0 0 7
0 0 7 0
0 6 1 0
As we can see ordering of cakes matter . If ordering did not matter first 3 arrangements should be considered as one .
Ordering means permutation.
First, since you said "I have gone through stars and bars method,", I assumed that you knew how to use it, and perhaps had attempted to do so. You are not using the method, which is the appropriate method. The main thing wrong here is that you are not actually doing anything yet to solve it. What answer did you get your way?
Ordering of types matters, but ordering of individual cakes within a type does not. So you can't use ordinary permutations or combinations directly here.
Here's how the stars and bars method applies here: If we indicate cakes by *, and put them into boxes representing the types, your four examples would be represented by
*******|_______|_______|_______
_______|_______|_______|*******
_______|_______|*******|_______
_______|******_|*______|_______
where | is a divider between boxes.
Ignoring empty space, this is:
*******|||
|||*******
||*******|
|******|*|
So each possibility can be modeled as a permutation of 7 identical *'s and 3 identical |'s. You can also model this as choosing 3 of 10 positions in the line to fill with |, with the rest being *. So you can use either permutations (of a multiset), or combinations to do the calculation, but neither permutations nor combinations of the 7 cakes themselves will work.