Positive integral solutions to any equation $x + y + z = n$

64 Views Asked by At

I thought of using the balls and flags trick - where you use the flags to separate identical balls into different groups. But I am not able to discard the solutions in which I get $zeroes$. Please provide with a simplified proof. Thank you! :)

1

There are 1 best solutions below

0
On

To emphasize what @StubbornAtom said : consider an array of $n$ ones. To generate a sum of $k$ numbers which add p to $n$, you just have to separate your array in $k$ packets, which requires $k-1$ "walls". There are \binom{n-1}{k-1}$ ways to choose the places of your walls.

Example : $x+y+z=7$ : $$(1+1+1+1+1+1+1) \longrightarrow (1+1|1+1+1|1+1) \longrightarrow 2+3+2$$ You have to change $2=k-1$ of the $6=n-1$ "$+$" into "$|$".