Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

To find all solutions greater than or equal to $1$ of a linear equation in the form

$$x_1+x_2+x_3+\cdots+x_k=n ,$$

the number of them is $\binom{n-1}{k-1}$.

If I need all solutions to be greater or equal to $0$ why is it then $\binom{n+k-1}{k-1}$?

Please help. Thanks.

share|cite|improve this question
I'm not quite sure what you're asking, but look at the equation $x_1+x_2+\cdots+x_k=n+k$ and consider "the number of solutions greater than or equal to 1". – David Mitra Dec 17 '11 at 8:30
As mentioned, take $y_i=x_i-1,$ then consider $y_1+...+y_k=n.$ – Ehsan M. Kermani Dec 17 '11 at 8:43
up vote 2 down vote accepted

If $y_1,\ldots y_k$, where all $y_i \ge 0$, is a solution of the equation

$$x_1 + x_2 + \ldots x_k = n, x_i \ge 0,i=1 \ldots k$$

then $y_1 + 1, y_2 + 1, \ldots, y_n + 1$ is a solution to the equation

$$x_1 + x_2 + \ldots x_k = n+k,x_i \ge 1,i=1 \ldots k$$

of which there are $\binom{n+k-1}{k-1}$ by your own formula.

Reversely, for any solution for the second equation, substracting 1 from each (which is possible) gives a solution for the first one, so the operation of adding 1 to each solution is a bijection between the solution sets of these 2 equations.

share|cite|improve this answer

put $y_i=x_i+1$ then $y_1+1+y_2+1...+y_k+1=n$ then $y_1+y_2+...+y_k=n-k,$$y_i \ge 0,i=1 \ldots k$.

therefore the number of items is equal to $$\binom {n-1}{k-1}$$ if in sentence instead of $n$ put $(n+k)$ then the number of items is equal to $$\binom {n+k-1}{k-1}$$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.