How many different combinations of $X$ sweaters can we buy if we have $Y$ colors to choose from? 
How many different combinations of $X$ sweaters can we buy if we have
  $Y$ colors to choose from?

According to my teacher the right way to think about this problem is to think of partitioning $X$ identical objects (sweaters) into $Y$ different categories (colors).
Well,this idea however yields the right answer but I just couldn't convince my self about this way to thinking,to be precise I couldn't link the wording of the problem to this approach,could any body throw some more light on this?

The classical solution to this problem is as follows:
Order the $Y$ colors.  Write $n_1$ zeroes if there are $n_1$ sweater of the first color.  Write a single one.  Write $n_2$ zeroes where $n_2$ is the number of sweaters of the second color.  Write a single one, and so on.
You get a string of length $X+Y-1$ that has exactly $X$ zeroes and $Y-1$ ones.
The map that I have described above is a 1-1 correspondence between number of different combinations of $X$ sweaters with $Y$ colors and the set of such binary strings.  Now, each string is uniquely determined by the positions of the ones in the string.  How many ways are there to place $Y-1$ ones in an array of length $X+Y-1$?
Does this help?  

Edit:  With my reasoning, you arrive exactly at Brian Scott's formula.  He uses bars where I have ones and stars where I have zeroes. 
