0
$\begingroup$

This question already has an answer here:

Your local grocery store just received a large shipment of apples, oranges, pears, and bananas---there are only 5 of each fruit. You are shopping at the store and will purchase your fruit for the week.

How many ways can you select $10$ pieces of fruit from your store's supply of apples, oranges, pears, and bananas, if you need at least $2$ oranges and $1$ apple?

I understand that there are 17 spots to choose from because 3 have been chosen and there are a total of 20 fruits. Would I use the combination by repetition formula? I can't quite wrap my head around what to do. Any help would be appreciated.

$\endgroup$

marked as duplicate by N. F. Taussig combinatorics Nov 26 '17 at 23:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Yes. You need to solve the equation $a + b + o + p = 7$ subject to the restrictions that $a \leq 4$, $b \leq 5$, $o \leq 3$, and $p \leq 5$. $\endgroup$ – N. F. Taussig Nov 26 '17 at 20:48
  • $\begingroup$ In the case of the combination formula (17 + r -1 choose 17). What would my r be? $\endgroup$ – Safder Aree Nov 26 '17 at 21:05
  • $\begingroup$ Why are you using $17$? You are only selecting an additional $7$ pieces of fruit. Please see my answer to this version of the question you posed. $\endgroup$ – N. F. Taussig Nov 26 '17 at 21:25
  • $\begingroup$ I looked over your solution. I see you approached it using the stars and bars method. How would I represent a <= 4 in terms of y? y = a+4? $\endgroup$ – Safder Aree Nov 26 '17 at 21:35
  • $\begingroup$ If there were no restrictions, the number of solutions would be $\binom{7 + 3}{3} = \binom{10}{3}$. From there, we must address the restrictions. Suppose $a > 4$. Then $a' = a - 5$ is a nonnegative integer. Substituting $a' + 5$ for $a$ in the equation $a + b + o + p = 7$ yields $a' + b + o + p = 2$, so $\binom{2 + 3}{3} = \binom{5}{3}$ solutions violate the restriction $a \leq 4$. $\endgroup$ – N. F. Taussig Nov 26 '17 at 21:41
2
$\begingroup$

As N. F. Taussig stated in the comments above, you need to solve for how many solutions (among non negative integers) has the equation:

$$\tag{I}a+o+p+b=7$$ with restrictions $a\le4, o\le3, p\le5, b\le5$

If there were no restrictions, then the equation (I) has ${{7+4-1}\choose{7}}=120$ non negative solutions.

But you need to subtract those who "violate" the restrictions (separately):

First ($a\le4$)

If $a\ge5$, this violates the first restriction. Let $y=a-5\ge0$, the equation becomes:

$$y+o+p+b=2$$ which has ${{2+4-1}\choose{2}}=10$ non negative solutions

Second ($o\le3$)

$o\ge4$ violates the second restriction. Let $z=o-4\ge0$, the equation becomes: $$a+z+p+b=3$$ which has ${{3+4-1}\choose{3}}=20$ non negative solutions

Third ($p\le5$)

$p\ge6$ violates the third restriction. Let $w=p-6\ge0$, the equation becomes: $$a+o+w+b=1$$ which has ${{1+4-1}\choose{1}}=4$ non negative solutions

Fourth ($b\le5$)

Analogously to the previous one, there are ${{1+4-1}\choose{1}}=4$ solutions who violate the fourth restriction

In total we have $10+20+4+4=38$ solutions of equation (I) such that do not follow the restrictions. Therefore, there are $120-38=82$ solutions

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.