In how many ways can a natural number $n$ be split into $m$ natural numbers (parts) where each part is less than $n$, the parts don't necessarily have to be equal, and all of them add up to $n$?
-
2Does order matter? Are $2+2+3$ and $2+3+2$ different splittings of $7$ into $3$ parts? – André Nicolas May 31 '15 at 16:22
-
2If the order matters, as @AndréNicolas mentioned, then the problem is pretty simple. Otherwise, this problem is extremely non-trivial, and there are entire books devoted to the subject. – May 31 '15 at 16:30
-
Also, are parts positive integers, or will zero parts be allowed? – hardmath May 31 '15 at 20:14
-
Yes the order matters and zero is also allowed but the sum of all m numbers should be n, and no repititions allowed, ex 7 cannot have more than one of 2+2+3. Also @eloiPrime could you tell me what that particular non-trivial problem is called. – lapin Jun 01 '15 at 10:54
-
The problem is that of integer partitions, and is fundamental to partition theory. Also, I recommend making some edits to your question to make it more clear. In your question you said "the parts don't necessarily have to be equal", implying that they can be, yet you said that they cannot be equal in your above comment. – Jun 01 '15 at 11:22
-
1I apologise for not being able to explain properly. For example in case of 7, one of the ways can be (2,2,3) the parts can be equal so here we have 2 parts with 2 but it cannot have another (2,2,3). It can and must have permutations of (2,2,3). – lapin Jun 01 '15 at 13:27
2 Answers
When summands are allowed to be zero, these are known as weak compositions of integer $n$ having $m$ parts.
They are readily counted by the "stars-and-bars" technique, as Rus May indicated. This is a frequently-asked-question here.
The expressions where we are required to discount summations that differ only in regard to the order of otherwise the same summands are called partitions of integer $n$ having at most $m$ parts. For these there are no simple binomial coefficient counting formulas, although work by Ramanujan and others led eventually to a "closed form" of sorts. Therefore the counting of integer partitions is more difficult than of integer compositions, despite the overall similarity of problems.
This is the "stars and bars" problem: $n$ stars, $m-1$ bars, so $\binom{n+m-1}n$ ways to split $n$ up into $m$ parts.

- 2,087
-
-
It'd be hard to improve on the article about stars and bars in Wikipedia (link below in hardmath's post). In a nutshell, you think of $n$ as stars and the $m$ parts divided by $m-1$ bars. Then, there's a one-to-one correspondence between the partitions and the combinations. – Rus May Jun 02 '15 at 21:20
-
1