Reply
Wed 2 Jul, 2014 01:37 am
Q: How many ways some integers (with repetition) can be added to get a particular sum. For example if my total sum is 4 and by using the integers 1,2,3 and 4 how many ways I can add these numbers to get 4. Order is not important. To get sum 4 the possible ways are give below.
1: 4 =4;
2: 3+1=4
3: 1+3=4;
4: 2+2=4
5: 1+1+2=4
6: 1+2+1=4
7: 2+1+1=4
8: 1+1+1+1+1=4;
So the total number ways is 8. For bigger sum like 100 there is is huge number ways by using the integers 1 to 100. Is it possible to derive a general formula ?
@muna27,
It's a binomial expansion.
2 : 1
3: 1 + 2 + 1
4: 1 + 3 + 3 + 1
n = sum of ((n-1)!/(n--1-i)!/i!) as i goes from 0 to n-1
@muna27,
Apparently, order is important.
engineer's example can be simplified to 2^(n-1).
@muna27,
Yes, It's Binomial expression.