# In how many ways can $4$ same oranges and $6$ different apples be distributed to $5$ distinct boxes?

If we have $4$ same oranges and $6$ different apples. In how many ways could we distribute them in $5$ different boxes?

I have thought the first part of this problem as saying that the $4$ same oranges have $C(8,4)= 70$ ways of being distributed in $5$ different boxes (using the $C(n+k-1,k)$ formula). But for the $6$ different apples I cannot understand if I should use the $$n^{k}=5^{6}$$ formula or the $$\frac{(n+k-1)!}{(n-1)!}$$ formula where $k$ are the apples and $n$ are the boxes. I know the final answer will be the product of $C(8,4)$ and whatever the answer about the apples is, but I am not sure about the formula. If it is the first, why wouldn't the second one work?

There is an extra question, which asks what percentage of the above describes the ways where $2$ exactly fruits are placed in each box. I have thought the answer might be $5! C(9,5)$, because the ways of distributing the first $5$ fruits are $5!$ and the ways of distributing the rest in $5$ different boxes are $C(n+k-1,k)$. Am I correct to assume that? I have also thought the formula $C(n-1,k-1)$ because the $C(n+k-1,k)$ does not give one apple to each $5$ necessarily.

In how many ways can $4$ indistinguishable oranges and $6$ different apples be placed in $5$ distinct boxes?

You correctly found that $4$ indistinguishable oranges can be placed in $5$ distinct boxes in $$\binom{4 + 5 - 1}{5 - 1} = \binom{8}{4}$$ ways. Since there are five ways each of the six apples can be placed in a box, there are $5^6$ ways to distribute the apples. Hence, the number of possible distributions is $$5^6\binom{8}{4}$$

As for the other formula you considered, if you wanted to arrange four indistinguishable dividers and six different apples in a row, you could choose four of the ten positions for the dividers in $\binom{10}{4}$ ways, then arrange the six apples in the six remaining positions in $6!$ ways, which yields $$\binom{10}{4}6! = \frac{10!}{4!6!} \cdot 6! = \frac{10!}{4!} = \frac{(6 + 5 - 1)!}{(5 - 1)!}$$ However, we do not care about the order of the apples within each box, so this formula yields too large a number for the number of ways of distributing the apples.

In how many ways can $4$ indistinguishable oranges and $6$ different apples be placed in $5$ distinct so that there are two pieces of fruit in each box?

The restriction that exactly two pieces of fruit are placed in each box means that we have three cases to consider:

1. Two oranges apiece are placed in each of two boxes.
2. Two oranges are placed in one box and one orange apiece is placed in each of two other boxes.
3. Each orange is placed in a distinct box.

Two oranges apiece are placed in each of two boxes: Choose which two of the five boxes each receive two oranges. Choose which two of the six apples are placed in the leftmost empty box. Choose which two of the remaining four apples are placed in the leftmost remaining empty box. Place the final two apples in the remaining empty box.

There are $$\binom{5}{2}\binom{6}{2}\binom{4}{2}\binom{2}{2}$$ such distributions.

Two oranges are placed in one box and one orange apiece is placed in each of two other boxes: Choose which of the five boxes receives two oranges. Choose which two of the remaining four boxes each receive one of the other two oranges. Choose which of the six apples is placed in the leftmost box with one apple and which of the remaining five apples is placed in the other box with one apple. Choose which two of the remaining four apples is placed in the leftmost empty box. The other two apples must be placed in the remaining empty box.

There are $$\binom{5}{1}\binom{4}{2}\binom{6}{1}\binom{5}{1}\binom{4}{2}\binom{2}{2}$$ such distributions.

Each orange is placed in a distinct box: There are $\binom{5}{4}$ ways to select which four of the boxes each receives one orange. There are $\binom{6}{2}$ ways to select which two apples are placed in the empty box. There are $4!$ ways to distribute the remaining four apples to the four boxes that each contain one orange.

There are $$\binom{5}{4}\binom{6}{2}4!$$ such distributions.

Since these cases are mutually exclusive and exhaustive, the number of ways to distribute four indistinguishable oranges and six distinct apples in such a way that two pieces of fruit are placed in each box is found by adding the results for each case.

$$\binom{5}{2}\binom{6}{2}\binom{4}{2}\binom{2}{2} + \binom{5}{1}\binom{4}{2}\binom{6}{1}\binom{5}{1}\binom{4}{2}\binom{2}{2} + \binom{5}{4}\binom{6}{2}4!$$

• Thanks a lot! Awesome explanation! – Maverick98 Aug 12 '18 at 9:08

First I would distribute apples. For each I have 5 possibilities, so that is $5^6$. Then we I should distibute oranges. Say in first box I put $a$ oranges, second $b$ oranges,... Notice that $a,b,c,d,e$ can be $0$. So we have to solve $$a+b+c+d+e = 4$$ and that I can do on ${8\choose 4}= 70$ ways.

Thus I can distibute given fruit on $5^6\cdot 70$ ways.

• What about the extra question – Maverick98 Aug 11 '18 at 16:58
• I'll think about it later – user582949 Aug 11 '18 at 17:55

First. The oranges combination you may consider:

$\big| \underbrace{||||}_{\text{4 sames}}\underbrace{oooo}_{\text{4 sames}}\big |$ you have permutation of 7 elements with 4 sames elements and 4 sames elements. The orange has $\frac{8!}{4!4!}$ ways to put into 5 boxes.

Second. The apples you may to arrange with these combinations:

Apple 1: ${ (a_1, box_1), (a_1, box_2), \dots, (a_1, box_5) }$, 5 ways

Apple 2: ${ (a_2, box_1), (a_2, box_2), \dots, (a_2, box_5) }$, 5 ways

$\vdots$

Apple 6: ${ (a_6, box_1), (a_6, box_2), \dots, (a_6, box_5) }$, 5 ways

You have $5^6$ combinations

Hence, you have $70\cdot5^6$ possibilities

• There are five boxes, so you should have four dividers. – N. F. Taussig Aug 11 '18 at 22:11
• Yes, I will correct this – GinoCHJ Aug 11 '18 at 23:16

You may see the problem as: $\big| \underbrace{|||}_{\text{3 sames}}\underbrace{oooo}_{\text{4 sames}}a_1a_2a_3a_4a_5a_6\big |$ then you have permutation of 13 elements with 3 sames elements and 4 sames elements. Hence, $\frac{13!}{3!4!}$ ways

• Your answer is incorrect. We do not care about the order of the apples within each box. – N. F. Taussig Aug 11 '18 at 18:57
• You are right! I make a mistake – GinoCHJ Aug 11 '18 at 20:58