Originally Posted by
sakhr98 Greetings,
I have the following question in couting. It might be straight forward but I could not find a formula for the answer.
Let N and m be positive integers.
How many combinations are there of the form:
n1, n2, ..., nN such that
n1 >=0, n2>=0, ..., nN >= 0, and
n1 + n2 + n3 + ... + nN = m.
Example: N = 3, m = 4:
All combinations are given by
1) 4, 0, 0,
2) 3, 1, 0,
3) 3, 0, 1,
4) 2, 2, 0,
5) 2, 1, 1,
6) 2, 0, 1,
7) 1, 3, 0,
8) 1, 2, 1,
9) 1, 1, 2,
10) 1, 0, 3,
11) 0, 4, 0,
12) 0, 3, 1,
13) 0, 2, 2,
14) 0, 1, 3,
15) 0, 0, 4
Therefore, the number of combinations for this example is 15.
Best regards.