Pages

Saturday, August 23, 2014

How many Solutions of x + y + z = k

In this post we will consider all the positive integer solutions of the equation x + y + z = k. At the end of the post we will generalize the method.

Let us first solve the equation. There is a x, a y and a z. We can consider x 1's, y 1's and z 1's. So there are a total of (x + y + z) 1's. We can find its integer solutions by separating  1's at different positions. Consider the equation x + y + z = 9.

Some of the solutions of the equation are
11|111|1111 (2+3+4)
111|111|111 (3+3+3)
1111|111|11 (4+3+2)
1111|11|111 (4+2+3)
11|11|11111 (2+2+5)

Add all the ones in one group separated by |. The number of solutions of this type is the solution of the equation x + y + z = 9. The number of solutions of the equation is (9+2)!/(9!2!) = (11×10)/2 = 55. Hence there are 55 solutions. If we have the total as k and the number of plus sign is n. Then the total number of solutions is (k+n)!/(k!n!). This can be written in the combination symbol as C(n+k,k).

This equation is similar as taking the combination of r things in n containers of similar kind. The number of combinations is (n+r−1)!/(n−1)!r!. This can be written in the combination symbol as C(n+r−1,r).

No comments:

Post a Comment