Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

GATE | Gate IT 2008 | Question 24

  • Last Updated : 28 Jun, 2021

In how many ways can b blue balls and r red balls be distributed in n distinct boxes?
(A) [(n+b-1)!(n+r-1)!]/[(n-1)!b!(n-1)!r!]
(B) [(n+(b+r)-1)!]/[(n-1)!(n-1)!(b+r)!]
(C) n!/(b!r!)
(D) [(n+(b+r)-1)!]/[n!(b+r-1)!]

Answer: (A)


You have to distribute k balls x 1 ,x 2….. x k that correspond to the number of balls that will be placed in boxes 1, 2, 3 …..k respectively. Since, they should add up to n, you want to determine the number of solutions to the equation:
x 1 +x 2 +x 3 +x 4 +……+x k =n
solution for the given equation is : (n+k-1)C k = (n+k-1)!/k!(n-1)!
For distributing the b blue balls into n distinct boxes, equation will be  x 1 +x 2 +x 3 +….x b = n and solution of the equation will be (n+b-1)C b = (n+b-1)!/b!(n-1)!
For distributing the r red balls into n distinct boxes, equation will be x 1 +x 2 +x 3 +….x r = n and solution of the equation will be (n+r-1)C r = (n+r-1)!/r!(n-1)!
And For every way of distributing the b blue balls, there are r ways to distribute the red balls, so our total is br.
i.e. (n+b-1)! (n+r-1)! / b!(n-1)!r!(n-1)!  which is answer A.

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

Wikipedia: Stars_and_bars_combinatorics

This solution is contributed by Nitika Bansal.

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :