There are $3$ black, $2$ green, and $1$ red ball in the basket. How many ways there is to pick up $4$ balls from that basket?
I know the answer is $5$. I solved this problem using generating function but I want to have a closed-form solution. Primarily I thought the answer is $$\frac{3+2+1\choose4}{3!\cdot2!\cdot1!}$$ but after writing down all possible sets of four balls, these two results were different. In fact, I don't understand why this way of thinking gives wrong result.
Case 1) If 3 balls are alike:
Then number of ways = $\binom {2}{1}$
Case 2) If 2 balls are alike, and other two balls are also alike:
then number of ways =$\binom {2}{2}$
Case 3) If 2 balls are alike and other two balls are different :
Then number of ways =$\binom {2}{1}$
Hence total number of ways = $\binom {2}{1}+\binom {2}{2}+\binom {2}{1}=5$