3

In how many ways i can write 12 as an ordered sum of integers where the smallest of that integers is 2? for example 2+10 ; 10+2 ; 2+5+2+3 ; 5+2+2+3; 2+2+2+2+2+2;2+4+6; and many more

leava_sinus
  • 1,243
  • 4
  • 10
  • 5
  • Why is the question mark after your statement "The smallest of that integers is 2"? – Srijan Apr 17 '13 at 07:38
  • 1
    @srijan I think it is supposed to be the end of the first sentence. – Karl Kroningfeld Apr 17 '13 at 07:40
  • @user1 I think so. – Srijan Apr 17 '13 at 07:41
  • Why are you talking about "order" if you say both "2+10" and "10+2" are ok ? I guess what you mean by ordered is that you want to find a set of integers $(a_i)_{i\in[1,n]}$ where $\cases{a_1=2 \ a_1 \leq a_2 \leq ... \leq a_n \ a_1+...+a_n=12}$ – Dolma Apr 17 '13 at 08:31
  • 2
    http://en.wikipedia.org/wiki/Partition_(number_theory) – lab bhattacharjee Apr 17 '13 at 08:34
  • @Dolma: No, he does mean ordered sums, counting "2+10" and "10+2" are distinct. The "ordered" doesn't mean that the terms within a particular sum are in sorted order, but just that their order is relevant. – ShreevatsaR Apr 17 '13 at 09:42
  • @ShreevatsaR: Yes I realized this a few minutes after posting my comment. – Dolma Apr 17 '13 at 10:10
  • Btw if your consider only partitions (order not relevent) then the answer is p(12)-p(11). For a proof see: http://math.stackexchange.com/questions/356104/related-to-the-partition-of-n-where-pn-2-denotes-the-number-of-partitions –  Apr 17 '13 at 10:54

5 Answers5

9

There are $89$ ways (and $89$ is the $11$th Fibonacci number).


You're looking for "restricted compositions" of $12$ (the restriction being that each part is at least $2$).

In Sage (doc):

sage: Compositions(12, min_part = 2).list()
[[12], [10, 2], [9, 3], [8, 4], [8, 2, 2], [7, 5], [7, 3, 2], [7, 2, 3], [6, 6], [6, 4, 2], [6, 3, 3], [6, 2, 4], [6, 2, 2, 2], [5, 7], [5, 5, 2], [5, 4, 3], [5, 3, 4], [5, 3, 2, 2], [5, 2, 5], [5, 2, 3, 2], [5, 2, 2, 3], [4, 8], [4, 6, 2], [4, 5, 3], [4, 4, 4], [4, 4, 2, 2], [4, 3, 5], [4, 3, 3, 2], [4, 3, 2, 3], [4, 2, 6], [4, 2, 4, 2], [4, 2, 3, 3], [4, 2, 2, 4], [4, 2, 2, 2, 2], [3, 9], [3, 7, 2], [3, 6, 3], [3, 5, 4], [3, 5, 2, 2], [3, 4, 5], [3, 4, 3, 2], [3, 4, 2, 3], [3, 3, 6], [3, 3, 4, 2], [3, 3, 3, 3], [3, 3, 2, 4], [3, 3, 2, 2, 2], [3, 2, 7], [3, 2, 5, 2], [3, 2, 4, 3], [3, 2, 3, 4], [3, 2, 3, 2, 2], [3, 2, 2, 5], [3, 2, 2, 3, 2], [3, 2, 2, 2, 3], [2, 10], [2, 8, 2], [2, 7, 3], [2, 6, 4], [2, 6, 2, 2], [2, 5, 5], [2, 5, 3, 2], [2, 5, 2, 3], [2, 4, 6], [2, 4, 4, 2], [2, 4, 3, 3], [2, 4, 2, 4], [2, 4, 2, 2, 2], [2, 3, 7], [2, 3, 5, 2], [2, 3, 4, 3], [2, 3, 3, 4], [2, 3, 3, 2, 2], [2, 3, 2, 5], [2, 3, 2, 3, 2], [2, 3, 2, 2, 3], [2, 2, 8], [2, 2, 6, 2], [2, 2, 5, 3], [2, 2, 4, 4], [2, 2, 4, 2, 2], [2, 2, 3, 5], [2, 2, 3, 3, 2], [2, 2, 3, 2, 3], [2, 2, 2, 6], [2, 2, 2, 4, 2], [2, 2, 2, 3, 3], [2, 2, 2, 2, 4], [2, 2, 2, 2, 2, 2]]
sage: Compositions(12, min_part = 2).cardinality()
89

The number for general $n$ in place of $12$ would be interesting to calculate. Using Sage again:

sage: print ','.join(str(Compositions(n, min_part = 2).cardinality()) for n in range(20))
1,0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584

Searching for that on OEIS gives A212804 as the sequence.

This of course is the Fibonacci sequence with an additional "1" at the beginning.


Now it would be interesting to prove that it is so for general $n$. This is easy now that we know what to prove. Let's call compositions with each part at least $2$ as "good" compositions. Let $C_n$ be the number of "good" compositions of $n$. Any such "good" composition either begins with $2$ or with a number greater than 2:

  • If it starts with $2$, then it can be got by prepending a $2$ to a "good" composition of $n-2$ (and there are $C_{n-2}$ of them)

  • If it starts with a number greater than $2$, then it can be got by taking a "good" composition of $n-1$ (there are $C_{n-1}$ of them) and incrementing the first element by one.

