
David W. answered 06/22/15
Tutor
4.7
(90)
Experienced Prof
There are multiple methods for finding the number of combinations that produce a sum of 43.
Other tutors may present a math method that first selects 40 then finds how many combinations produce 3, and choose 30 then find how many combinations produce 13, then ...
However, with my computer, I counted them (it's called exhaustive enumeration) by trying all combinations and checking to see if the sum = 43. There were 66.
Hope you can demonstrate that mathematically.
0 0 0 0 9 8 7 6 5 4 3 0 1
0 0 0 10 0 8 7 6 5 4 0 2 1
0 0 0 10 0 8 7 6 5 4 3 0 0
0 0 0 10 9 0 7 6 5 0 3 2 1
0 0 0 10 9 0 7 6 5 4 0 2 0
0 0 0 10 9 8 0 6 0 4 3 2 1
0 0 0 10 9 8 0 6 5 0 3 2 0
0 0 0 10 9 8 0 6 5 4 0 0 1
0 0 0 10 9 8 7 0 0 4 3 2 0
0 0 0 10 9 8 7 0 5 0 3 0 1
0 0 0 10 9 8 7 0 5 4 0 0 0
0 0 0 10 9 8 7 6 0 0 0 2 1
0 0 0 10 9 8 7 6 0 0 3 0 0
0 0 20 0 0 0 7 6 0 4 3 2 1
0 0 20 0 0 0 7 6 5 0 3 2 0
0 0 20 0 0 0 7 6 5 4 0 0 1
0 0 20 0 0 8 0 0 5 4 3 2 1
0 0 20 0 0 8 0 6 0 4 3 2 0
0 0 20 0 0 8 0 6 5 0 3 0 1
0 0 20 0 0 8 0 6 5 4 0 0 0
0 0 20 0 0 8 7 0 0 4 3 0 1
0 0 20 0 0 8 7 0 5 0 0 2 1
0 0 20 0 0 8 7 0 5 0 3 0 0
0 0 20 0 0 8 7 6 0 0 0 2 0
0 0 20 0 9 0 0 0 5 4 3 2 0
0 0 20 0 9 0 0 6 0 4 3 0 1
0 0 20 0 9 0 0 6 5 0 0 2 1
0 0 20 0 9 0 0 6 5 0 3 0 0
0 0 20 0 9 0 7 0 0 4 0 2 1
0 0 20 0 9 0 7 0 0 4 3 0 0
0 0 20 0 9 0 7 0 5 0 0 2 0
0 0 20 0 9 0 7 6 0 0 0 0 1
0 0 20 0 9 8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 0 1
0 0 20 10 0 8 0 0 5 0 0 0 0
0 0 20 10 9 0 0 0 0 0 3 0 1
0 0 20 10 9 0 0 0 0 4 0 0 0
0 30 0 0 0 0 0 0 5 4 3 0 1
0 30 0 0 0 0 0 6 0 4 0 2 1
0 30 0 0 0 0 0 6 0 4 3 0 0
0 30 0 0 0 0 0 6 5 0 0 2 0
0 30 0 0 0 0 7 0 0 0 3 2 1
0 30 0 0 0 0 7 0 0 4 0 2 0
0 30 0 0 0 0 7 0 5 0 0 0 1
0 30 0 0 0 0 7 6 0 0 0 0 0
0 30 0 0 0 8 0 0 0 0 3 2 0
0 30 0 0 0 8 0 0 0 4 0 0 1
0 30 0 0 0 8 0 0 5 0 0 0 0
0 30 0 0 9 0 0 0 0 0 3 0 1
0 30 0 0 9 0 0 0 0 4 0 0 0
0 30 0 10 0 0 0 0 0 0 0 2 1
0 30 0 10 0 0 0 0 0 0 3 0 0
40 0 0 0 0 0 0 0 0 0 0 2 1
40 0 0 0 0 0 0 0 0 0 3 0 0
THERE ARE: 66

David W.
Computers are very, very, very fast. They are also very, very, very accurate (if you give correct instructions). It took me 5 minutes to write instructions and the computer was so fast I couldn't measure it.
Exhaustive iteration means to try every single possibility and to test whether the result meets the criteria.
This problem resembles the problem of making change for dollars paid minus price; for selecting a subset of workers to produce a product; etc, (there are lots of these types of problems).
What I did is similar to this:
Set Y=0
For A goes from 0 to 1 Step 1
For B goes from 0 to 2 Step 2
For C goes from 0 to 3 Step 3
For D goes from 0 to 4 Step 4
For E goes from 0 to 5 Step 5
For F goes from 0 to 6 Step 6
For G goes from 0 to 7 Step 7
For H goes from 0 to 8 Step 8
For I goes from 0 to 9 Step 9
For J goes from 0 to 10 Step 10
For K goes from 0 to 20 Step 20
For L goes from 0 to 30 Step 30
For M goes from 0 to 40 Step 40
If A+B+C+D+E+F+G+H+I+J+K+L+M = 43 then
Y=Y+1
Output A,B,C,D,E,F,G,H,I,J,K,L,M
NEXT M
NEXT L
NEXT K
NEXT J
NEXT I
NEXT H
NEXT G
NEXT F
NEXT E
NEXT D
NEXT C
NEXT B
NEXT A
Output "There are: ",Y
This considers all possibilities of combinations and counts and prints those that total 43. There are lots of free software languages that can do this -- Java, C, Pearl, etc. I used a simple flow-chart interpreter program (RAPTOR is free; Visual Logic is $45; both have errors).
Note: The mathematical approach is often the best to learn if you can.
Report
06/23/15
Teleplazm M.
06/23/15