Usually the standard explanation goes like this :- Consider for example , X1+X2+X3=5. The solution can be considered equivalent to 5 *s separated by 2 |s . For example (1,2,2) corresponds to *|**|** . In the general case, M *s and N-1 |s and that gives ((M+N-1) choose (N-1))
That’s right:) Alternatively (or more like equivalently), you can add 1 to the second smallest element, 2 to the third smallest element, and so on, and reduce the problem to choosing M different numbers from 1 to N + M – 1.