Repeated sum and partial difference equation
This paper is inspired by this post. It asked how to count the number of solutions of the equation with non-negative integral solution:
x_1 + ... + x_k = n
without using the standard method of line and dot counting. I transform the problem into a partial difference equation, and solve a general form of the equation. The solution to the partial difference equation corresponds to repeated summation of a particular expression.
Content |
Introduction
In this article, I will first state the problem that I would like to solve. Then I will give the standard solution using the line and bar counting method. Next, I will transform it into a partial difference equation, which can help us to simplify the following repeated sum:
For any .
The Problem
Find the number of solutions to the following equation with non-negative integral solution:
A Standard Solution
For illustration, we fixed k = 4, n = 6.
We may think of, we are putting 6 balls into 4 boxes. And how many ways we can organize organize them?
Let's look at the following figure:

Balls and Lines
For 4 boxes, we only need 3 lines to separate the balls into 4 different groups. For the above figure, it corresponds to:
To count the number of solutions, let's imagine that we have 9 empty spaces. Each spaces can hold either a ball or a line. After we put 6 balls and 3 lines into it, we have 1 solution to the system. The total number of solutions is just . For general n and k, the solution is:
which means we choose n balls out of n+k-1 of items.
Recurrence Approach
First, let be the number of solution for the equation.
Now, consider if we increase the value of k by 1. To do so, we have 1 more variable, , and it can take values from 0 to n. When
, the other variables need to be summed to n-i. So the number of solution is
.
Therefore, we have:
..............................(1)
If we repeatedly apply (1) to itself, we have:
................................(2)
or
.......................................(3)
Therefore, if we solve (1), we will find the repeated sum of the form (2) or (3).
Partial Difference Equation
Equation (1) is still too difficult to be solved. Therefore, I simplify it using telescope method:
...........................................................................(4)
(4) is a partial difference equation that can be easily solved using generating function method.
Generating Function
Define:
Multiple (4) by and do a summation on k from zero to infinite, we have:
We stopped at k = 1, since . Now, let's find out what's
first.
From the definition of S, we know that:
since for 1 variable to sum to n, we only have 1 solution, that is x = n.
Therefore:
Now, we have:
To find out the explicit form of S, we do a power series expansion on S:
So the explicit form of S is:
From (2), we have found the following formula:
Other Summation Function
For any other , we set
.
Therefore we found the following repeated sum:
Conclusion
I have solved the problem of finding the number of solutions to the equation:
with non-negative integral solutions. I first gave an combinatoric approach which is more easy. Then I solve the problem in another way by transforming the problem to a partial difference equation. The solution is found to be:
And using similar approach, I found out the formula for repeated sum as well:
Please login to post comment.