For this article, by an integer equation we will mean an equation of the form
where all the are integers. In addition, we can impose more constraints on these variables. For example, all the ‘s are nonnegative, or , or whatever appropriate constraints that are possible for integral variables.
The problem that we are concerned with in this article is finding the number of nonnegative solutions to an integer equation, a problem that is encountered very frequently in the subject of permutations and combinations in different guises. Lets take an example on an integer equation and list down some of its nonnegative solutions.
etc. 
Why do we care about counting the nonnegative solutions to an integer equation? Why is this particular problem so important? Well, because it crops up in so many different kinds of problems, which may seem seemingly unrelated.
Problem: 1  

Suppose that a person goes to a softdrinks shop with an empty crate which can store 24 bottles. There are 4 brands of softdrinks available at the shop: Coke, Pepsi, Sprite and Dew. In how many ways can the person fill up the crate? 
Solution 


Lets represent the number of Coke bottles the person buys with . Similarly, we will have and . The total number of bottles to be filled is . Also, the number of bottles for each brand will obviously be a nonnegative integer (it can be , which means no bottle from that brand). Thus, to count the number of ways to fill up the crate, we simply count the number of nonnegative solutions to the integer equation: 
Example: 2  

Suppose that a person has n identical rolling dice (a rolling die is a perfect cube with faces marked 1 to 6) which he rolls at once. How many distinct throws are possible in this scenario? 
Solution  

Ok, this is another really interesting problem, and lets see how it reduces to finding the number of nonnegative solutions to an integer equation. Note that the dice are identical, which means that there is no way to distinguish between two dice. When such dice are rolled simultaneously, how can the outcome be described in words? Since we cannot distinguish between any two dice, we cannot talk about the outcomes on particular dices. All we can say is that we obtained these many ““s, these many ““s, these many ““s, and so on, with the total number of outcomes being , since there are dice. Now, suppose that when the dice are rolled simultaneously, represents the number of ““s obtained, represents the number of ““s obtained, and so on. This, to count the number of distinct throws, all we have to do is to calculate the number of nonnegative solutions to the integer equation: 
Now that we have seen why the general problem we are talking about is important, let us begin talking about how actually to solve that problem. For that, we first recall a basic formula from the theory on permutations and combinations:
Let there be a total of objects, of which are identical and of one kind, are identical and of another kind, and so on, up to . Thus, we’ll have . The number of permutations of these objects taken all at a time is given by
Thus, for example, if we consider the string aaaaaaabbbbb, which has a symbols and b symbols, which means a total of symbols, the number of permutations of this string is .
Coming back to our integer equation, we take a particular example again, one we have already taken, and find the number of its nonnegative solutions.
We take a particular nonnegative solution to this equation, say and analyze it more closely. We breakup this solution and write it as follows:
Similarly, the particular solution can be written as:
while the particular solution can be written as:
The pattern that we observe is that each solution can be expressed as a string of symbols, consisting of “” symbols and “” symbols. Convince yourself about this point. Take any particular solution and break it up as we have described. You will obtain a string of symbols of which are “” and are ““. Thus, every solution can be described by such a string, and every such string corresponds to a nonnegative solution. That is, there is a onetoone correspondence between the set of solutions and the set of such strings. In other words, to count the required number of solutions, we simple count the number of strings with symbols, of them identical and of one kind, and of them identical and of another kind. The required number of solutions is therefore
If you are not clear about the reasoning process, it is imperative that you go through it again before proceeding on. Now let us generalize this example to the general integer equation:
In this case, once we breakup any particular solution, we will have a total of “” symbols, and “” symbols. Verify this yourself by comparing it with the particular example we took above. Thus, each particular solution can be represented by a string with of length , consisting of “” symbols and “” symbols. The number of permutations of this string will be or . This is also the required number of solutions.
We are now in a position to calculate the final answers to the two problems above. For Problem1, and , and so the required answer is . For Problem2, the answer is .