# How many ways are there to have a collection of $10$ fruits

+I am just getting started in my combinatorics class and I came across the following problem in my textbook that I am looking for some help with, thanks!

How many ways are there to have a collection of $10$ fruits from a large pile of identical oranges, apples, peaches, bananas and pears if the collection should include exactly two kinds of fruits?

Since the order is not important here we can systematically list the different combinations to see the different combinations.

How can I use this equation which I believe is the equation I need

$$C(n,r) = \frac{n!}{(n-r)!r!}$$

To choose $2$ kinds of fruits from five, you have $C(5,2)=10$ choices.

Since the numbers of the two fruits may be $(1,9), (2,8), (3,7), \dots (9,1)$, there are $9$ possibilities.

The total number of ways is $10\times 9=90$.

• okay so $C(5,2) = \frac{5!}{(5-2)!2!} = 10$? – user123 Feb 2 '18 at 15:11
• Yes. It is equal to $\frac{5\times4\times3\times2\times1}{3\times2\times1\times2\times1}=10$. – CY Aries Feb 2 '18 at 15:16

Since your collection needs to include exactly $2$ kinds of fruits, this means that you have $C(5,2)$ possible choice for the fruits that will be part of your collection. Recall that $C(5,2)$ means that you pick two kind of fruits out of $5$ possible choices. But this doesn't take into account all possible collections since you don't know how many of each fruits you have. But you know that if you have $r$ fruits of kind $A$, you have $10-r$ fruits of kind $B$. Since you want two kind of fruits, it means that $r$ ranges from $1$ to $9$. Therefore, you have $C(5,2) \times 9 = 10 \times 9 = 90$ possibilities.

First select any two kinds of fruits from the given 5 kinds of fruits. Number of ways to do so is $\binom {5}{2}$

Now using the star and bars method we have to find the positive integral solutions of the equation $$a+b=10$$

Which are simply $\binom {9}{1}$

Hence the answer would simply be $$\binom {5}{2}\binom {9}{1}=90$$