Combinations for the selection of 10 pens I have a problem I'm not so sure how to solve. Here's what it says: 
A man needs to buy 10 pens at a store, there are 4 different brands W,X,Y and Z of blue pens, the pens that belong to each brand are identical, meaning that two pens from X are identical, two of Y are identical and so forth. 
How many ways can the man buy 10 pens if the store only has 3 pens available of brand X?
I'm not sure what to do I've thought about it for a while and I was thinking about using the addition rule for the cases in which 1,2 and 3 pens of X were selected. However I'm not sure if I should use inclusion-exclusion, given that the events of choosing an pen of X are not disjoint. 
 A: Sounds like a stars-and-bars problem. 
If pens are indicated by stars (*) and different types are separated by bars (|) then we have 
$$\underbrace{****}_W\big|\underbrace{***}_X\big|\underbrace{**}_Y\big|\underbrace{*}_Z$$
as a possible combination. Shifting the bars around gives different number of pens of brand $W, X, Y, Z$. Assuming it's possible to have none from a particular brand, it would be possible to have two or more bars next to each other. 
Note that there are 10 stars representing the 10 pens, but only 3 bars (and not 4) to separate the 4 different brands. The total number of positions occupied by the stars and bars is $10+3=13$.
The total number of combinations is therefore the same as picking 3 positions out of 13 to place the bars, i.e.
$$\binom{10+3}3=\binom {13}3=286$$
This is if there are no restrictions on the number of any brand. 
Given that there is a limit on brand $X$, we isolate that by choosing pens from brand $X$ first. 
If we choose $r (0\le r\le 3)$ pens from brand $X$, that leaves $(10-r)$ pens to be chosen from $3$ other brands, i.e. only $2$ bars required. Therefore, the number of combinations is 
$$\sum_{r=0}^3\binom{10-r+2}2 =\binom {12}2+\binom {11}2+\binom{10}2+\binom 92=\color{red}{202}$$
A: The boy can go on saying $yes, yes, yes....$ until he gets the desired number of that type and then say $no$ and move on to the next type. For type Z he can just go on saying yes until 10 yeses reached, there is no need to say $no$.
The only question is how to arrange the 10 yeses and 3 noes which is ${13\choose 3}$
To exclude > 3 pens of type X, imagine 4 such have already been chosen and we need only 6 more, so following the same procedure, there will be ${9\choose 3}$ cases which we need to subtract.
$${13\choose 3} - {9\choose 3} = 202$$ 
