@ponderable said
Actually they look for the sum of eleven with four summands:
8+1+1+1
7+2+1+1
6+3+1+1 6+2+2+1
5+4+1+1 5+3+2+1 5+2+2+2
4+4+2+1 4+3+3+1 4+3+2+2
3+3+3+2
This should be the solution (11 cases)
I feel like this is missing many cases?
persons A,B,C,D.
Examine cases where A & B each buy 1: We have 8 distinct orders here.
A B C D
1 + 1 +1 + 8
1 + 1 +2 + 7
1 + 1 +3 + 6
1 + 1 +4 + 5
1 + 1 +5 + 4
1 + 1 +6 + 3
1 + 1 +7 + 2
1 + 1 +8 + 1
Start to generalize:
Examine the case of 5 into 3 summands:
1 ○ 1 ○ 1 ○ 1 ○ 1
Fill the ○'s with + signs to form the sum:
1 + 1 + 1 ○ 1 ○ 1 = 1+1+3
1 + 1 ○ 1 + 1 ○ 1 = 1+2+2
1 + 1 ○ 1 ○ 1 + 1 = 1+3+1
1 ○ 1 + 1 + 1 ○ 1 = 2+1+2
1 ○ 1 + 1 ○ 1 + 1 = 2+2+1
1 ○ 1 ○ 1 + 1 + 1 = 3+1+1
So in general:
Let S = the Sum
N = number of Summands
What this amounts to is the number of combinations "C" we can fill (S-1) ○'s with (N-1) + signs
C(n,r) = n!/( r!*(n-r)! ) ( n objects choose r )
For this:
n = S-1
r = N-1
C = ( S -1 )!/ ( ( N-1)! ( S - N )! )
For my example we see S = 5, n = 3.
4! / ( 2! * 2! ) = 6
This matches the enumeration above.
For another example lets do Sum of 4 into 2 summands:
1 + 1 ○ 1 ○ 1 = 1 + 3
1 ○ 1 + 1 ○ 1 = 2 + 2
1 ○ 1 ○ 1 + 1 = 3 +1
The formula yeilds: S = 4, n = 2
C = 3!/( 1! * 2! ) = 3
Same as enumerated above
Extending this to the problem:
S = 11
n = 4
C = ( 11 -1 )!/ ( ( 4-1)! ( 11 - 4 )! ) = 10!/( 3! * 7! ) = 120 Ways