-2

Here is the problem:

Let M (the sum) be 10 and N (the number of numbers) be 4.

Some possible combinations are are (10, 0, 0, 0), (5, 3, 2, 0), (8, 1, 1, 0), (8, 2, 0, 0), (6, 2, 1, 1), etc.

How do I calculate the number of possible combinations?

Thanks for the help.

1 Answers1

0

As covered in the previous Question as well as the Wikipedia article, the number of such summations (order is important, so weak compositions rather than partitions) is $\binom{M+N-1}{N-1}$.


The example $M=10$ and $N=4$ of the OP then yields $\binom{13}{3} = 286$.

If instead we wanted to disregard order of summands, this is an overcount (since $6 + 1 + 1 + 0 = 0 + 1 + 1 + 6$, etc.). The number of integer partitions of $10$ with at most $4$ parts (zeros omitted, or padded out with zeros to give exactly four summands) is only $23$.

One can ask the Maxima Online Algebra Calculator to find this with the command:

length(integer_partitions(10,4));
hardmath
  • 37,015