So $C_n = C_{n-2} + C_{n-1}$, which along with the initial conditions $C_0 = 1$ and $C_1 = 0$, proves what we wanted to prove.

ShreevatsaR
  • 41,374
5

You are looking for number of partitions of 12 in parts greater than 1. Because their number is not so big we can present all of them in a list bellow $$\begin{array}{c|c} 2+2+2+2+2+2 & 1 \\ 2+2+2+2+4 & 5 \\ 2+2+2+3+3 & 10 \\ 2+2+2+6 & 4 \\ 2+2+3+5 & 12 \\ 2+2+4+4 & 6 \\ 2+3+3+4 & 12 \\ 3+3+3+3 & 1 \\ 2+2+8 & 3 \\ 2+3+7 & 6 \\ 2+4+6 & 6 \\ 2+5+5 & 3 \\ 3+3+6 & 3 \\ 3+4+5 & 6 \\ 4+4+4 & 1 \\ 2+10 & 2 \\ 3+9 & 2 \\ 4+8 & 2 \\ 5+7 & 2 \\ 6+6 & 1 \\ 12 & 1 \\ \end{array}$$ The partition turn in composition if we rearrange them. Number of arrangements is given on the right, so total number of compositions is $89$

Adi Dani
  • 16,949
3

Following answer is for general case. Denote by $c_m(1,n)=\binom{n-1}{m-1}$ the number of composition of $n$ into $m$ positive parts, and by $c_m(2,n)$ number of compositions of $n$ into $m$ parts greater than $1$. Each composition of $n$ into $m$ parts greater than $1$, if all parts decrease by 1, becomes a composition of $n-m$ into $m$ positive parts. That means $$c_m(2,n)=c_m(1,n-m)=\binom{n-m-1}{m-1}$$ Number of all compositions of $n$ into parts greater than $1$ is $$c(2,n)=\sum_{m=1}^{n}c_m(2,n)=\sum_{m=1}^{n}\binom{n-m-1}{m-1}$$ In our case $n=12$ $$c(2,12)=\sum_{m=1}^{12}\binom{11-m}{m-1}=\sum_{m=1}^{6}\binom{11-m}{m-1}=$$ $$=\binom{10}{0}+\binom{9}{1}+\binom{8}{2}+\binom{7}{3}+\binom{6}{4}+\binom{5}{5}=$$ $$1+9+28+35+15+1=89$$

ShreevatsaR
  • 41,374
Adi Dani
  • 16,949
  • I think the final expression is too complicated: if you can prove that $\sum_{m=1}^n\binom{n-m-1}{m-1} = F_{n-1}$, then that would be cool. But this is a nice solution, +1. – ShreevatsaR Apr 18 '13 at 04:53
  • For such proof you can see at http://math.stackexchange.com/questions/297443/prove-the-following-equality-sum-k-0n-binom-n-k-k-f-n/297490#297490 – Adi Dani Apr 18 '13 at 07:11
1

Let's split the question into a few pieces.

First part: how many ways to sum if all numbers are even? In this case, it's a simple partition problem, and the answer is equally simple. If you imagine the digits like this:

..|..|..|..|..|.. = 2+2+2+2+2+2

Then each of the five dividers can either be there or not, giving exactly $2^5=32$ ways of summing when they're all even.

Second part: Having the odd part summing to six, how many ways? In this case, there's just 3+3, and then you place three 2s and two 3s, which is equivalent to choosing two places in a sequence of five to place the 3s. But you can also place a 2 and a 4, a 4 and a 2, or a 6. So that's $\binom{5}{2}+2\binom{4}{2}+\binom{3}{2}=10+2\cdot6+3=25$. So far, we have 57.

Third part: Having the odd part summing to eight, how many ways? In this case, there's 3+5 and 5+3, and either two 2s or a 4. So that's $2\binom{4}{2}+2\binom{3}{2}=2\cdot 6+2\cdot 3 = 18$. We're up to 75.

Fourth part: Having the odd part summing to ten, how many ways? In this case, there's 3+7, 5+5, and 7+3, and then a 2 in each case. So there's three ways of placing the 2, and then three ways of choosing the remaining number pair, for a total of 9. That brings us to 84.

Final part: Having the odd part summing to twelve, how many ways? In this case, it's easiest to count - there's 3+3+3+3, 3+9, 5+7, 7+5, and 9+3, for a total of 5. So our answer is 89.

Glen O
  • 12,425
1

All the posted answers are answering the following variation of the original question: "In how many ways i can write 12 as an ordered sum of integers where the smallest of those integers is at least 2?". But, the question asks the count when the smallest of the integers is equal to 2, so all the posted answers are over-counting (polite way to say that they are incorrect) -- for example, 3+4+5 or 6+6 are not valid compositions since the smallest integer is 3 and 6, respectively, in these examples, not 2. Discounting such compositions from Adi Dani's enumerative solution above, I get 70.

Dr T.
  • 11