Profile photo for Souvik Sinha Roy

TLDR: The formula given by Siddharth Mundada is correct, and for similar such questions, you can use it to determine the number of non-negative integer solutions.

The general formula is (n+r-1)C(n-1) where
r= RHS of the equation
n= number of variables


For an understanding of how this formula can be explained, imagine the following scenario:

You have 3 boxes, in which you have to place 15 identical items. In how many ways can you do this?

Let _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ be the 15 items

Now what we wish to do is insert two partitions | | so that these 15 items get divided into 3 boxes. Something like this:

_ _ _ _ | _ _ _ _ _ _ _ | _ _ _ _ corresponding to (4,7,4)

OR
like this

_ _ _ _ | _ _ _ _ _ _ _ _ _ _ _ | corresponding to (4,11,0)

So you can basically insert a partition anywhere in the gaps between two items, including at the two extremes of the chain.

--> You have 16 gaps to choose from initially in which you can place the first partition
--> You have 17 gaps for the second partition to choose from after placing the first partition
Hence no of ways= 16*17



However
By interchanging the 1st and the 2nd partition among themselves, we don't have new solutions
i.e

_ _ _ _ 1 _ _ _ _ _ _ _ _ _ 2 _ _ is the same as

_ _ _ _ 2 _ _ _ _ _ _ _ _ _ 1 _ _


Hence in general you have to divide by n! where n is the number of partitions in order to account for this.

--> Answer= 16*17/2 = (15+3-1)C(3-1)

View 4 other answers to this question
About · Careers · Privacy · Terms · Contact · Languages · Your Ad Choices · Press ·
© Quora, Inc. 2025