1

How do I approach this problem? I know the formula but do not how it had come. Could you please explain to me the procedure, with examples if possible.

stars and bars theorem

Dan Rust
  • 30,108
raghu
  • 11
  • 2
    Welcome to MSE! For this question, what restrictions do we have on $x,y,z$? Do they have to be positive integers, or does this include solutions such as $0+0+n$? – Ben Grossmann Aug 01 '13 at 16:29
  • 1
    Stars and Bars works nicely, and is quite well explained by Wikipedia. For expressing as a sum of $3$ numbers there are other straightforward ways to list and count. – André Nicolas Aug 01 '13 at 16:31
  • Without another restriction on $x, y, z$, we have an infinite number of solutions... – apnorton Aug 01 '13 at 16:38

1 Answers1

2

Stars and Bars is a simple general procedure that works equally easily for the problem of expressing $n$ as the sum of $k$ non-negative integers. So I would consider it the right method to use. However, for a sum of three numbers, there are alternatives. We describe a natural one.

If $x=0$, there are $n+1$ choices for $y$, namely $0$ to $n$, and then $z$ is determined. So there are $n+1$ solutions with $x=0$.

If $x=1$ there are $n$ choices for $y$, namely $0$ to $n-1$. Once $y$ is chosen, $z$ is determined. So there are $n$ solutions with $x=1$.

If $x=2$ there are $n-1$ choices for $y$,

Continue. Finally, if $x=n$ there is only one choice for $y$.

Thus the total number of choices is $1+2+\cdots +n +(n+1)$. If we wish, this sum can be written in closed form as $\frac{(n+1)(n+2)}{2}$.

André Nicolas
  • 507,029