How many different nonempty baskets can I make consisting of

68 Views Asked by At

I have $5$ identical apples, $8$ identical oranges and $13$ identical bananas. How many different nonempty baskets can I make consisting of

a) $5$ fruits?

b) $7$ fruits?

My solution : First of all , I thought that this can be solved by combination with repetition but , i then relaized it cant be ,so i tried to use generating functions , i found that

$a=21$ ,$b=33$ .Is my solution correct ? Do you have any other suggestion to solve this?

Note: For part $a$ , the result of generating fuction and combination with repetition are not same , why did it occur ?

2

There are 2 best solutions below

0
On

$21$ and $33$ are correct.

One way of seeing $21$ is correct for $5$ fruit is a stars and bars calculation of ${5+3-1 \choose 3-1}$

For $7$ fruit the stars and bars calculation would be ${7+3-1 \choose 3-1}=36$, but this overcounts as there are not enough apples: in particular we cannot have (i) $6$ apples and $1$ orange, or (ii) $6$ apples and $1$ banana, or (iii) $7$ apples. So the answer is $36-3=33$

0
On

We need to count the number of non-negative solutions to the equation $$ n_1+n_2+n_3=n $$ where $n=5 (a)$ or $7 (b)$ with the restrictions $n_1<6,n_2<8,n_3<13$.

Obviously for the part $(a)$ the restrictions play no role and the answer by stars and bars is simply: $$ \binom{5+3-1}5=21. $$

In the case $(b)$ only the restriction on $n_1$ matters, and applying the same method as before plus inclusion-exclusion principle we obtain: $$ \binom{7+3-1}{3-1}-\binom{7+2-1-6}{2-1}-\binom{7+2-1-7}{2-1}=33, $$ where we subtracted the cases with 6 and 7 apples.