If you are given
18 raw mangoes
,
14 ripe mangoes
and
10 rotten mangoes
, how many different groups of
2
0
mangoes can you form such that there are at least
5
mangoes of each type ?
∙ This problem is a part of the set Vegetable combinatorics
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Note that 7C2 is obtained through the Stars and Bars Theorem. More info about it can be found here: http://en.wikipedia.org/wiki/Stars and bars_(combinatorics)
nice solution..
I just used the stars and bars.
There must be at least 5 of each, so if we assume there are already four from each group picked, the stars and bars theorem will guarantee that there will be at least 5. So using the stars and bars on 8 (20-3(4)) and 3 gives 7C3=21
N.B.: since there must be at least 5 of each, the max you can have of one is 10, so the stars and bars falls within the parameters of the question.
Hi! Please could you explain how you solved it using generating functions? I'm quite new to the topic. Thanks
Log in to reply
Let a be raw mangoes, b be ripe and c be rotten mangoes.
Now, each must be at least 5, so
a + b + c = 2 0 − ( 5 ∗ 3 )
a + b + c = 5 and a ≤ 5 , b ≤ 9 , c ≤ 1 3
Now, the generating function for this becomes -
( 1 + x + . . . + x 5 ) ( 1 + x + . . . + x 9 ) ( 1 + x + . . . + x 1 3 ) in which we have to find co-efficient of x 5 .
1 − x 1 − x 6 1 − x 1 − x 1 0 1 − x 1 − x 1 4
( ( 1 − x ) − 3 ) ( 1 − x 6 ) ( 1 − x 1 0 ) ( 1 − x 1 4 )
Now, the last 3 are just trivial because all the positive powers of x are greater than 5. So, we just have to find the co-efficient of x 5 in ( 1 − x ) − 3 and we know that co-efficient of x k in ( 1 − x ) − n is C ( k + n − 1 , k ) . Hence, the answer is C ( 7 , 5 ) = 2 1
Absolutely correct,
Problem Loading...
Note Loading...
Set Loading...
Let there be w ra w mangoes, e rip e mangoes, and n rotte n mangoes. Then the problem is equivalent to finding the number of integer solutions to w + e + n = 2 0 , 5 ≤ w ≤ 1 8 , 5 ≤ e ≤ 1 4 , 5 ≤ n ≤ 1 0 .
Observe that given w + e + n = 2 0 and the lower bounds 5 ≤ w , e , n , all upper bounds are satisfied; if any type of mangoes go over the upper bound while the lower bounds are all satisfied, then the sum gets over 2 0 . For example, if n > 1 0 while w , e ≤ 5 , we have w + e + n > 2 0 . Thus we may as well ignore the upper bounds. Now let a = w − 5 , b = e − 5 , c = n − 5 so we have a + b + c = 5 and 0 ≤ a , b , c . This is a basic combinatorics problem, where the number of solutions is ( 3 − 1 5 + 3 − 1 ) = 2 1 .